Removed all are in the ports
This commit is contained in:
@ -1,146 +0,0 @@
|
|||||||
PORTNAME= ldb
|
|
||||||
PORTVERSION= 2.9.2
|
|
||||||
CATEGORIES= databases
|
|
||||||
MASTER_SITES= SAMBA
|
|
||||||
PKGNAMESUFFIX?= ${PORTVERSION:C/([[:digit:]]+)[.]([[:digit:]]+).*/\1\2/}
|
|
||||||
|
|
||||||
MAINTAINER= samba@FreeBSD.org
|
|
||||||
COMMENT= LDAP-like embedded database
|
|
||||||
WWW= https://ldb.samba.org/
|
|
||||||
|
|
||||||
LICENSE= GPLv3+
|
|
||||||
|
|
||||||
IGNORE_NONTHREAD_PYTHON= needs port lang/python${PYTHON_SUFFIX} to be \
|
|
||||||
build with THREADS support
|
|
||||||
|
|
||||||
BUILD_DEPENDS= ${_LDB_DEPENDS} \
|
|
||||||
cmocka>=1.1.3:sysutils/cmocka
|
|
||||||
RUN_DEPENDS= ${_LDB_DEPENDS}
|
|
||||||
TEST_DEPENDS= ${_LDB_DEPENDS} \
|
|
||||||
cmocka>=1.1.3:sysutils/cmocka
|
|
||||||
|
|
||||||
USES= compiler ldap localbase:ldflags pkgconfig
|
|
||||||
USE_LDCONFIG= yes
|
|
||||||
|
|
||||||
HAS_CONFIGURE= yes
|
|
||||||
CONFIGURE_LOG= ${BUILD_WRKSRC}/bin/config.log
|
|
||||||
PKGCONFIGDIR?= ${PREFIX}/libdata/pkgconfig
|
|
||||||
CONFIGURE_ARGS+= --bundled-libraries=!talloc,!tevent,!tdb,!popt,!cmocka \
|
|
||||||
--disable-rpath \
|
|
||||||
--with-modulesdir=${PREFIX}/lib/shared-modules \
|
|
||||||
--with-openldap=${LOCALBASE} \
|
|
||||||
--with-privatelibdir=${PREFIX}/lib/ldb \
|
|
||||||
--without-gettext
|
|
||||||
CONFIGURE_ENV+= NOCOLOR=yes
|
|
||||||
MAKE_ENV+= NOCOLOR=yes
|
|
||||||
CFLAGS+= ${_CFLAGS_${COMPILER_TYPE}}
|
|
||||||
DEBUG_FLAGS= -g -ggdb3 -O0
|
|
||||||
# Some symbols in ldb's linker version scripts are not defined, but since the
|
|
||||||
# scripts are generated dynamically, suppress errors with lld >= 17 due to these
|
|
||||||
# undefined symbols.
|
|
||||||
LDFLAGS+= -Wl,--undefined-version
|
|
||||||
|
|
||||||
CONFLICTS_INSTALL= ldb[0-9][0-9] # include/ldb.h
|
|
||||||
|
|
||||||
BINARY_ALIAS= python3=${PYTHON_CMD}
|
|
||||||
|
|
||||||
PLIST_FILES= ${_LDB_BINS} \
|
|
||||||
${_LDB_LIBS_64} \
|
|
||||||
${_LDB_LIBS} \
|
|
||||||
${_LDB_MAN1} \
|
|
||||||
${_LDB_MAN3} \
|
|
||||||
${PKGCONFIGDIR}/ldb.pc \
|
|
||||||
include/ldb.h \
|
|
||||||
include/ldb_errors.h \
|
|
||||||
include/ldb_handlers.h \
|
|
||||||
include/ldb_module.h \
|
|
||||||
include/ldb_version.h
|
|
||||||
|
|
||||||
PLIST_SUB+= PKGCONFIGDIR=${PKGCONFIGDIR:S;${PREFIX}/;;}
|
|
||||||
|
|
||||||
OPTIONS_DEFINE= MANPAGES PYTHON3
|
|
||||||
OPTIONS_DEFAULT= PYTHON3
|
|
||||||
MANPAGES_DESC= Build and install manpages (requires textproc/docbook-xsl)
|
|
||||||
|
|
||||||
MANPAGES_BUILD_DEPENDS= ${LOCALBASE}/share/xsl/docbook/manpages/docbook.xsl:textproc/docbook-xsl \
|
|
||||||
xsltproc:textproc/libxslt
|
|
||||||
MANPAGES_CONFIGURE_ENV_OFF= XSLTPROC="true"
|
|
||||||
|
|
||||||
PYTHON3_USES= gettext-runtime python
|
|
||||||
PYTHON3_USES_OFF= python:build,test
|
|
||||||
PYTHON3_CONFIGURE_OFF= --disable-python
|
|
||||||
PYTHON3_PLIST_FILES= ${PKGCONFIGDIR}/pyldb-util${PYTHON_EXT_SUFFIX}.pc \
|
|
||||||
${PYTHON_SITELIBDIR}/_ldb_text.py \
|
|
||||||
${PYTHON_SITELIBDIR}/ldb${PYTHON_EXT_SUFFIX}.so \
|
|
||||||
include/pyldb.h \
|
|
||||||
lib/libpyldb-util${PYTHON_EXT_SUFFIX}.so \
|
|
||||||
lib/libpyldb-util${PYTHON_EXT_SUFFIX}.so.2
|
|
||||||
|
|
||||||
# No fancy color error messages
|
|
||||||
_CFLAGS_clang= -fno-color-diagnostics
|
|
||||||
|
|
||||||
_LDB_DEPENDS= talloc>=2.4.2:devel/talloc242 tevent>=0.16.0:devel/tevent016 \
|
|
||||||
tdb>=1.4.10:databases/tdb1410 lmdb>=0.9.23:databases/lmdb \
|
|
||||||
popt>=0:devel/popt
|
|
||||||
_LDB_BINS= bin/ldbedit bin/ldbmodify bin/ldbadd bin/ldbdel bin/ldbsearch \
|
|
||||||
bin/ldbrename
|
|
||||||
_LDB_LIBS= lib/libldb.so lib/libldb.so.2 lib/ldb/libldb-tdb-int.so \
|
|
||||||
lib/ldb/libldb-tdb-err-map.so lib/ldb/libldb-key-value.so \
|
|
||||||
lib/ldb/libldb-cmdline.so lib/shared-modules/ldb/skel.so \
|
|
||||||
lib/shared-modules/ldb/server_sort.so \
|
|
||||||
lib/shared-modules/ldb/sample.so \
|
|
||||||
lib/shared-modules/ldb/rdn_name.so \
|
|
||||||
lib/shared-modules/ldb/paged_searches.so \
|
|
||||||
lib/shared-modules/ldb/ldb.so lib/shared-modules/ldb/ldap.so \
|
|
||||||
lib/shared-modules/ldb/asq.so lib/shared-modules/ldb/tdb.so
|
|
||||||
_LDB_MAN1= share/man/man1/ldbadd.1.gz share/man/man1/ldbdel.1.gz \
|
|
||||||
share/man/man1/ldbedit.1.gz share/man/man1/ldbmodify.1.gz \
|
|
||||||
share/man/man1/ldbrename.1.gz share/man/man1/ldbsearch.1.gz
|
|
||||||
_LDB_MAN3= share/man/man3/ldb.3.gz
|
|
||||||
|
|
||||||
.include <bsd.port.options.mk>
|
|
||||||
|
|
||||||
.if defined(WITH_DEBUG)
|
|
||||||
CONFIGURE_ARGS+= --enable-debug \
|
|
||||||
--verbose
|
|
||||||
.endif
|
|
||||||
|
|
||||||
# Only for 64-bit architectures
|
|
||||||
.if ${ARCH} != armv6 && ${ARCH} != armv7 && ${ARCH} != i386 && ${ARCH} != mips && \
|
|
||||||
${ARCH} != powerpc && ${ARCH} != powerpcspe
|
|
||||||
_LDB_LIBS_64= lib/ldb/libldb-mdb-int.so lib/shared-modules/ldb/mdb.so
|
|
||||||
.endif
|
|
||||||
|
|
||||||
.if defined(NO_PYTHON)
|
|
||||||
WARNING+= "${PKGNAME} does not support NO_PYTHON anymore; use option PYTHON3 instead"
|
|
||||||
.endif
|
|
||||||
|
|
||||||
post-patch:
|
|
||||||
@${REINPLACE_CMD} -e 's|%%PKGCONFIGDIR%%|${PKGCONFIGDIR}|g' \
|
|
||||||
${BUILD_WRKSRC}/wscript
|
|
||||||
|
|
||||||
# Use threading (or multiprocessing) but not thread (renamed in python 3+).
|
|
||||||
pre-configure:
|
|
||||||
@if ! ${PYTHON_CMD} -c "import multiprocessing;" 2>/dev/null; then \
|
|
||||||
${ECHO_CMD}; \
|
|
||||||
${ECHO_MSG} "===> ${PKGNAME} "${IGNORE_NONTHREAD_PYTHON:Q}.; \
|
|
||||||
${ECHO_CMD}; \
|
|
||||||
${FALSE}; \
|
|
||||||
fi
|
|
||||||
|
|
||||||
pre-build-MANPAGES-off:
|
|
||||||
${MKDIR} ${BUILD_WRKSRC}/bin/default/man
|
|
||||||
.for man in ${_LDB_MAN1} ${_LDB_MAN3}
|
|
||||||
${INSTALL_MAN} ${FILESDIR}/man/`basename ${man} .gz` ${BUILD_WRKSRC}/bin/default/man
|
|
||||||
.endfor
|
|
||||||
|
|
||||||
post-install:
|
|
||||||
.for lib in ${_LDB_BINS} ${_LDB_LIBS} ${_LDB_LIBS_64}
|
|
||||||
${STRIP_CMD} ${STAGEDIR}${PREFIX}/${lib}
|
|
||||||
.endfor
|
|
||||||
|
|
||||||
post-install-PYTHON3-on:
|
|
||||||
${STRIP_CMD} ${STAGEDIR}${PREFIX}/lib/libpyldb-util${PYTHON_EXT_SUFFIX}.so
|
|
||||||
${STRIP_CMD} ${STAGEDIR}${PYTHONPREFIX_SITELIBDIR}/ldb${PYTHON_EXT_SUFFIX}.so
|
|
||||||
|
|
||||||
.include <bsd.port.mk>
|
|
||||||
@ -1,3 +0,0 @@
|
|||||||
TIMESTAMP = 1737642955
|
|
||||||
SHA256 (ldb-2.9.2.tar.gz) = d155884002c79dbb1c3d8642f8b1013f2e520b3aeefd6e96412adec5b8d6cbc0
|
|
||||||
SIZE (ldb-2.9.2.tar.gz) = 1752608
|
|
||||||
@ -1,427 +0,0 @@
|
|||||||
'\" t
|
|
||||||
.\" Title: ldb
|
|
||||||
.\" Author: [see the "Author" section]
|
|
||||||
.\" Generator: DocBook XSL Stylesheets v1.79.1 <http://docbook.sf.net/>
|
|
||||||
.\" Date: 09/23/2020
|
|
||||||
.\" Manual: System Administration tools
|
|
||||||
.\" Source: LDB 1.1
|
|
||||||
.\" Language: English
|
|
||||||
.\"
|
|
||||||
.TH "LDB" "3" "09/23/2020" "LDB 1\&.1" "System Administration tools"
|
|
||||||
.\" -----------------------------------------------------------------
|
|
||||||
.\" * Define some portability stuff
|
|
||||||
.\" -----------------------------------------------------------------
|
|
||||||
.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
|
||||||
.\" http://bugs.debian.org/507673
|
|
||||||
.\" http://lists.gnu.org/archive/html/groff/2009-02/msg00013.html
|
|
||||||
.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
|
||||||
.ie \n(.g .ds Aq \(aq
|
|
||||||
.el .ds Aq '
|
|
||||||
.\" -----------------------------------------------------------------
|
|
||||||
.\" * set default formatting
|
|
||||||
.\" -----------------------------------------------------------------
|
|
||||||
.\" disable hyphenation
|
|
||||||
.nh
|
|
||||||
.\" disable justification (adjust text to left margin only)
|
|
||||||
.ad l
|
|
||||||
.\" -----------------------------------------------------------------
|
|
||||||
.\" * MAIN CONTENT STARTS HERE *
|
|
||||||
.\" -----------------------------------------------------------------
|
|
||||||
.SH "NAME"
|
|
||||||
ldb \- A light\-weight database library
|
|
||||||
.SH "SYNOPSIS"
|
|
||||||
.sp
|
|
||||||
.nf
|
|
||||||
#include <ldb\&.h>
|
|
||||||
.fi
|
|
||||||
.SH "DESCRIPTION"
|
|
||||||
.PP
|
|
||||||
ldb is a light weight embedded database library and API\&. With a programming interface that is very similar to LDAP, ldb can store its data either in a tdb(3) database or in a real LDAP database\&.
|
|
||||||
.PP
|
|
||||||
When used with the tdb backend ldb does not require any database daemon\&. Instead, ldb function calls are processed immediately by the ldb library, which does IO directly on the database, while allowing multiple readers/writers using operating system byte range locks\&. This leads to an API with very low overheads, often resulting in speeds of more than 10x what can be achieved with a more traditional LDAP architecture\&.
|
|
||||||
.PP
|
|
||||||
In a taxonomy of databases ldb would sit half way between key/value pair databases (such as berkley db or tdb) and a full LDAP database\&. With a structured attribute oriented API like LDAP and good indexing capabilities, ldb can be used for quite sophisticated applications that need a light weight database, without the administrative overhead of a full LDAP installation\&.
|
|
||||||
.PP
|
|
||||||
Included with ldb are a number of useful command line tools for manipulating a ldb database\&. These tools are similar in style to the equivalent ldap command line tools\&.
|
|
||||||
.PP
|
|
||||||
In its default mode of operation with a tdb backend, ldb can also be seen as a "schema\-less LDAP"\&. By default ldb does not require a schema, which greatly reduces the complexity of getting started with ldb databases\&. As the complexity of you application grows you can take advantage of some of the optional schema\-like attributes that ldb offers, or you can migrate to using the full LDAP api while keeping your exiting ldb code\&.
|
|
||||||
.PP
|
|
||||||
If you are new to ldb, then I suggest starting with the manual pages for ldbsearch(1) and ldbedit(1), and experimenting with a local database\&. Then I suggest you look at the ldb_connect(3) and ldb_search(3) manual pages\&.
|
|
||||||
.SH "TOOLS"
|
|
||||||
.sp
|
|
||||||
.RS 4
|
|
||||||
.ie n \{\
|
|
||||||
\h'-04'\(bu\h'+03'\c
|
|
||||||
.\}
|
|
||||||
.el \{\
|
|
||||||
.sp -1
|
|
||||||
.IP \(bu 2.3
|
|
||||||
.\}
|
|
||||||
ldbsearch(1)
|
|
||||||
\- command line ldb search utility
|
|
||||||
.RE
|
|
||||||
.sp
|
|
||||||
.RS 4
|
|
||||||
.ie n \{\
|
|
||||||
\h'-04'\(bu\h'+03'\c
|
|
||||||
.\}
|
|
||||||
.el \{\
|
|
||||||
.sp -1
|
|
||||||
.IP \(bu 2.3
|
|
||||||
.\}
|
|
||||||
ldbedit(1)
|
|
||||||
\- edit all or part of a ldb database using your favourite editor
|
|
||||||
.RE
|
|
||||||
.sp
|
|
||||||
.RS 4
|
|
||||||
.ie n \{\
|
|
||||||
\h'-04'\(bu\h'+03'\c
|
|
||||||
.\}
|
|
||||||
.el \{\
|
|
||||||
.sp -1
|
|
||||||
.IP \(bu 2.3
|
|
||||||
.\}
|
|
||||||
ldbadd(1)
|
|
||||||
\- add records to a ldb database using LDIF formatted input
|
|
||||||
.RE
|
|
||||||
.sp
|
|
||||||
.RS 4
|
|
||||||
.ie n \{\
|
|
||||||
\h'-04'\(bu\h'+03'\c
|
|
||||||
.\}
|
|
||||||
.el \{\
|
|
||||||
.sp -1
|
|
||||||
.IP \(bu 2.3
|
|
||||||
.\}
|
|
||||||
ldbdel(1)
|
|
||||||
\- delete records from a ldb database
|
|
||||||
.RE
|
|
||||||
.sp
|
|
||||||
.RS 4
|
|
||||||
.ie n \{\
|
|
||||||
\h'-04'\(bu\h'+03'\c
|
|
||||||
.\}
|
|
||||||
.el \{\
|
|
||||||
.sp -1
|
|
||||||
.IP \(bu 2.3
|
|
||||||
.\}
|
|
||||||
ldbmodify(1)
|
|
||||||
\- modify records in a ldb database using LDIF formatted input
|
|
||||||
.RE
|
|
||||||
.SH "FUNCTIONS"
|
|
||||||
.sp
|
|
||||||
.RS 4
|
|
||||||
.ie n \{\
|
|
||||||
\h'-04'\(bu\h'+03'\c
|
|
||||||
.\}
|
|
||||||
.el \{\
|
|
||||||
.sp -1
|
|
||||||
.IP \(bu 2.3
|
|
||||||
.\}
|
|
||||||
\fBldb_connect(3)\fR
|
|
||||||
\- connect to a ldb backend
|
|
||||||
.RE
|
|
||||||
.sp
|
|
||||||
.RS 4
|
|
||||||
.ie n \{\
|
|
||||||
\h'-04'\(bu\h'+03'\c
|
|
||||||
.\}
|
|
||||||
.el \{\
|
|
||||||
.sp -1
|
|
||||||
.IP \(bu 2.3
|
|
||||||
.\}
|
|
||||||
\fBldb_search(3)\fR
|
|
||||||
\- perform a database search
|
|
||||||
.RE
|
|
||||||
.sp
|
|
||||||
.RS 4
|
|
||||||
.ie n \{\
|
|
||||||
\h'-04'\(bu\h'+03'\c
|
|
||||||
.\}
|
|
||||||
.el \{\
|
|
||||||
.sp -1
|
|
||||||
.IP \(bu 2.3
|
|
||||||
.\}
|
|
||||||
\fBldb_add(3)\fR
|
|
||||||
\- add a record to the database
|
|
||||||
.RE
|
|
||||||
.sp
|
|
||||||
.RS 4
|
|
||||||
.ie n \{\
|
|
||||||
\h'-04'\(bu\h'+03'\c
|
|
||||||
.\}
|
|
||||||
.el \{\
|
|
||||||
.sp -1
|
|
||||||
.IP \(bu 2.3
|
|
||||||
.\}
|
|
||||||
\fBldb_delete(3)\fR
|
|
||||||
\- delete a record from the database
|
|
||||||
.RE
|
|
||||||
.sp
|
|
||||||
.RS 4
|
|
||||||
.ie n \{\
|
|
||||||
\h'-04'\(bu\h'+03'\c
|
|
||||||
.\}
|
|
||||||
.el \{\
|
|
||||||
.sp -1
|
|
||||||
.IP \(bu 2.3
|
|
||||||
.\}
|
|
||||||
\fBldb_modify(3)\fR
|
|
||||||
\- modify a record in the database
|
|
||||||
.RE
|
|
||||||
.sp
|
|
||||||
.RS 4
|
|
||||||
.ie n \{\
|
|
||||||
\h'-04'\(bu\h'+03'\c
|
|
||||||
.\}
|
|
||||||
.el \{\
|
|
||||||
.sp -1
|
|
||||||
.IP \(bu 2.3
|
|
||||||
.\}
|
|
||||||
\fBldb_errstring(3)\fR
|
|
||||||
\- retrieve extended error information from the last operation
|
|
||||||
.RE
|
|
||||||
.sp
|
|
||||||
.RS 4
|
|
||||||
.ie n \{\
|
|
||||||
\h'-04'\(bu\h'+03'\c
|
|
||||||
.\}
|
|
||||||
.el \{\
|
|
||||||
.sp -1
|
|
||||||
.IP \(bu 2.3
|
|
||||||
.\}
|
|
||||||
\fBldb_ldif_write(3)\fR
|
|
||||||
\- write a LDIF formatted message
|
|
||||||
.RE
|
|
||||||
.sp
|
|
||||||
.RS 4
|
|
||||||
.ie n \{\
|
|
||||||
\h'-04'\(bu\h'+03'\c
|
|
||||||
.\}
|
|
||||||
.el \{\
|
|
||||||
.sp -1
|
|
||||||
.IP \(bu 2.3
|
|
||||||
.\}
|
|
||||||
\fBldb_ldif_write_file(3)\fR
|
|
||||||
\- write a LDIF formatted message to a file
|
|
||||||
.RE
|
|
||||||
.sp
|
|
||||||
.RS 4
|
|
||||||
.ie n \{\
|
|
||||||
\h'-04'\(bu\h'+03'\c
|
|
||||||
.\}
|
|
||||||
.el \{\
|
|
||||||
.sp -1
|
|
||||||
.IP \(bu 2.3
|
|
||||||
.\}
|
|
||||||
\fBldb_ldif_read(3)\fR
|
|
||||||
\- read a LDIF formatted message
|
|
||||||
.RE
|
|
||||||
.sp
|
|
||||||
.RS 4
|
|
||||||
.ie n \{\
|
|
||||||
\h'-04'\(bu\h'+03'\c
|
|
||||||
.\}
|
|
||||||
.el \{\
|
|
||||||
.sp -1
|
|
||||||
.IP \(bu 2.3
|
|
||||||
.\}
|
|
||||||
\fBldb_ldif_read_free(3)\fR
|
|
||||||
\- free the result of a ldb_ldif_read()
|
|
||||||
.RE
|
|
||||||
.sp
|
|
||||||
.RS 4
|
|
||||||
.ie n \{\
|
|
||||||
\h'-04'\(bu\h'+03'\c
|
|
||||||
.\}
|
|
||||||
.el \{\
|
|
||||||
.sp -1
|
|
||||||
.IP \(bu 2.3
|
|
||||||
.\}
|
|
||||||
\fBldb_ldif_read_file(3)\fR
|
|
||||||
\- read a LDIF message from a file
|
|
||||||
.RE
|
|
||||||
.sp
|
|
||||||
.RS 4
|
|
||||||
.ie n \{\
|
|
||||||
\h'-04'\(bu\h'+03'\c
|
|
||||||
.\}
|
|
||||||
.el \{\
|
|
||||||
.sp -1
|
|
||||||
.IP \(bu 2.3
|
|
||||||
.\}
|
|
||||||
\fBldb_ldif_read_string(3)\fR
|
|
||||||
\- read a LDIF message from a string
|
|
||||||
.RE
|
|
||||||
.sp
|
|
||||||
.RS 4
|
|
||||||
.ie n \{\
|
|
||||||
\h'-04'\(bu\h'+03'\c
|
|
||||||
.\}
|
|
||||||
.el \{\
|
|
||||||
.sp -1
|
|
||||||
.IP \(bu 2.3
|
|
||||||
.\}
|
|
||||||
\fBldb_msg_find_element(3)\fR
|
|
||||||
\- find an element in a ldb_message
|
|
||||||
.RE
|
|
||||||
.sp
|
|
||||||
.RS 4
|
|
||||||
.ie n \{\
|
|
||||||
\h'-04'\(bu\h'+03'\c
|
|
||||||
.\}
|
|
||||||
.el \{\
|
|
||||||
.sp -1
|
|
||||||
.IP \(bu 2.3
|
|
||||||
.\}
|
|
||||||
\fBldb_val_equal_exact(3)\fR
|
|
||||||
\- compare two ldb_val structures
|
|
||||||
.RE
|
|
||||||
.sp
|
|
||||||
.RS 4
|
|
||||||
.ie n \{\
|
|
||||||
\h'-04'\(bu\h'+03'\c
|
|
||||||
.\}
|
|
||||||
.el \{\
|
|
||||||
.sp -1
|
|
||||||
.IP \(bu 2.3
|
|
||||||
.\}
|
|
||||||
\fBldb_msg_find_val(3)\fR
|
|
||||||
\- find an element by value
|
|
||||||
.RE
|
|
||||||
.sp
|
|
||||||
.RS 4
|
|
||||||
.ie n \{\
|
|
||||||
\h'-04'\(bu\h'+03'\c
|
|
||||||
.\}
|
|
||||||
.el \{\
|
|
||||||
.sp -1
|
|
||||||
.IP \(bu 2.3
|
|
||||||
.\}
|
|
||||||
\fBldb_msg_add_empty(3)\fR
|
|
||||||
\- add an empty message element to a ldb_message
|
|
||||||
.RE
|
|
||||||
.sp
|
|
||||||
.RS 4
|
|
||||||
.ie n \{\
|
|
||||||
\h'-04'\(bu\h'+03'\c
|
|
||||||
.\}
|
|
||||||
.el \{\
|
|
||||||
.sp -1
|
|
||||||
.IP \(bu 2.3
|
|
||||||
.\}
|
|
||||||
\fBldb_msg_add(3)\fR
|
|
||||||
\- add a non\-empty message element to a ldb_message
|
|
||||||
.RE
|
|
||||||
.sp
|
|
||||||
.RS 4
|
|
||||||
.ie n \{\
|
|
||||||
\h'-04'\(bu\h'+03'\c
|
|
||||||
.\}
|
|
||||||
.el \{\
|
|
||||||
.sp -1
|
|
||||||
.IP \(bu 2.3
|
|
||||||
.\}
|
|
||||||
\fBldb_msg_element_compare(3)\fR
|
|
||||||
\- compare two ldb_message_element structures
|
|
||||||
.RE
|
|
||||||
.sp
|
|
||||||
.RS 4
|
|
||||||
.ie n \{\
|
|
||||||
\h'-04'\(bu\h'+03'\c
|
|
||||||
.\}
|
|
||||||
.el \{\
|
|
||||||
.sp -1
|
|
||||||
.IP \(bu 2.3
|
|
||||||
.\}
|
|
||||||
\fBldb_msg_find_int(3)\fR
|
|
||||||
\- return an integer value from a ldb_message
|
|
||||||
.RE
|
|
||||||
.sp
|
|
||||||
.RS 4
|
|
||||||
.ie n \{\
|
|
||||||
\h'-04'\(bu\h'+03'\c
|
|
||||||
.\}
|
|
||||||
.el \{\
|
|
||||||
.sp -1
|
|
||||||
.IP \(bu 2.3
|
|
||||||
.\}
|
|
||||||
\fBldb_msg_find_uint(3)\fR
|
|
||||||
\- return an unsigned integer value from a ldb_message
|
|
||||||
.RE
|
|
||||||
.sp
|
|
||||||
.RS 4
|
|
||||||
.ie n \{\
|
|
||||||
\h'-04'\(bu\h'+03'\c
|
|
||||||
.\}
|
|
||||||
.el \{\
|
|
||||||
.sp -1
|
|
||||||
.IP \(bu 2.3
|
|
||||||
.\}
|
|
||||||
\fBldb_msg_find_double(3)\fR
|
|
||||||
\- return a double value from a ldb_message
|
|
||||||
.RE
|
|
||||||
.sp
|
|
||||||
.RS 4
|
|
||||||
.ie n \{\
|
|
||||||
\h'-04'\(bu\h'+03'\c
|
|
||||||
.\}
|
|
||||||
.el \{\
|
|
||||||
.sp -1
|
|
||||||
.IP \(bu 2.3
|
|
||||||
.\}
|
|
||||||
\fBldb_msg_find_string(3)\fR
|
|
||||||
\- return a string value from a ldb_message
|
|
||||||
.RE
|
|
||||||
.sp
|
|
||||||
.RS 4
|
|
||||||
.ie n \{\
|
|
||||||
\h'-04'\(bu\h'+03'\c
|
|
||||||
.\}
|
|
||||||
.el \{\
|
|
||||||
.sp -1
|
|
||||||
.IP \(bu 2.3
|
|
||||||
.\}
|
|
||||||
\fBldb_set_alloc(3)\fR
|
|
||||||
\- set the memory allocation function to be used by ldb
|
|
||||||
.RE
|
|
||||||
.sp
|
|
||||||
.RS 4
|
|
||||||
.ie n \{\
|
|
||||||
\h'-04'\(bu\h'+03'\c
|
|
||||||
.\}
|
|
||||||
.el \{\
|
|
||||||
.sp -1
|
|
||||||
.IP \(bu 2.3
|
|
||||||
.\}
|
|
||||||
\fBldb_set_debug(3)\fR
|
|
||||||
\- set a debug handler to be used by ldb
|
|
||||||
.RE
|
|
||||||
.sp
|
|
||||||
.RS 4
|
|
||||||
.ie n \{\
|
|
||||||
\h'-04'\(bu\h'+03'\c
|
|
||||||
.\}
|
|
||||||
.el \{\
|
|
||||||
.sp -1
|
|
||||||
.IP \(bu 2.3
|
|
||||||
.\}
|
|
||||||
\fBldb_set_debug_stderr(3)\fR
|
|
||||||
\- set a debug handler for stderr output
|
|
||||||
.RE
|
|
||||||
.SH "AUTHOR"
|
|
||||||
.PP
|
|
||||||
ldb was written by
|
|
||||||
\m[blue]\fBAndrew Tridgell\fR\m[]\&\s-2\u[1]\d\s+2\&.
|
|
||||||
.PP
|
|
||||||
If you wish to report a problem or make a suggestion then please see the
|
|
||||||
\m[blue]\fB\%http://ldb.samba.org/\fR\m[]
|
|
||||||
web site for current contact and maintainer information\&.
|
|
||||||
.PP
|
|
||||||
ldb is released under the GNU Lesser General Public License version 2 or later\&. Please see the file COPYING for license details\&.
|
|
||||||
.SH "NOTES"
|
|
||||||
.IP " 1." 4
|
|
||||||
Andrew Tridgell
|
|
||||||
.RS 4
|
|
||||||
\%https://www.samba.org/~tridge/
|
|
||||||
.RE
|
|
||||||
@ -1,78 +0,0 @@
|
|||||||
'\" t
|
|
||||||
.\" Title: ldbadd
|
|
||||||
.\" Author: [see the "AUTHOR" section]
|
|
||||||
.\" Generator: DocBook XSL Stylesheets v1.79.1 <http://docbook.sf.net/>
|
|
||||||
.\" Date: 09/23/2020
|
|
||||||
.\" Manual: System Administration tools
|
|
||||||
.\" Source: LDB 1.1
|
|
||||||
.\" Language: English
|
|
||||||
.\"
|
|
||||||
.TH "LDBADD" "1" "09/23/2020" "LDB 1\&.1" "System Administration tools"
|
|
||||||
.\" -----------------------------------------------------------------
|
|
||||||
.\" * Define some portability stuff
|
|
||||||
.\" -----------------------------------------------------------------
|
|
||||||
.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
|
||||||
.\" http://bugs.debian.org/507673
|
|
||||||
.\" http://lists.gnu.org/archive/html/groff/2009-02/msg00013.html
|
|
||||||
.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
|
||||||
.ie \n(.g .ds Aq \(aq
|
|
||||||
.el .ds Aq '
|
|
||||||
.\" -----------------------------------------------------------------
|
|
||||||
.\" * set default formatting
|
|
||||||
.\" -----------------------------------------------------------------
|
|
||||||
.\" disable hyphenation
|
|
||||||
.nh
|
|
||||||
.\" disable justification (adjust text to left margin only)
|
|
||||||
.ad l
|
|
||||||
.\" -----------------------------------------------------------------
|
|
||||||
.\" * MAIN CONTENT STARTS HERE *
|
|
||||||
.\" -----------------------------------------------------------------
|
|
||||||
.SH "NAME"
|
|
||||||
ldbadd \- Command\-line utility for adding records to an LDB
|
|
||||||
.SH "SYNOPSIS"
|
|
||||||
.HP \w'\fBldbadd\fR\ 'u
|
|
||||||
\fBldbadd\fR [\-h] [\-H\ LDB\-URL] [ldif\-file1] [ldif\-file2] [\&.\&.\&.]
|
|
||||||
.SH "DESCRIPTION"
|
|
||||||
.PP
|
|
||||||
ldbadd adds records to an ldb(3) database\&. It reads the ldif(5) files specified on the command line and adds the records from these files to the LDB database, which is specified by the \-H option or the LDB_URL environment variable\&.
|
|
||||||
.PP
|
|
||||||
If \- is specified as a ldb file, the ldif input is read from standard input\&.
|
|
||||||
.SH "OPTIONS"
|
|
||||||
.PP
|
|
||||||
\-h
|
|
||||||
.RS 4
|
|
||||||
Show list of available options\&.
|
|
||||||
.RE
|
|
||||||
.PP
|
|
||||||
\-H <ldb\-url>
|
|
||||||
.RS 4
|
|
||||||
LDB URL to connect to\&. See ldb(3) for details\&.
|
|
||||||
.RE
|
|
||||||
.SH "ENVIRONMENT"
|
|
||||||
.PP
|
|
||||||
LDB_URL
|
|
||||||
.RS 4
|
|
||||||
LDB URL to connect to (can be overridden by using the \-H command\-line option\&.)
|
|
||||||
.RE
|
|
||||||
.SH "VERSION"
|
|
||||||
.PP
|
|
||||||
This man page is correct for version 1\&.1 of LDB\&.
|
|
||||||
.SH "SEE ALSO"
|
|
||||||
.PP
|
|
||||||
ldb(3), ldbmodify, ldbdel, ldif(5)
|
|
||||||
.SH "AUTHOR"
|
|
||||||
.PP
|
|
||||||
ldb was written by
|
|
||||||
\m[blue]\fBAndrew Tridgell\fR\m[]\&\s-2\u[1]\d\s+2\&.
|
|
||||||
.PP
|
|
||||||
If you wish to report a problem or make a suggestion then please see the
|
|
||||||
\m[blue]\fB\%http://ldb.samba.org/\fR\m[]
|
|
||||||
web site for current contact and maintainer information\&.
|
|
||||||
.PP
|
|
||||||
This manpage was written by Jelmer Vernooij\&.
|
|
||||||
.SH "NOTES"
|
|
||||||
.IP " 1." 4
|
|
||||||
Andrew Tridgell
|
|
||||||
.RS 4
|
|
||||||
\%https://www.samba.org/~tridge/
|
|
||||||
.RE
|
|
||||||
@ -1,80 +0,0 @@
|
|||||||
'\" t
|
|
||||||
.\" Title: ldbdel
|
|
||||||
.\" Author: [see the "AUTHOR" section]
|
|
||||||
.\" Generator: DocBook XSL Stylesheets v1.79.1 <http://docbook.sf.net/>
|
|
||||||
.\" Date: 09/23/2020
|
|
||||||
.\" Manual: System Administration tools
|
|
||||||
.\" Source: LDB 1.1
|
|
||||||
.\" Language: English
|
|
||||||
.\"
|
|
||||||
.TH "LDBDEL" "1" "09/23/2020" "LDB 1\&.1" "System Administration tools"
|
|
||||||
.\" -----------------------------------------------------------------
|
|
||||||
.\" * Define some portability stuff
|
|
||||||
.\" -----------------------------------------------------------------
|
|
||||||
.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
|
||||||
.\" http://bugs.debian.org/507673
|
|
||||||
.\" http://lists.gnu.org/archive/html/groff/2009-02/msg00013.html
|
|
||||||
.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
|
||||||
.ie \n(.g .ds Aq \(aq
|
|
||||||
.el .ds Aq '
|
|
||||||
.\" -----------------------------------------------------------------
|
|
||||||
.\" * set default formatting
|
|
||||||
.\" -----------------------------------------------------------------
|
|
||||||
.\" disable hyphenation
|
|
||||||
.nh
|
|
||||||
.\" disable justification (adjust text to left margin only)
|
|
||||||
.ad l
|
|
||||||
.\" -----------------------------------------------------------------
|
|
||||||
.\" * MAIN CONTENT STARTS HERE *
|
|
||||||
.\" -----------------------------------------------------------------
|
|
||||||
.SH "NAME"
|
|
||||||
ldbdel \- Command\-line program for deleting LDB records
|
|
||||||
.SH "SYNOPSIS"
|
|
||||||
.HP \w'\fBldbdel\fR\ 'u
|
|
||||||
\fBldbdel\fR [\-h] [\-H\ LDB\-URL] [dn] [\&.\&.\&.]
|
|
||||||
.SH "DESCRIPTION"
|
|
||||||
.PP
|
|
||||||
ldbdel deletes records from an ldb(3) database\&. It deletes the records identified by the dn\*(Aqs specified on the command\-line\&.
|
|
||||||
.PP
|
|
||||||
ldbdel uses either the database that is specified with the \-H option or the database specified by the LDB_URL environment variable\&.
|
|
||||||
.SH "OPTIONS"
|
|
||||||
.PP
|
|
||||||
\-h
|
|
||||||
.RS 4
|
|
||||||
Show list of available options\&.
|
|
||||||
.RE
|
|
||||||
.PP
|
|
||||||
\-H <ldb\-url>
|
|
||||||
.RS 4
|
|
||||||
LDB URL to connect to\&. See ldb(3) for details\&.
|
|
||||||
.RE
|
|
||||||
.SH "ENVIRONMENT"
|
|
||||||
.PP
|
|
||||||
LDB_URL
|
|
||||||
.RS 4
|
|
||||||
LDB URL to connect to (can be overridden by using the \-H command\-line option\&.)
|
|
||||||
.RE
|
|
||||||
.SH "VERSION"
|
|
||||||
.PP
|
|
||||||
This man page is correct for version 1\&.1 of LDB\&.
|
|
||||||
.SH "SEE ALSO"
|
|
||||||
.PP
|
|
||||||
ldb(3), ldbmodify, ldbadd, ldif(5)
|
|
||||||
.SH "AUTHOR"
|
|
||||||
.PP
|
|
||||||
ldb was written by
|
|
||||||
\m[blue]\fBAndrew Tridgell\fR\m[]\&\s-2\u[1]\d\s+2\&.
|
|
||||||
.PP
|
|
||||||
If you wish to report a problem or make a suggestion then please see the
|
|
||||||
\m[blue]\fB\%http://ldb.samba.org/\fR\m[]
|
|
||||||
web site for current contact and maintainer information\&.
|
|
||||||
.PP
|
|
||||||
ldbdel was written by Andrew Tridgell\&.
|
|
||||||
.PP
|
|
||||||
This manpage was written by Jelmer Vernooij\&.
|
|
||||||
.SH "NOTES"
|
|
||||||
.IP " 1." 4
|
|
||||||
Andrew Tridgell
|
|
||||||
.RS 4
|
|
||||||
\%https://www.samba.org/~tridge/
|
|
||||||
.RE
|
|
||||||
@ -1,111 +0,0 @@
|
|||||||
'\" t
|
|
||||||
.\" Title: ldbedit
|
|
||||||
.\" Author: [see the "AUTHOR" section]
|
|
||||||
.\" Generator: DocBook XSL Stylesheets v1.79.1 <http://docbook.sf.net/>
|
|
||||||
.\" Date: 09/23/2020
|
|
||||||
.\" Manual: System Administration tools
|
|
||||||
.\" Source: LDB 1.1
|
|
||||||
.\" Language: English
|
|
||||||
.\"
|
|
||||||
.TH "LDBEDIT" "1" "09/23/2020" "LDB 1\&.1" "System Administration tools"
|
|
||||||
.\" -----------------------------------------------------------------
|
|
||||||
.\" * Define some portability stuff
|
|
||||||
.\" -----------------------------------------------------------------
|
|
||||||
.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
|
||||||
.\" http://bugs.debian.org/507673
|
|
||||||
.\" http://lists.gnu.org/archive/html/groff/2009-02/msg00013.html
|
|
||||||
.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
|
||||||
.ie \n(.g .ds Aq \(aq
|
|
||||||
.el .ds Aq '
|
|
||||||
.\" -----------------------------------------------------------------
|
|
||||||
.\" * set default formatting
|
|
||||||
.\" -----------------------------------------------------------------
|
|
||||||
.\" disable hyphenation
|
|
||||||
.nh
|
|
||||||
.\" disable justification (adjust text to left margin only)
|
|
||||||
.ad l
|
|
||||||
.\" -----------------------------------------------------------------
|
|
||||||
.\" * MAIN CONTENT STARTS HERE *
|
|
||||||
.\" -----------------------------------------------------------------
|
|
||||||
.SH "NAME"
|
|
||||||
ldbedit \- Edit LDB databases using your preferred editor
|
|
||||||
.SH "SYNOPSIS"
|
|
||||||
.HP \w'\fBldbedit\fR\ 'u
|
|
||||||
\fBldbedit\fR [\-?] [\-\-usage] [\-s\ base|one|sub] [\-b\ basedn] [\-a] [\-e\ editor] [\-H\ LDB\-URL] [expression] [attributes...]
|
|
||||||
.SH "DESCRIPTION"
|
|
||||||
.PP
|
|
||||||
ldbedit is a utility that allows you to edit LDB entries (in tdb files, sqlite files or LDAP servers) using your preferred editor\&. ldbedit generates an LDIF file based on your query, allows you to edit the LDIF, and then merges that LDIF back into the LDB backend\&.
|
|
||||||
.SH "OPTIONS"
|
|
||||||
.PP
|
|
||||||
\-?, \-\-help
|
|
||||||
.RS 4
|
|
||||||
Show list of available options, and a phrase describing what that option does\&.
|
|
||||||
.RE
|
|
||||||
.PP
|
|
||||||
\-\-usage
|
|
||||||
.RS 4
|
|
||||||
Show list of available options\&. This is similar to the help option, however it does not provide any description, and is hence shorter\&.
|
|
||||||
.RE
|
|
||||||
.PP
|
|
||||||
\-H <ldb\-url>
|
|
||||||
.RS 4
|
|
||||||
LDB URL to connect to\&. For a tdb database, this will be of the form tdb://\fIfilename\fR\&. For a LDAP connection over unix domain sockets, this will be of the form ldapi://\fIsocket\fR\&. For a (potentially remote) LDAP connection over TCP, this will be of the form ldap://\fIhostname\fR\&. For an SQLite database, this will be of the form sqlite://\fIfilename\fR\&.
|
|
||||||
.RE
|
|
||||||
.PP
|
|
||||||
\-s one|sub|base
|
|
||||||
.RS 4
|
|
||||||
Search scope to use\&. One\-level, subtree or base\&.
|
|
||||||
.RE
|
|
||||||
.PP
|
|
||||||
\-a, \-all
|
|
||||||
.RS 4
|
|
||||||
Edit all records\&. This allows you to apply the same change to a number of records at once\&. You probably want to combine this with an expression of the form "objectclass=*"\&.
|
|
||||||
.RE
|
|
||||||
.PP
|
|
||||||
\-e editor, \-\-editor editor
|
|
||||||
.RS 4
|
|
||||||
Specify the editor that should be used (overrides the VISUAL and EDITOR environment variables)\&. If this option is not used, and neither VISUAL nor EDITOR environment variables are set, then the vi editor will be used\&.
|
|
||||||
.RE
|
|
||||||
.PP
|
|
||||||
\-b basedn
|
|
||||||
.RS 4
|
|
||||||
Specify Base Distinguished Name to use\&.
|
|
||||||
.RE
|
|
||||||
.PP
|
|
||||||
\-v, \-\-verbose
|
|
||||||
.RS 4
|
|
||||||
Make ldbedit more verbose about the operations that are being performed\&. Without this option, ldbedit will only provide a summary change line\&.
|
|
||||||
.RE
|
|
||||||
.SH "ENVIRONMENT"
|
|
||||||
.PP
|
|
||||||
LDB_URL
|
|
||||||
.RS 4
|
|
||||||
LDB URL to connect to\&. This can be overridden by using the \-H command\-line option\&.)
|
|
||||||
.RE
|
|
||||||
.PP
|
|
||||||
VISUAL and EDITOR
|
|
||||||
.RS 4
|
|
||||||
Environment variables used to determine what editor to use\&. VISUAL takes precedence over EDITOR, and both are overridden by the \-e command\-line option\&.
|
|
||||||
.RE
|
|
||||||
.SH "VERSION"
|
|
||||||
.PP
|
|
||||||
This man page is correct for version 1\&.1 of LDB\&.
|
|
||||||
.SH "SEE ALSO"
|
|
||||||
.PP
|
|
||||||
ldb(3), ldbmodify(1), ldbdel(1), ldif(5), vi(1)
|
|
||||||
.SH "AUTHOR"
|
|
||||||
.PP
|
|
||||||
ldb was written by
|
|
||||||
\m[blue]\fBAndrew Tridgell\fR\m[]\&\s-2\u[1]\d\s+2\&.
|
|
||||||
.PP
|
|
||||||
If you wish to report a problem or make a suggestion then please see the
|
|
||||||
\m[blue]\fB\%http://ldb.samba.org/\fR\m[]
|
|
||||||
web site for current contact and maintainer information\&.
|
|
||||||
.PP
|
|
||||||
This manpage was written by Jelmer Vernooij and updated by Brad Hards\&.
|
|
||||||
.SH "NOTES"
|
|
||||||
.IP " 1." 4
|
|
||||||
Andrew Tridgell
|
|
||||||
.RS 4
|
|
||||||
\%https://www.samba.org/~tridge/
|
|
||||||
.RE
|
|
||||||
@ -1,73 +0,0 @@
|
|||||||
'\" t
|
|
||||||
.\" Title: ldbmodify
|
|
||||||
.\" Author: [see the "AUTHOR" section]
|
|
||||||
.\" Generator: DocBook XSL Stylesheets v1.79.1 <http://docbook.sf.net/>
|
|
||||||
.\" Date: 09/23/2020
|
|
||||||
.\" Manual: System Administration tools
|
|
||||||
.\" Source: LDB 1.1
|
|
||||||
.\" Language: English
|
|
||||||
.\"
|
|
||||||
.TH "LDBMODIFY" "1" "09/23/2020" "LDB 1\&.1" "System Administration tools"
|
|
||||||
.\" -----------------------------------------------------------------
|
|
||||||
.\" * Define some portability stuff
|
|
||||||
.\" -----------------------------------------------------------------
|
|
||||||
.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
|
||||||
.\" http://bugs.debian.org/507673
|
|
||||||
.\" http://lists.gnu.org/archive/html/groff/2009-02/msg00013.html
|
|
||||||
.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
|
||||||
.ie \n(.g .ds Aq \(aq
|
|
||||||
.el .ds Aq '
|
|
||||||
.\" -----------------------------------------------------------------
|
|
||||||
.\" * set default formatting
|
|
||||||
.\" -----------------------------------------------------------------
|
|
||||||
.\" disable hyphenation
|
|
||||||
.nh
|
|
||||||
.\" disable justification (adjust text to left margin only)
|
|
||||||
.ad l
|
|
||||||
.\" -----------------------------------------------------------------
|
|
||||||
.\" * MAIN CONTENT STARTS HERE *
|
|
||||||
.\" -----------------------------------------------------------------
|
|
||||||
.SH "NAME"
|
|
||||||
ldbmodify \- Modify records in a LDB database
|
|
||||||
.SH "SYNOPSIS"
|
|
||||||
.HP \w'\fBldbmodify\fR\ 'u
|
|
||||||
\fBldbmodify\fR [\-H\ LDB\-URL] [ldif\-file]
|
|
||||||
.SH "DESCRIPTION"
|
|
||||||
.PP
|
|
||||||
ldbmodify changes, adds and deletes records in a LDB database\&. The changes that should be made to the LDB database are read from the specified LDIF\-file\&. If \- is specified as the filename, input is read from stdin\&.
|
|
||||||
.PP
|
|
||||||
For now, see ldapmodify(1) for details on the LDIF file format\&.
|
|
||||||
.SH "OPTIONS"
|
|
||||||
.PP
|
|
||||||
\-H <ldb\-url>
|
|
||||||
.RS 4
|
|
||||||
LDB URL to connect to\&. See ldb(3) for details\&.
|
|
||||||
.RE
|
|
||||||
.SH "ENVIRONMENT"
|
|
||||||
.PP
|
|
||||||
LDB_URL
|
|
||||||
.RS 4
|
|
||||||
LDB URL to connect to (can be overridden by using the \-H command\-line option\&.)
|
|
||||||
.RE
|
|
||||||
.SH "VERSION"
|
|
||||||
.PP
|
|
||||||
This man page is correct for version 1\&.1 of LDB\&.
|
|
||||||
.SH "SEE ALSO"
|
|
||||||
.PP
|
|
||||||
ldb(3), ldbedit
|
|
||||||
.SH "AUTHOR"
|
|
||||||
.PP
|
|
||||||
ldb was written by
|
|
||||||
\m[blue]\fBAndrew Tridgell\fR\m[]\&\s-2\u[1]\d\s+2\&.
|
|
||||||
.PP
|
|
||||||
If you wish to report a problem or make a suggestion then please see the
|
|
||||||
\m[blue]\fB\%http://ldb.samba.org/\fR\m[]
|
|
||||||
web site for current contact and maintainer information\&.
|
|
||||||
.PP
|
|
||||||
This manpage was written by Jelmer Vernooij\&.
|
|
||||||
.SH "NOTES"
|
|
||||||
.IP " 1." 4
|
|
||||||
Andrew Tridgell
|
|
||||||
.RS 4
|
|
||||||
\%https://www.samba.org/~tridge/
|
|
||||||
.RE
|
|
||||||
@ -1,81 +0,0 @@
|
|||||||
'\" t
|
|
||||||
.\" Title: ldbrename
|
|
||||||
.\" Author: [see the "AUTHOR" section]
|
|
||||||
.\" Generator: DocBook XSL Stylesheets v1.79.1 <http://docbook.sf.net/>
|
|
||||||
.\" Date: 09/23/2020
|
|
||||||
.\" Manual: System Administration tools
|
|
||||||
.\" Source: LDB 1.1
|
|
||||||
.\" Language: English
|
|
||||||
.\"
|
|
||||||
.TH "LDBRENAME" "1" "09/23/2020" "LDB 1\&.1" "System Administration tools"
|
|
||||||
.\" -----------------------------------------------------------------
|
|
||||||
.\" * Define some portability stuff
|
|
||||||
.\" -----------------------------------------------------------------
|
|
||||||
.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
|
||||||
.\" http://bugs.debian.org/507673
|
|
||||||
.\" http://lists.gnu.org/archive/html/groff/2009-02/msg00013.html
|
|
||||||
.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
|
||||||
.ie \n(.g .ds Aq \(aq
|
|
||||||
.el .ds Aq '
|
|
||||||
.\" -----------------------------------------------------------------
|
|
||||||
.\" * set default formatting
|
|
||||||
.\" -----------------------------------------------------------------
|
|
||||||
.\" disable hyphenation
|
|
||||||
.nh
|
|
||||||
.\" disable justification (adjust text to left margin only)
|
|
||||||
.ad l
|
|
||||||
.\" -----------------------------------------------------------------
|
|
||||||
.\" * MAIN CONTENT STARTS HERE *
|
|
||||||
.\" -----------------------------------------------------------------
|
|
||||||
.SH "NAME"
|
|
||||||
ldbrename \- Edit LDB databases using your favorite editor
|
|
||||||
.SH "SYNOPSIS"
|
|
||||||
.HP \w'\fBldbrename\fR\ 'u
|
|
||||||
\fBldbrename\fR [\-h] [\-o\ options] {olddn} {newdn}
|
|
||||||
.SH "DESCRIPTION"
|
|
||||||
.PP
|
|
||||||
ldbrename is a utility that allows you to rename trees in an LDB database based by DN\&. This utility takes two arguments: the original DN name of the top element and the DN to change it to\&.
|
|
||||||
.SH "OPTIONS"
|
|
||||||
.PP
|
|
||||||
\-h
|
|
||||||
.RS 4
|
|
||||||
Show list of available options\&.
|
|
||||||
.RE
|
|
||||||
.PP
|
|
||||||
\-H <ldb\-url>
|
|
||||||
.RS 4
|
|
||||||
LDB URL to connect to\&. See ldb(3) for details\&.
|
|
||||||
.RE
|
|
||||||
.PP
|
|
||||||
\-o options
|
|
||||||
.RS 4
|
|
||||||
Extra ldb options, such as modules\&.
|
|
||||||
.RE
|
|
||||||
.SH "ENVIRONMENT"
|
|
||||||
.PP
|
|
||||||
LDB_URL
|
|
||||||
.RS 4
|
|
||||||
LDB URL to connect to (can be overridden by using the \-H command\-line option\&.)
|
|
||||||
.RE
|
|
||||||
.SH "VERSION"
|
|
||||||
.PP
|
|
||||||
This man page is correct for version 1\&.1 of LDB\&.
|
|
||||||
.SH "SEE ALSO"
|
|
||||||
.PP
|
|
||||||
ldb(3), ldbmodify, ldbdel, ldif(5)
|
|
||||||
.SH "AUTHOR"
|
|
||||||
.PP
|
|
||||||
ldb was written by
|
|
||||||
\m[blue]\fBAndrew Tridgell\fR\m[]\&\s-2\u[1]\d\s+2\&.
|
|
||||||
.PP
|
|
||||||
If you wish to report a problem or make a suggestion then please see the
|
|
||||||
\m[blue]\fB\%http://ldb.samba.org/\fR\m[]
|
|
||||||
web site for current contact and maintainer information\&.
|
|
||||||
.PP
|
|
||||||
This manpage was written by Jelmer Vernooij\&.
|
|
||||||
.SH "NOTES"
|
|
||||||
.IP " 1." 4
|
|
||||||
Andrew Tridgell
|
|
||||||
.RS 4
|
|
||||||
\%https://www.samba.org/~tridge/
|
|
||||||
.RE
|
|
||||||
@ -1,91 +0,0 @@
|
|||||||
'\" t
|
|
||||||
.\" Title: ldbsearch
|
|
||||||
.\" Author: [see the "AUTHOR" section]
|
|
||||||
.\" Generator: DocBook XSL Stylesheets v1.79.1 <http://docbook.sf.net/>
|
|
||||||
.\" Date: 09/23/2020
|
|
||||||
.\" Manual: System Administration tools
|
|
||||||
.\" Source: LDB 1.1
|
|
||||||
.\" Language: English
|
|
||||||
.\"
|
|
||||||
.TH "LDBSEARCH" "1" "09/23/2020" "LDB 1\&.1" "System Administration tools"
|
|
||||||
.\" -----------------------------------------------------------------
|
|
||||||
.\" * Define some portability stuff
|
|
||||||
.\" -----------------------------------------------------------------
|
|
||||||
.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
|
||||||
.\" http://bugs.debian.org/507673
|
|
||||||
.\" http://lists.gnu.org/archive/html/groff/2009-02/msg00013.html
|
|
||||||
.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
|
||||||
.ie \n(.g .ds Aq \(aq
|
|
||||||
.el .ds Aq '
|
|
||||||
.\" -----------------------------------------------------------------
|
|
||||||
.\" * set default formatting
|
|
||||||
.\" -----------------------------------------------------------------
|
|
||||||
.\" disable hyphenation
|
|
||||||
.nh
|
|
||||||
.\" disable justification (adjust text to left margin only)
|
|
||||||
.ad l
|
|
||||||
.\" -----------------------------------------------------------------
|
|
||||||
.\" * MAIN CONTENT STARTS HERE *
|
|
||||||
.\" -----------------------------------------------------------------
|
|
||||||
.SH "NAME"
|
|
||||||
ldbsearch \- Search for records in a LDB database
|
|
||||||
.SH "SYNOPSIS"
|
|
||||||
.HP \w'\fBldbsearch\fR\ 'u
|
|
||||||
\fBldbsearch\fR [\-h] [\-s\ base|one|sub] [\-b\ basedn] [\-i] [\-H\ LDB\-URL] [expression] [attributes]
|
|
||||||
.SH "DESCRIPTION"
|
|
||||||
.PP
|
|
||||||
ldbsearch searches a LDB database for records matching the specified expression (see the ldapsearch(1) manpage for a description of the expression format)\&. For each record, the specified attributes are printed\&.
|
|
||||||
.SH "OPTIONS"
|
|
||||||
.PP
|
|
||||||
\-h
|
|
||||||
.RS 4
|
|
||||||
Show list of available options\&.
|
|
||||||
.RE
|
|
||||||
.PP
|
|
||||||
\-H <ldb\-url>
|
|
||||||
.RS 4
|
|
||||||
LDB URL to connect to\&. See ldb(3) for details\&.
|
|
||||||
.RE
|
|
||||||
.PP
|
|
||||||
\-s one|sub|base
|
|
||||||
.RS 4
|
|
||||||
Search scope to use\&. One\-level, subtree or base\&.
|
|
||||||
.RE
|
|
||||||
.PP
|
|
||||||
\-i
|
|
||||||
.RS 4
|
|
||||||
Read search expressions from stdin\&.
|
|
||||||
.RE
|
|
||||||
.PP
|
|
||||||
\-b basedn
|
|
||||||
.RS 4
|
|
||||||
Specify Base DN to use\&.
|
|
||||||
.RE
|
|
||||||
.SH "ENVIRONMENT"
|
|
||||||
.PP
|
|
||||||
LDB_URL
|
|
||||||
.RS 4
|
|
||||||
LDB URL to connect to (can be overridden by using the \-H command\-line option\&.)
|
|
||||||
.RE
|
|
||||||
.SH "VERSION"
|
|
||||||
.PP
|
|
||||||
This man page is correct for version 1\&.1 of LDB\&.
|
|
||||||
.SH "SEE ALSO"
|
|
||||||
.PP
|
|
||||||
ldb(3), ldbedit(1)
|
|
||||||
.SH "AUTHOR"
|
|
||||||
.PP
|
|
||||||
ldb was written by
|
|
||||||
\m[blue]\fBAndrew Tridgell\fR\m[]\&\s-2\u[1]\d\s+2\&.
|
|
||||||
.PP
|
|
||||||
If you wish to report a problem or make a suggestion then please see the
|
|
||||||
\m[blue]\fB\%http://ldb.samba.org/\fR\m[]
|
|
||||||
web site for current contact and maintainer information\&.
|
|
||||||
.PP
|
|
||||||
This manpage was written by Jelmer Vernooij\&.
|
|
||||||
.SH "NOTES"
|
|
||||||
.IP " 1." 4
|
|
||||||
Andrew Tridgell
|
|
||||||
.RS 4
|
|
||||||
\%https://www.samba.org/~tridge/
|
|
||||||
.RE
|
|
||||||
@ -1,50 +0,0 @@
|
|||||||
--- buildtools/wafsamba/samba_autoconf.py.orig 2022-12-15 13:35:50 UTC
|
|
||||||
+++ buildtools/wafsamba/samba_autoconf.py
|
|
||||||
@@ -595,7 +595,7 @@ def library_flags(self, libs):
|
|
||||||
|
|
||||||
|
|
||||||
@conf
|
|
||||||
-def CHECK_LIB(conf, libs, mandatory=False, empty_decl=True, set_target=True, shlib=False):
|
|
||||||
+def CHECK_LIB(conf, libs, mandatory=False, empty_decl=True, set_target=True, shlib=False, msg=None):
|
|
||||||
'''check if a set of libraries exist as system libraries
|
|
||||||
|
|
||||||
returns the sublist of libs that do exist as a syslib or []
|
|
||||||
@@ -615,11 +615,29 @@ int foo()
|
|
||||||
ret.append(lib)
|
|
||||||
continue
|
|
||||||
|
|
||||||
+ if msg is None:
|
|
||||||
+ msg = 'Checking for library %s' % lib
|
|
||||||
+
|
|
||||||
(ccflags, ldflags, cpppath) = library_flags(conf, lib)
|
|
||||||
+
|
|
||||||
if shlib:
|
|
||||||
- res = conf.check(features='c cshlib', fragment=fragment, lib=lib, uselib_store=lib, cflags=ccflags, ldflags=ldflags, uselib=lib.upper(), mandatory=False)
|
|
||||||
+ res = conf.check(features='c cshlib',
|
|
||||||
+ fragment=fragment,
|
|
||||||
+ lib=lib,
|
|
||||||
+ uselib_store=lib,
|
|
||||||
+ cflags=ccflags,
|
|
||||||
+ ldflags=ldflags,
|
|
||||||
+ uselib=lib.upper(),
|
|
||||||
+ mandatory=False,
|
|
||||||
+ msg=msg)
|
|
||||||
else:
|
|
||||||
- res = conf.check(lib=lib, uselib_store=lib, cflags=ccflags, ldflags=ldflags, uselib=lib.upper(), mandatory=False)
|
|
||||||
+ res = conf.check(lib=lib,
|
|
||||||
+ uselib_store=lib,
|
|
||||||
+ cflags=ccflags,
|
|
||||||
+ ldflags=ldflags,
|
|
||||||
+ uselib=lib.upper(),
|
|
||||||
+ mandatory=False,
|
|
||||||
+ msg=msg)
|
|
||||||
|
|
||||||
if not res:
|
|
||||||
if mandatory:
|
|
||||||
@@ -989,5 +1007,5 @@ def SAMBA_CHECK_UNDEFINED_SYMBOL_FLAGS(conf):
|
|
||||||
conf.env.undefined_ldflags = conf.ADD_LDFLAGS('-Wl,-no-undefined', testflags=True)
|
|
||||||
|
|
||||||
if (conf.env.undefined_ignore_ldflags == [] and
|
|
||||||
- conf.CHECK_LDFLAGS(['-undefined', 'dynamic_lookup'])):
|
|
||||||
+ conf.CHECK_LDFLAGS(['-undefined', 'dynamic_lookup'] + conf.env.WERROR_CFLAGS)):
|
|
||||||
conf.env.undefined_ignore_ldflags = ['-undefined', 'dynamic_lookup']
|
|
||||||
@ -1,11 +0,0 @@
|
|||||||
--- buildtools/wafsamba/samba_install.py.orig 2019-03-21 10:12:32 UTC
|
|
||||||
+++ buildtools/wafsamba/samba_install.py
|
|
||||||
@@ -115,7 +115,7 @@ def install_library(self):
|
|
||||||
inst_name = bld.make_libname(t.target)
|
|
||||||
elif self.vnum:
|
|
||||||
vnum_base = self.vnum.split('.')[0]
|
|
||||||
- install_name = bld.make_libname(target_name, version=self.vnum)
|
|
||||||
+ install_name = bld.make_libname(target_name, version=vnum_base)
|
|
||||||
install_link = bld.make_libname(target_name, version=vnum_base)
|
|
||||||
inst_name = bld.make_libname(t.target)
|
|
||||||
if not self.private_library or not t.env.SONAME_ST:
|
|
||||||
@ -1,22 +0,0 @@
|
|||||||
--- buildtools/wafsamba/wscript.orig 2022-03-29 07:53:52 UTC
|
|
||||||
+++ buildtools/wafsamba/wscript
|
|
||||||
@@ -133,12 +133,17 @@ Currently the only tested value is 'smbtorture,smbd/sm
|
|
||||||
help=("private library directory [PREFIX/lib/%s]" % Context.g_module.APPNAME),
|
|
||||||
action="store", dest='PRIVATELIBDIR', default=None)
|
|
||||||
|
|
||||||
+ opt.add_option('--with-openldap',
|
|
||||||
+ help='additional directory to search for OpenLDAP libs',
|
|
||||||
+ action='store', dest='ldap_open', default=None,
|
|
||||||
+ match = ['Checking for library lber', 'Checking for library ldap'])
|
|
||||||
+
|
|
||||||
opt.add_option('--with-libiconv',
|
|
||||||
help='additional directory to search for libiconv',
|
|
||||||
- action='store', dest='iconv_open', default='/usr/local',
|
|
||||||
+ action='store', dest='iconv_open', default=None,
|
|
||||||
match = ['Checking for library iconv', 'Checking for iconv_open', 'Checking for header iconv.h'])
|
|
||||||
opt.add_option('--without-gettext',
|
|
||||||
- help=("Disable use of gettext"),
|
|
||||||
+ help=("disable use of gettext"),
|
|
||||||
action="store_true", dest='disable_gettext', default=False)
|
|
||||||
|
|
||||||
gr = opt.option_group('developer options')
|
|
||||||
@ -1,15 +0,0 @@
|
|||||||
--- include/ldb_module.h.orig 2023-03-29 13:42:11 UTC
|
|
||||||
+++ include/ldb_module.h
|
|
||||||
@@ -108,6 +108,12 @@ struct ldb_module;
|
|
||||||
*/
|
|
||||||
#define LDB_FLAG_INTERNAL_ACCESS_CHECKED 0x400
|
|
||||||
|
|
||||||
+/*
|
|
||||||
+ * indicates that this element's values are shared with another element (for
|
|
||||||
+ * example, in a shallow copy of an ldb_message) and should not be freed
|
|
||||||
+ */
|
|
||||||
+#define LDB_FLAG_INTERNAL_SHARED_VALUES 0x200
|
|
||||||
+
|
|
||||||
/* an extended match rule that always fails to match */
|
|
||||||
#define SAMBA_LDAP_MATCH_ALWAYS_FALSE "1.3.6.1.4.1.7165.4.5.1"
|
|
||||||
|
|
||||||
@ -1,13 +0,0 @@
|
|||||||
--- ldb_key_value/ldb_kv_cache.c.orig 2022-01-24 10:27:24 UTC
|
|
||||||
+++ ldb_key_value/ldb_kv_cache.c
|
|
||||||
@@ -92,7 +92,9 @@ static int ldb_schema_attribute_compare(const void *p1
|
|
||||||
{
|
|
||||||
const struct ldb_schema_attribute *sa1 = (const struct ldb_schema_attribute *)p1;
|
|
||||||
const struct ldb_schema_attribute *sa2 = (const struct ldb_schema_attribute *)p2;
|
|
||||||
- return ldb_attr_cmp(sa1->name, sa2->name);
|
|
||||||
+ int res = ldb_attr_cmp(sa1->name, sa2->name);
|
|
||||||
+
|
|
||||||
+ return (res) ? res : (sa1->flags > sa2->flags) ? 1 : (sa1->flags < sa2->flags) ? -1 : 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
/*
|
|
||||||
@ -1,20 +0,0 @@
|
|||||||
--- lib/replace/replace.c.orig 2023-11-22 12:09:13 UTC
|
|
||||||
+++ lib/replace/replace.c
|
|
||||||
@@ -560,6 +560,7 @@ long long int rep_strtoll(const char *str, char **endp
|
|
||||||
|
|
||||||
|
|
||||||
#ifndef HAVE_STRTOULL
|
|
||||||
+#warning NO_HAVE_STRTOULL
|
|
||||||
unsigned long long int rep_strtoull(const char *str, char **endptr, int base)
|
|
||||||
{
|
|
||||||
#ifdef HAVE_STRTOUQ
|
|
||||||
@@ -573,7 +574,9 @@ unsigned long long int rep_strtoull(const char *str, c
|
|
||||||
#endif
|
|
||||||
}
|
|
||||||
#else
|
|
||||||
+#warning HAVE_STROULL
|
|
||||||
#ifdef HAVE_BSD_STRTOLL
|
|
||||||
+#warning HAVE_BSD_STROLL
|
|
||||||
#undef strtoull
|
|
||||||
unsigned long long int rep_strtoull(const char *str, char **endptr, int base)
|
|
||||||
{
|
|
||||||
@ -1,11 +0,0 @@
|
|||||||
--- lib/replace/wscript.orig 2022-10-24 10:21:14 UTC
|
|
||||||
+++ lib/replace/wscript
|
|
||||||
@@ -122,7 +122,7 @@ def configure(conf):
|
|
||||||
conf.CHECK_HEADERS('sys/atomic.h stdatomic.h')
|
|
||||||
conf.CHECK_HEADERS('libgen.h')
|
|
||||||
|
|
||||||
- if conf.CHECK_CFLAGS('-Wno-format-truncation'):
|
|
||||||
+ if conf.CHECK_CFLAGS(['-Wno-format-truncation'] + conf.env.WERROR_CFLAGS):
|
|
||||||
conf.define('HAVE_WNO_FORMAT_TRUNCATION', '1')
|
|
||||||
|
|
||||||
if conf.CHECK_CFLAGS('-Wno-unused-function'):
|
|
||||||
@ -1,40 +0,0 @@
|
|||||||
--- wscript.orig 2023-03-29 15:42:11.181590800 +0200
|
|
||||||
+++ wscript 2023-12-07 17:41:11.676269000 +0100
|
|
||||||
@@ -208,7 +208,7 @@
|
|
||||||
if bld.env.standalone_ldb:
|
|
||||||
if not 'PACKAGE_VERSION' in bld.env:
|
|
||||||
bld.env.PACKAGE_VERSION = VERSION
|
|
||||||
- bld.env.PKGCONFIGDIR = '${LIBDIR}/pkgconfig'
|
|
||||||
+ bld.env.PKGCONFIGDIR = '%%PKGCONFIGDIR%%'
|
|
||||||
private_library = False
|
|
||||||
else:
|
|
||||||
private_library = True
|
|
||||||
@@ -413,7 +413,7 @@
|
|
||||||
bld.SUBDIR('ldb_mdb',
|
|
||||||
'''ldb_mdb.c '''),
|
|
||||||
private_library=True,
|
|
||||||
- deps='ldb lmdb ldb_key_value')
|
|
||||||
+ deps='replace ldb lmdb ldb_key_value')
|
|
||||||
lmdb_deps = ' ldb_mdb_int'
|
|
||||||
else:
|
|
||||||
lmdb_deps = ''
|
|
||||||
@@ -498,11 +498,6 @@
|
|
||||||
deps='cmocka ldb',
|
|
||||||
install=False)
|
|
||||||
|
|
||||||
- bld.SAMBA_BINARY('ldb_match_test',
|
|
||||||
- source='tests/ldb_match_test.c',
|
|
||||||
- deps='cmocka ldb',
|
|
||||||
- install=False)
|
|
||||||
-
|
|
||||||
bld.SAMBA_BINARY('ldb_key_value_test',
|
|
||||||
source='tests/ldb_key_value_test.c',
|
|
||||||
deps='cmocka ldb ldb_tdb_err_map',
|
|
||||||
@@ -634,7 +629,6 @@
|
|
||||||
'ldb_tdb_guid_mod_op_test',
|
|
||||||
'ldb_tdb_kv_ops_test',
|
|
||||||
'ldb_tdb_test',
|
|
||||||
- 'ldb_match_test',
|
|
||||||
'ldb_key_value_test',
|
|
||||||
# we currently don't run ldb_key_value_sub_txn_tdb_test as it
|
|
||||||
# tests the nested/sub transaction handling
|
|
||||||
@ -1,7 +0,0 @@
|
|||||||
ldb is a LDAP-like embedded database.
|
|
||||||
|
|
||||||
ldb provides a fast database with an LDAP-like API designed to be used
|
|
||||||
within an application.
|
|
||||||
|
|
||||||
In some ways it can be seen as a intermediate solution between key-value
|
|
||||||
pair databases and a real LDAP database.
|
|
||||||
@ -1,75 +0,0 @@
|
|||||||
PORTNAME= tdb
|
|
||||||
DISTVERSION= 1.4.10
|
|
||||||
#PORTEPOCH= 1
|
|
||||||
CATEGORIES= databases
|
|
||||||
MASTER_SITES= SAMBA
|
|
||||||
|
|
||||||
MAINTAINER= samba@FreeBSD.org
|
|
||||||
COMMENT= Trivial Database
|
|
||||||
WWW= https://tdb.samba.org/
|
|
||||||
|
|
||||||
LICENSE= GPLv3
|
|
||||||
|
|
||||||
USES= compiler pkgconfig shebangfix waf
|
|
||||||
USE_LDCONFIG= yes
|
|
||||||
SHEBANG_GLOB= *.py
|
|
||||||
WAF_CMD= buildtools/bin/waf
|
|
||||||
CONFIGURE_LOG= bin/config.log
|
|
||||||
|
|
||||||
PKGCONFIGDIR?= ${PREFIX}/libdata/pkgconfig
|
|
||||||
PLIST_SUB+= PKGCONFIGDIR=${PKGCONFIGDIR:S;^${PREFIX}/;;}
|
|
||||||
|
|
||||||
CONFIGURE_ARGS+= --disable-rpath \
|
|
||||||
--disable-rpath-install \
|
|
||||||
--bundled-libraries=NONE \
|
|
||||||
--builtin-libraries=replace \
|
|
||||||
--without-gettext
|
|
||||||
CONFIGURE_ENV= PYTHONHASHSEED=1
|
|
||||||
MAKE_ENV= PYTHONHASHSEED=1
|
|
||||||
|
|
||||||
MANPAGES_DESC= Build and install manpages (requires textproc/docbook-xsl)
|
|
||||||
|
|
||||||
OPTIONS_DEFINE= MANPAGES DEBUG PYTHON
|
|
||||||
OPTIONS_DEFAULT= PYTHON
|
|
||||||
OPTIONS_SUB= yes
|
|
||||||
|
|
||||||
DEBUG_CFLAGS= -g -ggdb3 -O0
|
|
||||||
DEBUG_CONFIGURE_ON= --verbose --enable-debug
|
|
||||||
DEBUG_MAKE_ARGS= --verbose
|
|
||||||
|
|
||||||
PYTHON_USES= gettext-runtime python
|
|
||||||
PYTHON_USE+= python=py3kplist
|
|
||||||
PYTHON_USES_OFF= python:build,test
|
|
||||||
PYTHON_CONFIGURE_OFF= --disable-python
|
|
||||||
|
|
||||||
MANPAGES_CONFIGURE_ENV_OFF+= XSLTPROC="true"
|
|
||||||
MANPAGES_BUILD_DEPENDS+= ${LOCALBASE}/share/xsl/docbook/manpages/docbook.xsl:textproc/docbook-xsl \
|
|
||||||
xsltproc:textproc/libxslt
|
|
||||||
# No fancy color error messages
|
|
||||||
CFLAGS+= ${CFLAGS_${CHOSEN_COMPILER_TYPE}}
|
|
||||||
CFLAGS_clang= -fno-color-diagnostics
|
|
||||||
CONFIGURE_ENV+= NOCOLOR=yes
|
|
||||||
MAKE_ENV+= NOCOLOR=yes
|
|
||||||
# Some symbols in tdb's linker version scripts are not defined, but since the
|
|
||||||
# scripts are generated dynamically, suppress errors with lld >= 17 due to these
|
|
||||||
# undefined symbols.
|
|
||||||
LDFLAGS+= -Wl,--undefined-version
|
|
||||||
|
|
||||||
CONFLICTS_INSTALL= tdb
|
|
||||||
|
|
||||||
post-patch:
|
|
||||||
@${REINPLACE_CMD} -e 's|%%PKGCONFIGDIR%%|${PKGCONFIGDIR}|g' \
|
|
||||||
${BUILD_WRKSRC}/wscript
|
|
||||||
|
|
||||||
pre-build-MANPAGES-off:
|
|
||||||
${MKDIR} ${BUILD_WRKSRC}/bin/default/man
|
|
||||||
${INSTALL_MAN} ${FILESDIR}/tdb*.8 ${BUILD_WRKSRC}/bin/default/man
|
|
||||||
|
|
||||||
post-install:
|
|
||||||
${STRIP_CMD} ${STAGEDIR}${PREFIX}/bin/tdb*
|
|
||||||
${STRIP_CMD} ${STAGEDIR}${PREFIX}/lib/libtdb.so.1
|
|
||||||
|
|
||||||
post-install-PYTHON-on:
|
|
||||||
${STRIP_CMD} ${STAGEDIR}${PYTHONPREFIX_SITELIBDIR}/tdb*.so
|
|
||||||
|
|
||||||
.include <bsd.port.mk>
|
|
||||||
@ -1,3 +0,0 @@
|
|||||||
TIMESTAMP = 1737641302
|
|
||||||
SHA256 (tdb-1.4.10.tar.gz) = 02338e33c16c21c9e29571cef523e76b2b708636254f6f30c6cf195d48c62daf
|
|
||||||
SIZE (tdb-1.4.10.tar.gz) = 747139
|
|
||||||
@ -1,35 +0,0 @@
|
|||||||
--- buildtools/wafsamba/samba_autoconf.py.orig 2019-08-20 15:35:08 UTC
|
|
||||||
+++ buildtools/wafsamba/samba_autoconf.py
|
|
||||||
@@ -573,7 +573,7 @@ def library_flags(self, libs):
|
|
||||||
|
|
||||||
|
|
||||||
@conf
|
|
||||||
-def CHECK_LIB(conf, libs, mandatory=False, empty_decl=True, set_target=True, shlib=False):
|
|
||||||
+def CHECK_LIB(conf, libs, mandatory=False, empty_decl=True, set_target=True, shlib=False, msg=None):
|
|
||||||
'''check if a set of libraries exist as system libraries
|
|
||||||
|
|
||||||
returns the sublist of libs that do exist as a syslib or []
|
|
||||||
@@ -593,11 +593,14 @@ int foo()
|
|
||||||
ret.append(lib)
|
|
||||||
continue
|
|
||||||
|
|
||||||
+ if msg is None:
|
|
||||||
+ msg = 'Checking for library %s' % lib
|
|
||||||
+
|
|
||||||
(ccflags, ldflags, cpppath) = library_flags(conf, lib)
|
|
||||||
if shlib:
|
|
||||||
- res = conf.check(features='c cshlib', fragment=fragment, lib=lib, uselib_store=lib, cflags=ccflags, ldflags=ldflags, uselib=lib.upper(), mandatory=False)
|
|
||||||
+ res = conf.check(features='c cshlib', fragment=fragment, lib=lib, uselib_store=lib, cflags=ccflags, ldflags=ldflags, uselib=lib.upper(), mandatory=False, msg=msg)
|
|
||||||
else:
|
|
||||||
- res = conf.check(lib=lib, uselib_store=lib, cflags=ccflags, ldflags=ldflags, uselib=lib.upper(), mandatory=False)
|
|
||||||
+ res = conf.check(lib=lib, uselib_store=lib, cflags=ccflags, ldflags=ldflags, uselib=lib.upper(), mandatory=False, msg=msg)
|
|
||||||
|
|
||||||
if not res:
|
|
||||||
if mandatory:
|
|
||||||
@@ -949,5 +952,5 @@ def SAMBA_CHECK_UNDEFINED_SYMBOL_FLAGS(c
|
|
||||||
conf.env.undefined_ldflags = conf.ADD_LDFLAGS('-Wl,-no-undefined', testflags=True)
|
|
||||||
|
|
||||||
if (conf.env.undefined_ignore_ldflags == [] and
|
|
||||||
- conf.CHECK_LDFLAGS(['-undefined', 'dynamic_lookup'])):
|
|
||||||
+ conf.CHECK_LDFLAGS(['-undefined', 'dynamic_lookup'] + conf.env.WERROR_CFLAGS)):
|
|
||||||
conf.env.undefined_ignore_ldflags = ['-undefined', 'dynamic_lookup']
|
|
||||||
@ -1,11 +0,0 @@
|
|||||||
--- buildtools/wafsamba/samba_install.py.orig 2019-02-14 11:21:38 UTC
|
|
||||||
+++ buildtools/wafsamba/samba_install.py
|
|
||||||
@@ -118,7 +118,7 @@ def install_library(self):
|
|
||||||
inst_name = bld.make_libname(t.target)
|
|
||||||
elif self.vnum:
|
|
||||||
vnum_base = self.vnum.split('.')[0]
|
|
||||||
- install_name = bld.make_libname(target_name, version=self.vnum)
|
|
||||||
+ install_name = bld.make_libname(target_name, version=vnum_base)
|
|
||||||
install_link = bld.make_libname(target_name, version=vnum_base)
|
|
||||||
inst_name = bld.make_libname(t.target)
|
|
||||||
if not self.private_library:
|
|
||||||
@ -1,15 +0,0 @@
|
|||||||
--- buildtools/wafsamba/wscript.orig 2019-02-26 06:44:21 UTC
|
|
||||||
+++ buildtools/wafsamba/wscript
|
|
||||||
@@ -82,10 +82,10 @@ def options(opt):
|
|
||||||
|
|
||||||
opt.add_option('--with-libiconv',
|
|
||||||
help='additional directory to search for libiconv',
|
|
||||||
- action='store', dest='iconv_open', default='/usr/local',
|
|
||||||
+ action='store', dest='iconv_open', default=None,
|
|
||||||
match = ['Checking for library iconv', 'Checking for iconv_open', 'Checking for header iconv.h'])
|
|
||||||
opt.add_option('--without-gettext',
|
|
||||||
- help=("Disable use of gettext"),
|
|
||||||
+ help=("disable use of gettext"),
|
|
||||||
action="store_true", dest='disable_gettext', default=False)
|
|
||||||
|
|
||||||
gr = opt.option_group('developer options')
|
|
||||||
@ -1,11 +0,0 @@
|
|||||||
--- lib/replace/wscript.orig 2019-02-26 06:44:21 UTC
|
|
||||||
+++ lib/replace/wscript
|
|
||||||
@@ -119,7 +119,7 @@ def configure(conf):
|
|
||||||
conf.CHECK_HEADERS('sys/atomic.h stdatomic.h')
|
|
||||||
conf.CHECK_HEADERS('libgen.h')
|
|
||||||
|
|
||||||
- if conf.CHECK_CFLAGS('-Wno-format-truncation'):
|
|
||||||
+ if conf.CHECK_CFLAGS(['-Wno-format-truncation'] + conf.env.WERROR_CFLAGS):
|
|
||||||
conf.define('HAVE_WNO_FORMAT_TRUNCATION', '1')
|
|
||||||
|
|
||||||
if conf.CHECK_CFLAGS('-Wno-unused-function'):
|
|
||||||
@ -1,11 +0,0 @@
|
|||||||
--- wscript.orig 2019-02-26 07:02:52 UTC
|
|
||||||
+++ wscript
|
|
||||||
@@ -121,7 +121,7 @@ def build(bld):
|
|
||||||
COMMON_SRC = bld.SUBDIR('common', COMMON_FILES)
|
|
||||||
|
|
||||||
if bld.env.standalone_tdb:
|
|
||||||
- bld.env.PKGCONFIGDIR = '${LIBDIR}/pkgconfig'
|
|
||||||
+ bld.env.PKGCONFIGDIR = '%%PKGCONFIGDIR%%'
|
|
||||||
private_library = False
|
|
||||||
else:
|
|
||||||
private_library = True
|
|
||||||
@ -1,129 +0,0 @@
|
|||||||
'\" t
|
|
||||||
.\" Title: tdbbackup
|
|
||||||
.\" Author: [see the "AUTHOR" section]
|
|
||||||
.\" Generator: DocBook XSL Stylesheets v1.76.1 <http://docbook.sf.net/>
|
|
||||||
.\" Date: 2015-04-25
|
|
||||||
.\" Manual: System Administration tools
|
|
||||||
.\" Source: Samba 3.6
|
|
||||||
.\" Language: English
|
|
||||||
.\"
|
|
||||||
.TH "TDBBACKUP" "8" "2015\-04\-25" "Samba 3\&.6" "System Administration tools"
|
|
||||||
.\" -----------------------------------------------------------------
|
|
||||||
.\" * Define some portability stuff
|
|
||||||
.\" -----------------------------------------------------------------
|
|
||||||
.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
|
||||||
.\" http://bugs.debian.org/507673
|
|
||||||
.\" http://lists.gnu.org/archive/html/groff/2009-02/msg00013.html
|
|
||||||
.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
|
||||||
.ie \n(.g .ds Aq \(aq
|
|
||||||
.el .ds Aq '
|
|
||||||
.\" -----------------------------------------------------------------
|
|
||||||
.\" * set default formatting
|
|
||||||
.\" -----------------------------------------------------------------
|
|
||||||
.\" disable hyphenation
|
|
||||||
.nh
|
|
||||||
.\" disable justification (adjust text to left margin only)
|
|
||||||
.ad l
|
|
||||||
.\" -----------------------------------------------------------------
|
|
||||||
.\" * MAIN CONTENT STARTS HERE *
|
|
||||||
.\" -----------------------------------------------------------------
|
|
||||||
.SH "NAME"
|
|
||||||
tdbbackup \- tool for backing up and for validating the integrity of samba \&.tdb files
|
|
||||||
.SH "SYNOPSIS"
|
|
||||||
.HP \w'\fBtdbbackup\fR\ 'u
|
|
||||||
\fBtdbbackup\fR [\-s\ suffix] [\-v] [\-h] [\-l]
|
|
||||||
.SH "DESCRIPTION"
|
|
||||||
.PP
|
|
||||||
This tool is part of the
|
|
||||||
\fBsamba\fR(1)
|
|
||||||
suite\&.
|
|
||||||
.PP
|
|
||||||
\fBtdbbackup\fR
|
|
||||||
is a tool that may be used to backup samba \&.tdb files\&. This tool may also be used to verify the integrity of the \&.tdb files prior to samba startup or during normal operation\&. If it finds file damage and it finds a prior backup the backup file will be restored\&.
|
|
||||||
.SH "OPTIONS"
|
|
||||||
.PP
|
|
||||||
\-h
|
|
||||||
.RS 4
|
|
||||||
Get help information\&.
|
|
||||||
.RE
|
|
||||||
.PP
|
|
||||||
\-s suffix
|
|
||||||
.RS 4
|
|
||||||
The
|
|
||||||
\fB\-s\fR
|
|
||||||
option allows the administrator to specify a file backup extension\&. This way it is possible to keep a history of tdb backup files by using a new suffix for each backup\&.
|
|
||||||
.RE
|
|
||||||
.PP
|
|
||||||
\-v
|
|
||||||
.RS 4
|
|
||||||
The
|
|
||||||
\fB\-v\fR
|
|
||||||
will check the database for damages (corrupt data) which if detected causes the backup to be restored\&.
|
|
||||||
.RE
|
|
||||||
.PP
|
|
||||||
\-l
|
|
||||||
.RS 4
|
|
||||||
This options disables any locking, by passing TDB_NOLOCK to tdb_open_ex()\&. Only use this for database files which are not used by any other process! And also only if it is otherwise not possible to open the database, e\&.g\&. databases which were created with mutex locking\&.
|
|
||||||
.RE
|
|
||||||
.SH "COMMANDS"
|
|
||||||
.PP
|
|
||||||
\fIGENERAL INFORMATION\fR
|
|
||||||
.PP
|
|
||||||
The
|
|
||||||
\fBtdbbackup\fR
|
|
||||||
utility can safely be run at any time\&. It was designed so that it can be used at any time to validate the integrity of tdb files, even during Samba operation\&. Typical usage for the command will be:
|
|
||||||
.PP
|
|
||||||
tdbbackup [\-s suffix] *\&.tdb
|
|
||||||
.PP
|
|
||||||
Before restarting samba the following command may be run to validate \&.tdb files:
|
|
||||||
.PP
|
|
||||||
tdbbackup \-v [\-s suffix] *\&.tdb
|
|
||||||
.PP
|
|
||||||
Samba \&.tdb files are stored in various locations, be sure to run backup all \&.tdb file on the system\&. Important files includes:
|
|
||||||
.sp
|
|
||||||
.RS 4
|
|
||||||
.ie n \{\
|
|
||||||
\h'-04'\(bu\h'+03'\c
|
|
||||||
.\}
|
|
||||||
.el \{\
|
|
||||||
.sp -1
|
|
||||||
.IP \(bu 2.3
|
|
||||||
.\}
|
|
||||||
|
|
||||||
\fBsecrets\&.tdb\fR
|
|
||||||
\- usual location is in the /usr/local/samba/private directory, or on some systems in /etc/samba\&.
|
|
||||||
.RE
|
|
||||||
.sp
|
|
||||||
.RS 4
|
|
||||||
.ie n \{\
|
|
||||||
\h'-04'\(bu\h'+03'\c
|
|
||||||
.\}
|
|
||||||
.el \{\
|
|
||||||
.sp -1
|
|
||||||
.IP \(bu 2.3
|
|
||||||
.\}
|
|
||||||
|
|
||||||
\fBpassdb\&.tdb\fR
|
|
||||||
\- usual location is in the /usr/local/samba/private directory, or on some systems in /etc/samba\&.
|
|
||||||
.RE
|
|
||||||
.sp
|
|
||||||
.RS 4
|
|
||||||
.ie n \{\
|
|
||||||
\h'-04'\(bu\h'+03'\c
|
|
||||||
.\}
|
|
||||||
.el \{\
|
|
||||||
.sp -1
|
|
||||||
.IP \(bu 2.3
|
|
||||||
.\}
|
|
||||||
|
|
||||||
\fB*\&.tdb\fR
|
|
||||||
located in the /usr/local/samba/var directory or on some systems in the /var/cache or /var/lib/samba directories\&.
|
|
||||||
.RE
|
|
||||||
.SH "VERSION"
|
|
||||||
.PP
|
|
||||||
This man page is correct for version 3 of the Samba suite\&.
|
|
||||||
.SH "AUTHOR"
|
|
||||||
.PP
|
|
||||||
The original Samba software and related utilities were created by Andrew Tridgell\&. Samba is now developed by the Samba Team as an Open Source project similar to the way the Linux kernel is developed\&.
|
|
||||||
.PP
|
|
||||||
The tdbbackup man page was written by John H Terpstra\&.
|
|
||||||
@ -1,72 +0,0 @@
|
|||||||
'\" t
|
|
||||||
.\" Title: tdbdump
|
|
||||||
.\" Author: [see the "AUTHOR" section]
|
|
||||||
.\" Generator: DocBook XSL Stylesheets v1.76.1 <http://docbook.sf.net/>
|
|
||||||
.\" Date: 2015-04-25
|
|
||||||
.\" Manual: System Administration tools
|
|
||||||
.\" Source: Samba 3.6
|
|
||||||
.\" Language: English
|
|
||||||
.\"
|
|
||||||
.TH "TDBDUMP" "8" "2015\-04\-25" "Samba 3\&.6" "System Administration tools"
|
|
||||||
.\" -----------------------------------------------------------------
|
|
||||||
.\" * Define some portability stuff
|
|
||||||
.\" -----------------------------------------------------------------
|
|
||||||
.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
|
||||||
.\" http://bugs.debian.org/507673
|
|
||||||
.\" http://lists.gnu.org/archive/html/groff/2009-02/msg00013.html
|
|
||||||
.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
|
||||||
.ie \n(.g .ds Aq \(aq
|
|
||||||
.el .ds Aq '
|
|
||||||
.\" -----------------------------------------------------------------
|
|
||||||
.\" * set default formatting
|
|
||||||
.\" -----------------------------------------------------------------
|
|
||||||
.\" disable hyphenation
|
|
||||||
.nh
|
|
||||||
.\" disable justification (adjust text to left margin only)
|
|
||||||
.ad l
|
|
||||||
.\" -----------------------------------------------------------------
|
|
||||||
.\" * MAIN CONTENT STARTS HERE *
|
|
||||||
.\" -----------------------------------------------------------------
|
|
||||||
.SH "NAME"
|
|
||||||
tdbdump \- tool for printing the contents of a TDB file
|
|
||||||
.SH "SYNOPSIS"
|
|
||||||
.HP \w'\fBtdbdump\fR\ 'u
|
|
||||||
\fBtdbdump\fR [\-k\ \fIkeyname\fR] [\-e] [\-h] {filename}
|
|
||||||
.SH "DESCRIPTION"
|
|
||||||
.PP
|
|
||||||
This tool is part of the
|
|
||||||
\fBsamba\fR(1)
|
|
||||||
suite\&.
|
|
||||||
.PP
|
|
||||||
\fBtdbdump\fR
|
|
||||||
is a very simple utility that \*(Aqdumps\*(Aq the contents of a TDB (Trivial DataBase) file to standard output in a human\-readable format\&.
|
|
||||||
.PP
|
|
||||||
This tool can be used when debugging problems with TDB files\&. It is intended for those who are somewhat familiar with Samba internals\&.
|
|
||||||
.SH "OPTIONS"
|
|
||||||
.PP
|
|
||||||
\-h
|
|
||||||
.RS 4
|
|
||||||
Get help information\&.
|
|
||||||
.RE
|
|
||||||
.PP
|
|
||||||
\-k \fIkeyname\fR
|
|
||||||
.RS 4
|
|
||||||
The
|
|
||||||
\fB\-k\fR
|
|
||||||
option restricts dumping to a single key, if found\&.
|
|
||||||
.RE
|
|
||||||
.PP
|
|
||||||
\-e
|
|
||||||
.RS 4
|
|
||||||
The
|
|
||||||
\fB\-e\fR
|
|
||||||
tries to dump out from a corrupt database\&. Naturally, such a dump is unreliable, at best\&.
|
|
||||||
.RE
|
|
||||||
.SH "VERSION"
|
|
||||||
.PP
|
|
||||||
This man page is correct for version 3 of the Samba suite\&.
|
|
||||||
.SH "AUTHOR"
|
|
||||||
.PP
|
|
||||||
The original Samba software and related utilities were created by Andrew Tridgell\&. Samba is now developed by the Samba Team as an Open Source project similar to the way the Linux kernel is developed\&.
|
|
||||||
.PP
|
|
||||||
The tdbdump man page was written by Jelmer Vernooij\&.
|
|
||||||
@ -1,54 +0,0 @@
|
|||||||
'\" t
|
|
||||||
.\" Title: tdbrestore
|
|
||||||
.\" Author: [see the "AUTHOR" section]
|
|
||||||
.\" Generator: DocBook XSL Stylesheets v1.76.1 <http://docbook.sf.net/>
|
|
||||||
.\" Date: 2015-04-25
|
|
||||||
.\" Manual: System Administration tools
|
|
||||||
.\" Source: Samba 3.6
|
|
||||||
.\" Language: English
|
|
||||||
.\"
|
|
||||||
.TH "TDBRESTORE" "8" "2015\-04\-25" "Samba 3\&.6" "System Administration tools"
|
|
||||||
.\" -----------------------------------------------------------------
|
|
||||||
.\" * Define some portability stuff
|
|
||||||
.\" -----------------------------------------------------------------
|
|
||||||
.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
|
||||||
.\" http://bugs.debian.org/507673
|
|
||||||
.\" http://lists.gnu.org/archive/html/groff/2009-02/msg00013.html
|
|
||||||
.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
|
||||||
.ie \n(.g .ds Aq \(aq
|
|
||||||
.el .ds Aq '
|
|
||||||
.\" -----------------------------------------------------------------
|
|
||||||
.\" * set default formatting
|
|
||||||
.\" -----------------------------------------------------------------
|
|
||||||
.\" disable hyphenation
|
|
||||||
.nh
|
|
||||||
.\" disable justification (adjust text to left margin only)
|
|
||||||
.ad l
|
|
||||||
.\" -----------------------------------------------------------------
|
|
||||||
.\" * MAIN CONTENT STARTS HERE *
|
|
||||||
.\" -----------------------------------------------------------------
|
|
||||||
.SH "NAME"
|
|
||||||
tdbrestore \- tool for creating a TDB file out of a tdbdump output
|
|
||||||
.SH "SYNOPSIS"
|
|
||||||
.HP \w'\fBtdbrestore\fR\ 'u
|
|
||||||
\fBtdbrestore\fR {tdbfilename}
|
|
||||||
.SH "DESCRIPTION"
|
|
||||||
.PP
|
|
||||||
This tool is part of the
|
|
||||||
\fBsamba\fR(1)
|
|
||||||
suite\&.
|
|
||||||
.PP
|
|
||||||
\fBtdbrestore\fR
|
|
||||||
is a very simple utility that \*(Aqrestores\*(Aq the contents of dump file into TDB (Trivial DataBase) file\&. The dump file is obtained from the tdbdump command\&.
|
|
||||||
.PP
|
|
||||||
This tool wait on the standard input for the content of the dump and will write the tdb in the tdbfilename parameter\&.
|
|
||||||
.PP
|
|
||||||
This tool can be used for unpacking the content of tdb as backup mean\&.
|
|
||||||
.SH "VERSION"
|
|
||||||
.PP
|
|
||||||
This man page is correct for version 3 of the Samba suite\&.
|
|
||||||
.SH "AUTHOR"
|
|
||||||
.PP
|
|
||||||
The original Samba software and related utilities were created by Andrew Tridgell\&. Samba is now developed by the Samba Team as an Open Source project similar to the way the Linux kernel is developed\&. This tool was initially written by Volker Lendecke based on an idea by Simon McVittie\&.
|
|
||||||
.PP
|
|
||||||
The tdbrestore man page was written by Matthieu Patou\&.
|
|
||||||
@ -1,170 +0,0 @@
|
|||||||
'\" t
|
|
||||||
.\" Title: tdbtool
|
|
||||||
.\" Author: [see the "AUTHOR" section]
|
|
||||||
.\" Generator: DocBook XSL Stylesheets v1.76.1 <http://docbook.sf.net/>
|
|
||||||
.\" Date: 2015-04-25
|
|
||||||
.\" Manual: System Administration tools
|
|
||||||
.\" Source: Samba 4.0
|
|
||||||
.\" Language: English
|
|
||||||
.\"
|
|
||||||
.TH "TDBTOOL" "8" "2015\-04\-25" "Samba 4\&.0" "System Administration tools"
|
|
||||||
.\" -----------------------------------------------------------------
|
|
||||||
.\" * Define some portability stuff
|
|
||||||
.\" -----------------------------------------------------------------
|
|
||||||
.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
|
||||||
.\" http://bugs.debian.org/507673
|
|
||||||
.\" http://lists.gnu.org/archive/html/groff/2009-02/msg00013.html
|
|
||||||
.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
|
||||||
.ie \n(.g .ds Aq \(aq
|
|
||||||
.el .ds Aq '
|
|
||||||
.\" -----------------------------------------------------------------
|
|
||||||
.\" * set default formatting
|
|
||||||
.\" -----------------------------------------------------------------
|
|
||||||
.\" disable hyphenation
|
|
||||||
.nh
|
|
||||||
.\" disable justification (adjust text to left margin only)
|
|
||||||
.ad l
|
|
||||||
.\" -----------------------------------------------------------------
|
|
||||||
.\" * MAIN CONTENT STARTS HERE *
|
|
||||||
.\" -----------------------------------------------------------------
|
|
||||||
.SH "NAME"
|
|
||||||
tdbtool \- manipulate the contents TDB files
|
|
||||||
.SH "SYNOPSIS"
|
|
||||||
.HP \w'\fBtdbtool\fR\ 'u
|
|
||||||
\fBtdbtool\fR
|
|
||||||
.HP \w'\fBtdbtool\fR\ 'u
|
|
||||||
\fBtdbtool\fR [\-l] \fITDBFILE\fR [\fICOMMANDS\fR...]
|
|
||||||
.SH "DESCRIPTION"
|
|
||||||
.PP
|
|
||||||
This tool is part of the
|
|
||||||
\fBsamba\fR(1)
|
|
||||||
suite\&.
|
|
||||||
.PP
|
|
||||||
\fBtdbtool\fR
|
|
||||||
a tool for displaying and altering the contents of Samba TDB (Trivial DataBase) files\&. Each of the commands listed below can be entered interactively or provided on the command line\&.
|
|
||||||
.SH "OPTIONS"
|
|
||||||
.PP
|
|
||||||
\-l
|
|
||||||
.RS 4
|
|
||||||
This options disables any locking, by passing TDB_NOLOCK to tdb_open_ex()\&. Only use this for database files which are not used by any other process! And also only if it is otherwise not possible to open the database, e\&.g\&. databases which were created with mutex locking\&.
|
|
||||||
.RE
|
|
||||||
.SH "COMMANDS"
|
|
||||||
.PP
|
|
||||||
\fBcreate\fR \fITDBFILE\fR
|
|
||||||
.RS 4
|
|
||||||
Create a new database named
|
|
||||||
\fITDBFILE\fR\&.
|
|
||||||
.RE
|
|
||||||
.PP
|
|
||||||
\fBopen\fR \fITDBFILE\fR
|
|
||||||
.RS 4
|
|
||||||
Open an existing database named
|
|
||||||
\fITDBFILE\fR\&.
|
|
||||||
.RE
|
|
||||||
.PP
|
|
||||||
\fBerase\fR
|
|
||||||
.RS 4
|
|
||||||
Erase the current database\&.
|
|
||||||
.RE
|
|
||||||
.PP
|
|
||||||
\fBdump\fR
|
|
||||||
.RS 4
|
|
||||||
Dump the current database as strings\&.
|
|
||||||
.RE
|
|
||||||
.PP
|
|
||||||
\fBcdump\fR
|
|
||||||
.RS 4
|
|
||||||
Dump the current database as connection records\&.
|
|
||||||
.RE
|
|
||||||
.PP
|
|
||||||
\fBkeys\fR
|
|
||||||
.RS 4
|
|
||||||
Dump the current database keys as strings\&.
|
|
||||||
.RE
|
|
||||||
.PP
|
|
||||||
\fBhexkeys\fR
|
|
||||||
.RS 4
|
|
||||||
Dump the current database keys as hex values\&.
|
|
||||||
.RE
|
|
||||||
.PP
|
|
||||||
\fBinfo\fR
|
|
||||||
.RS 4
|
|
||||||
Print summary information about the current database\&.
|
|
||||||
.RE
|
|
||||||
.PP
|
|
||||||
\fBinsert\fR \fIKEY\fR \fIDATA\fR
|
|
||||||
.RS 4
|
|
||||||
Insert a record into the current database\&.
|
|
||||||
.RE
|
|
||||||
.PP
|
|
||||||
\fBmove\fR \fIKEY\fR \fITDBFILE\fR
|
|
||||||
.RS 4
|
|
||||||
Move a record from the current database into
|
|
||||||
\fITDBFILE\fR\&.
|
|
||||||
.RE
|
|
||||||
.PP
|
|
||||||
\fBstore\fR \fIKEY\fR \fIDATA\fR
|
|
||||||
.RS 4
|
|
||||||
Store (replace) a record in the current database\&.
|
|
||||||
.RE
|
|
||||||
.PP
|
|
||||||
\fBshow\fR \fIKEY\fR
|
|
||||||
.RS 4
|
|
||||||
Show a record by key\&.
|
|
||||||
.RE
|
|
||||||
.PP
|
|
||||||
\fBdelete\fR \fIKEY\fR
|
|
||||||
.RS 4
|
|
||||||
Delete a record by key\&.
|
|
||||||
.RE
|
|
||||||
.PP
|
|
||||||
\fBlist\fR
|
|
||||||
.RS 4
|
|
||||||
Print the current database hash table and free list\&.
|
|
||||||
.RE
|
|
||||||
.PP
|
|
||||||
\fBfree\fR
|
|
||||||
.RS 4
|
|
||||||
Print the current database and free list\&.
|
|
||||||
.RE
|
|
||||||
.PP
|
|
||||||
\fB!\fR \fICOMMAND\fR
|
|
||||||
.RS 4
|
|
||||||
Execute the given system command\&.
|
|
||||||
.RE
|
|
||||||
.PP
|
|
||||||
\fBfirst\fR
|
|
||||||
.RS 4
|
|
||||||
Print the first record in the current database\&.
|
|
||||||
.RE
|
|
||||||
.PP
|
|
||||||
\fBnext\fR
|
|
||||||
.RS 4
|
|
||||||
Print the next record in the current database\&.
|
|
||||||
.RE
|
|
||||||
.PP
|
|
||||||
\fBcheck\fR
|
|
||||||
.RS 4
|
|
||||||
Check the integrity of the current database\&.
|
|
||||||
.RE
|
|
||||||
.PP
|
|
||||||
\fBrepack\fR
|
|
||||||
.RS 4
|
|
||||||
Repack a database using a temporary file to remove fragmentation\&.
|
|
||||||
.RE
|
|
||||||
.PP
|
|
||||||
\fBquit\fR
|
|
||||||
.RS 4
|
|
||||||
Exit
|
|
||||||
\fBtdbtool\fR\&.
|
|
||||||
.RE
|
|
||||||
.SH "CAVEATS"
|
|
||||||
.PP
|
|
||||||
The contents of the Samba TDB files are private to the implementation and should not be altered with
|
|
||||||
\fBtdbtool\fR\&.
|
|
||||||
.SH "VERSION"
|
|
||||||
.PP
|
|
||||||
This man page is correct for version 3\&.6 of the Samba suite\&.
|
|
||||||
.SH "AUTHOR"
|
|
||||||
.PP
|
|
||||||
The original Samba software and related utilities were created by Andrew Tridgell\&. Samba is now developed by the Samba Team as an Open Source project similar to the way the Linux kernel is developed\&.
|
|
||||||
@ -1,4 +0,0 @@
|
|||||||
TDB is a Trivial Database. In concept, it is very much like GDBM, and
|
|
||||||
BSD's DB except that it allows multiple simultaneous writers and uses
|
|
||||||
locking internally to keep writers from trampling on each other. TDB is
|
|
||||||
also extremely small.
|
|
||||||
@ -1,14 +0,0 @@
|
|||||||
bin/tdbbackup
|
|
||||||
bin/tdbdump
|
|
||||||
bin/tdbrestore
|
|
||||||
bin/tdbtool
|
|
||||||
include/tdb.h
|
|
||||||
lib/libtdb.so
|
|
||||||
lib/libtdb.so.1
|
|
||||||
%%PYTHON%%%%PYTHON_SITELIBDIR%%/_tdb_text.py
|
|
||||||
%%PYTHON%%%%PYTHON_SITELIBDIR%%/tdb%%PYTHON_EXT_SUFFIX%%.so
|
|
||||||
libdata/pkgconfig/tdb.pc
|
|
||||||
share/man/man8/tdbbackup.8.gz
|
|
||||||
share/man/man8/tdbdump.8.gz
|
|
||||||
share/man/man8/tdbrestore.8.gz
|
|
||||||
share/man/man8/tdbtool.8.gz
|
|
||||||
@ -1,73 +0,0 @@
|
|||||||
PORTNAME= talloc
|
|
||||||
DISTVERSION= 2.4.2
|
|
||||||
CATEGORIES= devel
|
|
||||||
MASTER_SITES= SAMBA
|
|
||||||
|
|
||||||
MAINTAINER= samba@FreeBSD.org
|
|
||||||
COMMENT= Hierarchical pool based memory allocator
|
|
||||||
WWW= https://talloc.samba.org/
|
|
||||||
|
|
||||||
LICENSE= LGPL3
|
|
||||||
|
|
||||||
USES= compiler pkgconfig shebangfix waf
|
|
||||||
USE_LDCONFIG= yes
|
|
||||||
SHEBANG_GLOB= *.py
|
|
||||||
WAF_CMD= buildtools/bin/waf
|
|
||||||
CONFIGURE_LOG= bin/config.log
|
|
||||||
|
|
||||||
PKGCONFIGDIR?= ${PREFIX}/libdata/pkgconfig
|
|
||||||
PLIST_SUB+= PKGCONFIGDIR=${PKGCONFIGDIR:S;^${PREFIX}/;;}
|
|
||||||
|
|
||||||
CONFIGURE_ARGS+= --disable-rpath \
|
|
||||||
--disable-rpath-install \
|
|
||||||
--bundled-libraries=NONE \
|
|
||||||
--builtin-libraries=replace \
|
|
||||||
--without-gettext
|
|
||||||
CONFIGURE_ENV= PYTHONHASHSEED=1
|
|
||||||
MAKE_ENV= PYTHONHASHSEED=1
|
|
||||||
|
|
||||||
MANPAGES_DESC= Build and install manpages (requires textproc/docbook-xsl)
|
|
||||||
|
|
||||||
OPTIONS_DEFINE= DEBUG MANPAGES PYTHON
|
|
||||||
OPTIONS_DEFAULT= PYTHON
|
|
||||||
OPTIONS_SUB= yes
|
|
||||||
|
|
||||||
DEBUG_CFLAGS= -g -ggdb3 -O0
|
|
||||||
DEBUG_CONFIGURE_ON= --verbose --enable-debug
|
|
||||||
DEBUG_MAKE_ARGS= --verbose
|
|
||||||
|
|
||||||
PYTHON_USES= gettext-runtime python
|
|
||||||
PYTHON_USES_OFF= python:build,test
|
|
||||||
PYTHON_CONFIGURE_OFF= --disable-python
|
|
||||||
|
|
||||||
MANPAGES_CONFIGURE_ENV_OFF+= XSLTPROC="true"
|
|
||||||
MANPAGES_BUILD_DEPENDS+= ${LOCALBASE}/share/xsl/docbook/manpages/docbook.xsl:textproc/docbook-xsl \
|
|
||||||
xsltproc:textproc/libxslt
|
|
||||||
# No fancy color error messages
|
|
||||||
CFLAGS+= ${CFLAGS_${CHOSEN_COMPILER_TYPE}}
|
|
||||||
CFLAGS_clang= -fno-color-diagnostics
|
|
||||||
CONFIGURE_ENV+= NOCOLOR=yes
|
|
||||||
MAKE_ENV+= NOCOLOR=yes
|
|
||||||
# Some symbols in talloc's linker version scripts are not defined, but since the
|
|
||||||
# scripts are generated dynamically, suppress errors with lld >= 17 due to these
|
|
||||||
# undefined symbols.
|
|
||||||
LDFLAGS+= -Wl,--undefined-version
|
|
||||||
|
|
||||||
CONFLICTS_INSTALL= talloc
|
|
||||||
|
|
||||||
post-patch:
|
|
||||||
@${REINPLACE_CMD} -e 's|%%PKGCONFIGDIR%%|${PKGCONFIGDIR}|g' \
|
|
||||||
${BUILD_WRKSRC}/wscript
|
|
||||||
|
|
||||||
pre-build-MANPAGES-off:
|
|
||||||
-${MKDIR} ${BUILD_WRKSRC}/bin/default/man
|
|
||||||
${INSTALL_MAN} ${FILESDIR}/talloc.3 ${BUILD_WRKSRC}/bin/default/man
|
|
||||||
|
|
||||||
post-install:
|
|
||||||
${STRIP_CMD} ${STAGEDIR}${PREFIX}/lib/libtalloc.so.2
|
|
||||||
|
|
||||||
post-install-PYTHON-on:
|
|
||||||
${STRIP_CMD} ${STAGEDIR}${PREFIX}/lib/libpytalloc-util*.so
|
|
||||||
${STRIP_CMD} ${STAGEDIR}${PYTHONPREFIX_SITELIBDIR}/talloc*.so
|
|
||||||
|
|
||||||
.include <bsd.port.mk>
|
|
||||||
@ -1,3 +0,0 @@
|
|||||||
TIMESTAMP = 1737641773
|
|
||||||
SHA256 (talloc-2.4.2.tar.gz) = 85ecf9e465e20f98f9950a52e9a411e14320bc555fa257d87697b7e7a9b1d8a6
|
|
||||||
SIZE (talloc-2.4.2.tar.gz) = 679750
|
|
||||||
@ -1,35 +0,0 @@
|
|||||||
--- buildtools/wafsamba/samba_autoconf.py.orig 2019-09-03 13:59:55 UTC
|
|
||||||
+++ buildtools/wafsamba/samba_autoconf.py
|
|
||||||
@@ -573,7 +573,7 @@ def library_flags(self, libs):
|
|
||||||
|
|
||||||
|
|
||||||
@conf
|
|
||||||
-def CHECK_LIB(conf, libs, mandatory=False, empty_decl=True, set_target=True, shlib=False):
|
|
||||||
+def CHECK_LIB(conf, libs, mandatory=False, empty_decl=True, set_target=True, shlib=False, msg=None):
|
|
||||||
'''check if a set of libraries exist as system libraries
|
|
||||||
|
|
||||||
returns the sublist of libs that do exist as a syslib or []
|
|
||||||
@@ -593,11 +593,14 @@ int foo()
|
|
||||||
ret.append(lib)
|
|
||||||
continue
|
|
||||||
|
|
||||||
+ if msg is None:
|
|
||||||
+ msg = 'Checking for library %s' % lib
|
|
||||||
+
|
|
||||||
(ccflags, ldflags, cpppath) = library_flags(conf, lib)
|
|
||||||
if shlib:
|
|
||||||
- res = conf.check(features='c cshlib', fragment=fragment, lib=lib, uselib_store=lib, cflags=ccflags, ldflags=ldflags, uselib=lib.upper(), mandatory=False)
|
|
||||||
+ res = conf.check(features='c cshlib', fragment=fragment, lib=lib, uselib_store=lib, cflags=ccflags, ldflags=ldflags, uselib=lib.upper(), mandatory=False, msg=msg)
|
|
||||||
else:
|
|
||||||
- res = conf.check(lib=lib, uselib_store=lib, cflags=ccflags, ldflags=ldflags, uselib=lib.upper(), mandatory=False)
|
|
||||||
+ res = conf.check(lib=lib, uselib_store=lib, cflags=ccflags, ldflags=ldflags, uselib=lib.upper(), mandatory=False, msg=msg)
|
|
||||||
|
|
||||||
if not res:
|
|
||||||
if mandatory:
|
|
||||||
@@ -944,5 +947,5 @@ def SAMBA_CHECK_UNDEFINED_SYMBOL_FLAGS(conf):
|
|
||||||
conf.env.undefined_ldflags = conf.ADD_LDFLAGS('-Wl,-no-undefined', testflags=True)
|
|
||||||
|
|
||||||
if (conf.env.undefined_ignore_ldflags == [] and
|
|
||||||
- conf.CHECK_LDFLAGS(['-undefined', 'dynamic_lookup'])):
|
|
||||||
+ conf.CHECK_LDFLAGS(['-undefined', 'dynamic_lookup'] + conf.env.WERROR_CFLAGS)):
|
|
||||||
conf.env.undefined_ignore_ldflags = ['-undefined', 'dynamic_lookup']
|
|
||||||
@ -1,11 +0,0 @@
|
|||||||
--- buildtools/wafsamba/samba_install.py.orig 2019-03-21 10:12:32 UTC
|
|
||||||
+++ buildtools/wafsamba/samba_install.py
|
|
||||||
@@ -115,7 +115,7 @@ def install_library(self):
|
|
||||||
inst_name = bld.make_libname(t.target)
|
|
||||||
elif self.vnum:
|
|
||||||
vnum_base = self.vnum.split('.')[0]
|
|
||||||
- install_name = bld.make_libname(target_name, version=self.vnum)
|
|
||||||
+ install_name = bld.make_libname(target_name, version=vnum_base)
|
|
||||||
install_link = bld.make_libname(target_name, version=vnum_base)
|
|
||||||
inst_name = bld.make_libname(t.target)
|
|
||||||
if not self.private_library or not t.env.SONAME_ST:
|
|
||||||
@ -1,15 +0,0 @@
|
|||||||
--- buildtools/wafsamba/wscript.orig 2019-03-21 10:12:32 UTC
|
|
||||||
+++ buildtools/wafsamba/wscript
|
|
||||||
@@ -82,10 +82,10 @@ def options(opt):
|
|
||||||
|
|
||||||
opt.add_option('--with-libiconv',
|
|
||||||
help='additional directory to search for libiconv',
|
|
||||||
- action='store', dest='iconv_open', default='/usr/local',
|
|
||||||
+ action='store', dest='iconv_open', default=None,
|
|
||||||
match = ['Checking for library iconv', 'Checking for iconv_open', 'Checking for header iconv.h'])
|
|
||||||
opt.add_option('--without-gettext',
|
|
||||||
- help=("Disable use of gettext"),
|
|
||||||
+ help=("disable use of gettext"),
|
|
||||||
action="store_true", dest='disable_gettext', default=False)
|
|
||||||
|
|
||||||
gr = opt.option_group('developer options')
|
|
||||||
@ -1,11 +0,0 @@
|
|||||||
--- lib/replace/wscript.orig 2019-03-21 10:12:32 UTC
|
|
||||||
+++ lib/replace/wscript
|
|
||||||
@@ -119,7 +119,7 @@ def configure(conf):
|
|
||||||
conf.CHECK_HEADERS('sys/atomic.h stdatomic.h')
|
|
||||||
conf.CHECK_HEADERS('libgen.h')
|
|
||||||
|
|
||||||
- if conf.CHECK_CFLAGS('-Wno-format-truncation'):
|
|
||||||
+ if conf.CHECK_CFLAGS(['-Wno-format-truncation'] + conf.env.WERROR_CFLAGS):
|
|
||||||
conf.define('HAVE_WNO_FORMAT_TRUNCATION', '1')
|
|
||||||
|
|
||||||
if conf.CHECK_CFLAGS('-Wno-unused-function'):
|
|
||||||
@ -1,20 +0,0 @@
|
|||||||
--- talloc.c.orig 2019-03-21 10:12:32 UTC
|
|
||||||
+++ talloc.c
|
|
||||||
@@ -396,6 +396,9 @@ void talloc_lib_init(void) __attribute__
|
|
||||||
void talloc_lib_init(void)
|
|
||||||
{
|
|
||||||
uint32_t random_value;
|
|
||||||
+#if defined(HAVE_ARC4RANDOM)
|
|
||||||
+ random_value = arc4random();
|
|
||||||
+#else
|
|
||||||
#if defined(HAVE_GETAUXVAL) && defined(AT_RANDOM)
|
|
||||||
uint8_t *p;
|
|
||||||
/*
|
|
||||||
@@ -429,6 +432,7 @@ void talloc_lib_init(void)
|
|
||||||
*/
|
|
||||||
random_value = ((uintptr_t)talloc_lib_init & 0xFFFFFFFF);
|
|
||||||
}
|
|
||||||
+#endif /* HAVE_ARC4RANDOM */
|
|
||||||
talloc_magic = random_value & ~TALLOC_FLAG_MASK;
|
|
||||||
}
|
|
||||||
#else
|
|
||||||
@ -1,18 +0,0 @@
|
|||||||
--- wscript.orig 2019-03-21 10:12:32 UTC
|
|
||||||
+++ wscript
|
|
||||||
@@ -45,13 +45,14 @@ def configure(conf):
|
|
||||||
conf.env.TALLOC_COMPAT1 = False
|
|
||||||
if conf.env.standalone_talloc:
|
|
||||||
conf.env.TALLOC_COMPAT1 = Options.options.TALLOC_COMPAT1
|
|
||||||
- conf.env.PKGCONFIGDIR = '${LIBDIR}/pkgconfig'
|
|
||||||
+ conf.env.PKGCONFIGDIR = '%%PKGCONFIGDIR%%'
|
|
||||||
conf.env.TALLOC_VERSION = VERSION
|
|
||||||
|
|
||||||
conf.CHECK_XSLTPROC_MANPAGES()
|
|
||||||
|
|
||||||
conf.CHECK_HEADERS('sys/auxv.h')
|
|
||||||
conf.CHECK_FUNCS('getauxval')
|
|
||||||
+ conf.CHECK_FUNCS('arc4random')
|
|
||||||
|
|
||||||
conf.SAMBA_CONFIG_H()
|
|
||||||
|
|
||||||
@ -1,677 +0,0 @@
|
|||||||
'\" t
|
|
||||||
.\" Title: talloc
|
|
||||||
.\" Author: [see the "AUTHOR" section]
|
|
||||||
.\" Generator: DocBook XSL Stylesheets v1.79.1 <http://docbook.sf.net/>
|
|
||||||
.\" Date: 2015-04-10
|
|
||||||
.\" Manual: System Administration tools
|
|
||||||
.\" Source: Samba 4.0
|
|
||||||
.\" Language: English
|
|
||||||
.\"
|
|
||||||
.TH "TALLOC" "3" "2015\-04\-10" "Samba 4\&.0" "System Administration tools"
|
|
||||||
.\" -----------------------------------------------------------------
|
|
||||||
.\" * Define some portability stuff
|
|
||||||
.\" -----------------------------------------------------------------
|
|
||||||
.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
|
||||||
.\" http://bugs.debian.org/507673
|
|
||||||
.\" http://lists.gnu.org/archive/html/groff/2009-02/msg00013.html
|
|
||||||
.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
|
||||||
.ie \n(.g .ds Aq \(aq
|
|
||||||
.el .ds Aq '
|
|
||||||
.\" -----------------------------------------------------------------
|
|
||||||
.\" * set default formatting
|
|
||||||
.\" -----------------------------------------------------------------
|
|
||||||
.\" disable hyphenation
|
|
||||||
.nh
|
|
||||||
.\" disable justification (adjust text to left margin only)
|
|
||||||
.ad l
|
|
||||||
.\" -----------------------------------------------------------------
|
|
||||||
.\" * MAIN CONTENT STARTS HERE *
|
|
||||||
.\" -----------------------------------------------------------------
|
|
||||||
.SH "NAME"
|
|
||||||
talloc \- hierarchical reference counted memory pool system with destructors
|
|
||||||
.SH "SYNOPSIS"
|
|
||||||
.sp
|
|
||||||
.nf
|
|
||||||
#include <talloc\&.h>
|
|
||||||
.fi
|
|
||||||
.SH "DESCRIPTION"
|
|
||||||
.PP
|
|
||||||
If you are used to talloc from Samba3 then please read this carefully, as talloc has changed a lot\&.
|
|
||||||
.PP
|
|
||||||
The new talloc is a hierarchical, reference counted memory pool system with destructors\&. Quite a mouthful really, but not too bad once you get used to it\&.
|
|
||||||
.PP
|
|
||||||
Perhaps the biggest change from Samba3 is that there is no distinction between a "talloc context" and a "talloc pointer"\&. Any pointer returned from talloc() is itself a valid talloc context\&. This means you can do this:
|
|
||||||
.sp
|
|
||||||
.if n \{\
|
|
||||||
.RS 4
|
|
||||||
.\}
|
|
||||||
.nf
|
|
||||||
struct foo *X = talloc(mem_ctx, struct foo);
|
|
||||||
X\->name = talloc_strdup(X, "foo");
|
|
||||||
|
|
||||||
.fi
|
|
||||||
.if n \{\
|
|
||||||
.RE
|
|
||||||
.\}
|
|
||||||
.PP
|
|
||||||
and the pointer
|
|
||||||
X\->name
|
|
||||||
would be a "child" of the talloc context
|
|
||||||
X
|
|
||||||
which is itself a child of
|
|
||||||
mem_ctx\&. So if you do
|
|
||||||
talloc_free(mem_ctx)
|
|
||||||
then it is all destroyed, whereas if you do
|
|
||||||
talloc_free(X)
|
|
||||||
then just
|
|
||||||
X
|
|
||||||
and
|
|
||||||
X\->name
|
|
||||||
are destroyed, and if you do
|
|
||||||
talloc_free(X\->name)
|
|
||||||
then just the name element of
|
|
||||||
X
|
|
||||||
is destroyed\&.
|
|
||||||
.PP
|
|
||||||
If you think about this, then what this effectively gives you is an n\-ary tree, where you can free any part of the tree with talloc_free()\&.
|
|
||||||
.PP
|
|
||||||
If you find this confusing, then I suggest you run the
|
|
||||||
testsuite
|
|
||||||
program to watch talloc in action\&. You may also like to add your own tests to
|
|
||||||
testsuite\&.c
|
|
||||||
to clarify how some particular situation is handled\&.
|
|
||||||
.SH "TALLOC API"
|
|
||||||
.PP
|
|
||||||
The following is a complete guide to the talloc API\&. Read it all at least twice\&.
|
|
||||||
.SS "(type *)talloc(const void *ctx, type);"
|
|
||||||
.PP
|
|
||||||
The talloc() macro is the core of the talloc library\&. It takes a memory
|
|
||||||
\fIctx\fR
|
|
||||||
and a
|
|
||||||
\fItype\fR, and returns a pointer to a new area of memory of the given
|
|
||||||
\fItype\fR\&.
|
|
||||||
.PP
|
|
||||||
The returned pointer is itself a talloc context, so you can use it as the
|
|
||||||
\fIctx\fR
|
|
||||||
argument to more calls to talloc() if you wish\&.
|
|
||||||
.PP
|
|
||||||
The returned pointer is a "child" of the supplied context\&. This means that if you talloc_free() the
|
|
||||||
\fIctx\fR
|
|
||||||
then the new child disappears as well\&. Alternatively you can free just the child\&.
|
|
||||||
.PP
|
|
||||||
The
|
|
||||||
\fIctx\fR
|
|
||||||
argument to talloc() can be NULL, in which case a new top level context is created\&.
|
|
||||||
.SS "void *talloc_size(const void *ctx, size_t size);"
|
|
||||||
.PP
|
|
||||||
The function talloc_size() should be used when you don\*(Aqt have a convenient type to pass to talloc()\&. Unlike talloc(), it is not type safe (as it returns a void *), so you are on your own for type checking\&.
|
|
||||||
.SS "(typeof(ptr)) talloc_ptrtype(const void *ctx, ptr);"
|
|
||||||
.PP
|
|
||||||
The talloc_ptrtype() macro should be used when you have a pointer and want to allocate memory to point at with this pointer\&. When compiling with gcc >= 3 it is typesafe\&. Note this is a wrapper of talloc_size() and talloc_get_name() will return the current location in the source file\&. and not the type\&.
|
|
||||||
.SS "int talloc_free(void *ptr);"
|
|
||||||
.PP
|
|
||||||
The talloc_free() function frees a piece of talloc memory, and all its children\&. You can call talloc_free() on any pointer returned by talloc()\&.
|
|
||||||
.PP
|
|
||||||
The return value of talloc_free() indicates success or failure, with 0 returned for success and \-1 for failure\&. The only possible failure condition is if
|
|
||||||
\fIptr\fR
|
|
||||||
had a destructor attached to it and the destructor returned \-1\&. See
|
|
||||||
\(lqtalloc_set_destructor()\(rq
|
|
||||||
for details on destructors\&.
|
|
||||||
.PP
|
|
||||||
If this pointer has an additional parent when talloc_free() is called then the memory is not actually released, but instead the most recently established parent is destroyed\&. See
|
|
||||||
\(lqtalloc_reference()\(rq
|
|
||||||
for details on establishing additional parents\&.
|
|
||||||
.PP
|
|
||||||
For more control on which parent is removed, see
|
|
||||||
\(lqtalloc_unlink()\(rq\&.
|
|
||||||
.PP
|
|
||||||
talloc_free() operates recursively on its children\&.
|
|
||||||
.PP
|
|
||||||
From the 2\&.0 version of talloc, as a special case, talloc_free() is refused on pointers that have more than one parent, as talloc would have no way of knowing which parent should be removed\&. To free a pointer that has more than one parent please use talloc_unlink()\&.
|
|
||||||
.PP
|
|
||||||
To help you find problems in your code caused by this behaviour, if you do try and free a pointer with more than one parent then the talloc logging function will be called to give output like this:
|
|
||||||
.PP
|
|
||||||
.if n \{\
|
|
||||||
.RS 4
|
|
||||||
.\}
|
|
||||||
.nf
|
|
||||||
ERROR: talloc_free with references at some_dir/source/foo\&.c:123
|
|
||||||
reference at some_dir/source/other\&.c:325
|
|
||||||
reference at some_dir/source/third\&.c:121
|
|
||||||
|
|
||||||
.fi
|
|
||||||
.if n \{\
|
|
||||||
.RE
|
|
||||||
.\}
|
|
||||||
.PP
|
|
||||||
Please see the documentation for talloc_set_log_fn() and talloc_set_log_stderr() for more information on talloc logging functions\&.
|
|
||||||
.SS "void *talloc_reference(const void *ctx, const void *ptr);"
|
|
||||||
.PP
|
|
||||||
The talloc_reference() function makes
|
|
||||||
\fIctx\fR
|
|
||||||
an additional parent of
|
|
||||||
\fIptr\fR\&.
|
|
||||||
.PP
|
|
||||||
The return value of talloc_reference() is always the original pointer
|
|
||||||
\fIptr\fR, unless talloc ran out of memory in creating the reference in which case it will return NULL (each additional reference consumes around 48 bytes of memory on intel x86 platforms)\&.
|
|
||||||
.PP
|
|
||||||
If
|
|
||||||
\fIptr\fR
|
|
||||||
is NULL, then the function is a no\-op, and simply returns NULL\&.
|
|
||||||
.PP
|
|
||||||
After creating a reference you can free it in one of the following ways:
|
|
||||||
.PP
|
|
||||||
.RS 4
|
|
||||||
.ie n \{\
|
|
||||||
\h'-04'\(bu\h'+03'\c
|
|
||||||
.\}
|
|
||||||
.el \{\
|
|
||||||
.sp -1
|
|
||||||
.IP \(bu 2.3
|
|
||||||
.\}
|
|
||||||
you can talloc_free() any parent of the original pointer\&. That will reduce the number of parents of this pointer by 1, and will cause this pointer to be freed if it runs out of parents\&.
|
|
||||||
.RE
|
|
||||||
.sp
|
|
||||||
.RS 4
|
|
||||||
.ie n \{\
|
|
||||||
\h'-04'\(bu\h'+03'\c
|
|
||||||
.\}
|
|
||||||
.el \{\
|
|
||||||
.sp -1
|
|
||||||
.IP \(bu 2.3
|
|
||||||
.\}
|
|
||||||
you can talloc_free() the pointer itself if it has at maximum one parent\&. This behaviour has been changed since the release of version 2\&.0\&. Further informations in the description of "talloc_free"\&.
|
|
||||||
.RE
|
|
||||||
.PP
|
|
||||||
For more control on which parent to remove, see
|
|
||||||
\(lqtalloc_unlink()\(rq\&.
|
|
||||||
.SS "int talloc_unlink(const void *ctx, void *ptr);"
|
|
||||||
.PP
|
|
||||||
The talloc_unlink() function removes a specific parent from
|
|
||||||
\fIptr\fR\&. The
|
|
||||||
\fIctx\fR
|
|
||||||
passed must either be a context used in talloc_reference() with this pointer, or must be a direct parent of ptr\&.
|
|
||||||
.PP
|
|
||||||
Note that if the parent has already been removed using talloc_free() then this function will fail and will return \-1\&. Likewise, if
|
|
||||||
\fIptr\fR
|
|
||||||
is NULL, then the function will make no modifications and return \-1\&.
|
|
||||||
.PP
|
|
||||||
Usually you can just use talloc_free() instead of talloc_unlink(), but sometimes it is useful to have the additional control on which parent is removed\&.
|
|
||||||
.SS "void talloc_set_destructor(const void *ptr, int (*destructor)(void *));"
|
|
||||||
.PP
|
|
||||||
The function talloc_set_destructor() sets the
|
|
||||||
\fIdestructor\fR
|
|
||||||
for the pointer
|
|
||||||
\fIptr\fR\&. A
|
|
||||||
\fIdestructor\fR
|
|
||||||
is a function that is called when the memory used by a pointer is about to be released\&. The destructor receives
|
|
||||||
\fIptr\fR
|
|
||||||
as an argument, and should return 0 for success and \-1 for failure\&.
|
|
||||||
.PP
|
|
||||||
The
|
|
||||||
\fIdestructor\fR
|
|
||||||
can do anything it wants to, including freeing other pieces of memory\&. A common use for destructors is to clean up operating system resources (such as open file descriptors) contained in the structure the destructor is placed on\&.
|
|
||||||
.PP
|
|
||||||
You can only place one destructor on a pointer\&. If you need more than one destructor then you can create a zero\-length child of the pointer and place an additional destructor on that\&.
|
|
||||||
.PP
|
|
||||||
To remove a destructor call talloc_set_destructor() with NULL for the destructor\&.
|
|
||||||
.PP
|
|
||||||
If your destructor attempts to talloc_free() the pointer that it is the destructor for then talloc_free() will return \-1 and the free will be ignored\&. This would be a pointless operation anyway, as the destructor is only called when the memory is just about to go away\&.
|
|
||||||
.SS "int talloc_increase_ref_count(const void *\fIptr\fR);"
|
|
||||||
.PP
|
|
||||||
The talloc_increase_ref_count(\fIptr\fR) function is exactly equivalent to:
|
|
||||||
.sp
|
|
||||||
.if n \{\
|
|
||||||
.RS 4
|
|
||||||
.\}
|
|
||||||
.nf
|
|
||||||
talloc_reference(NULL, ptr);
|
|
||||||
.fi
|
|
||||||
.if n \{\
|
|
||||||
.RE
|
|
||||||
.\}
|
|
||||||
.PP
|
|
||||||
You can use either syntax, depending on which you think is clearer in your code\&.
|
|
||||||
.PP
|
|
||||||
It returns 0 on success and \-1 on failure\&.
|
|
||||||
.SS "size_t talloc_reference_count(const void *\fIptr\fR);"
|
|
||||||
.PP
|
|
||||||
Return the number of references to the pointer\&.
|
|
||||||
.SS "void talloc_set_name(const void *ptr, const char *fmt, \&.\&.\&.);"
|
|
||||||
.PP
|
|
||||||
Each talloc pointer has a "name"\&. The name is used principally for debugging purposes, although it is also possible to set and get the name on a pointer in as a way of "marking" pointers in your code\&.
|
|
||||||
.PP
|
|
||||||
The main use for names on pointer is for "talloc reports"\&. See
|
|
||||||
\(lqtalloc_report_depth_cb()\(rq,
|
|
||||||
\(lqtalloc_report_depth_file()\(rq,
|
|
||||||
\(lqtalloc_report()\(rq
|
|
||||||
\(lqtalloc_report()\(rq
|
|
||||||
and
|
|
||||||
\(lqtalloc_report_full()\(rq
|
|
||||||
for details\&. Also see
|
|
||||||
\(lqtalloc_enable_leak_report()\(rq
|
|
||||||
and
|
|
||||||
\(lqtalloc_enable_leak_report_full()\(rq\&.
|
|
||||||
.PP
|
|
||||||
The talloc_set_name() function allocates memory as a child of the pointer\&. It is logically equivalent to:
|
|
||||||
.sp
|
|
||||||
.if n \{\
|
|
||||||
.RS 4
|
|
||||||
.\}
|
|
||||||
.nf
|
|
||||||
talloc_set_name_const(ptr, talloc_asprintf(ptr, fmt, \&.\&.\&.));
|
|
||||||
.fi
|
|
||||||
.if n \{\
|
|
||||||
.RE
|
|
||||||
.\}
|
|
||||||
.PP
|
|
||||||
Note that multiple calls to talloc_set_name() will allocate more memory without releasing the name\&. All of the memory is released when the ptr is freed using talloc_free()\&.
|
|
||||||
.SS "void talloc_set_name_const(const void *\fIptr\fR, const char *\fIname\fR);"
|
|
||||||
.PP
|
|
||||||
The function talloc_set_name_const() is just like talloc_set_name(), but it takes a string constant, and is much faster\&. It is extensively used by the "auto naming" macros, such as talloc_p()\&.
|
|
||||||
.PP
|
|
||||||
This function does not allocate any memory\&. It just copies the supplied pointer into the internal representation of the talloc ptr\&. This means you must not pass a
|
|
||||||
\fIname\fR
|
|
||||||
pointer to memory that will disappear before
|
|
||||||
\fIptr\fR
|
|
||||||
is freed with talloc_free()\&.
|
|
||||||
.SS "void *talloc_named(const void *\fIctx\fR, size_t \fIsize\fR, const char *\fIfmt\fR, \&.\&.\&.);"
|
|
||||||
.PP
|
|
||||||
The talloc_named() function creates a named talloc pointer\&. It is equivalent to:
|
|
||||||
.sp
|
|
||||||
.if n \{\
|
|
||||||
.RS 4
|
|
||||||
.\}
|
|
||||||
.nf
|
|
||||||
ptr = talloc_size(ctx, size);
|
|
||||||
talloc_set_name(ptr, fmt, \&.\&.\&.\&.);
|
|
||||||
.fi
|
|
||||||
.if n \{\
|
|
||||||
.RE
|
|
||||||
.\}
|
|
||||||
.SS "void *talloc_named_const(const void *\fIctx\fR, size_t \fIsize\fR, const char *\fIname\fR);"
|
|
||||||
.PP
|
|
||||||
This is equivalent to:
|
|
||||||
.sp
|
|
||||||
.if n \{\
|
|
||||||
.RS 4
|
|
||||||
.\}
|
|
||||||
.nf
|
|
||||||
ptr = talloc_size(ctx, size);
|
|
||||||
talloc_set_name_const(ptr, name);
|
|
||||||
.fi
|
|
||||||
.if n \{\
|
|
||||||
.RE
|
|
||||||
.\}
|
|
||||||
.SS "const char *talloc_get_name(const void *\fIptr\fR);"
|
|
||||||
.PP
|
|
||||||
This returns the current name for the given talloc pointer,
|
|
||||||
\fIptr\fR\&. See
|
|
||||||
\(lqtalloc_set_name()\(rq
|
|
||||||
for details\&.
|
|
||||||
.SS "void *talloc_init(const char *\fIfmt\fR, \&.\&.\&.);"
|
|
||||||
.PP
|
|
||||||
This function creates a zero length named talloc context as a top level context\&. It is equivalent to:
|
|
||||||
.sp
|
|
||||||
.if n \{\
|
|
||||||
.RS 4
|
|
||||||
.\}
|
|
||||||
.nf
|
|
||||||
talloc_named(NULL, 0, fmt, \&.\&.\&.);
|
|
||||||
.fi
|
|
||||||
.if n \{\
|
|
||||||
.RE
|
|
||||||
.\}
|
|
||||||
.SS "void *talloc_new(void *\fIctx\fR);"
|
|
||||||
.PP
|
|
||||||
This is a utility macro that creates a new memory context hanging off an existing context, automatically naming it "talloc_new: __location__" where __location__ is the source line it is called from\&. It is particularly useful for creating a new temporary working context\&.
|
|
||||||
.SS "(\fItype\fR *)talloc_realloc(const void *\fIctx\fR, void *\fIptr\fR, \fItype\fR, \fIcount\fR);"
|
|
||||||
.PP
|
|
||||||
The talloc_realloc() macro changes the size of a talloc pointer\&. It has the following equivalences:
|
|
||||||
.sp
|
|
||||||
.if n \{\
|
|
||||||
.RS 4
|
|
||||||
.\}
|
|
||||||
.nf
|
|
||||||
talloc_realloc(ctx, NULL, type, 1) ==> talloc(ctx, type);
|
|
||||||
talloc_realloc(ctx, ptr, type, 0) ==> talloc_free(ptr);
|
|
||||||
.fi
|
|
||||||
.if n \{\
|
|
||||||
.RE
|
|
||||||
.\}
|
|
||||||
.PP
|
|
||||||
The
|
|
||||||
\fIctx\fR
|
|
||||||
argument is only used if
|
|
||||||
\fIptr\fR
|
|
||||||
is not NULL, otherwise it is ignored\&.
|
|
||||||
.PP
|
|
||||||
talloc_realloc() returns the new pointer, or NULL on failure\&. The call will fail either due to a lack of memory, or because the pointer has more than one parent (see
|
|
||||||
\(lqtalloc_reference()\(rq)\&.
|
|
||||||
.SS "void *talloc_realloc_size(const void *ctx, void *ptr, size_t size);"
|
|
||||||
.PP
|
|
||||||
the talloc_realloc_size() function is useful when the type is not known so the type\-safe talloc_realloc() cannot be used\&.
|
|
||||||
.SS "TYPE *talloc_steal(const void *\fInew_ctx\fR, const TYPE *\fIptr\fR);"
|
|
||||||
.PP
|
|
||||||
The talloc_steal() function changes the parent context of a talloc pointer\&. It is typically used when the context that the pointer is currently a child of is going to be freed and you wish to keep the memory for a longer time\&.
|
|
||||||
.PP
|
|
||||||
The talloc_steal() function returns the pointer that you pass it\&. It does not have any failure modes\&.
|
|
||||||
.PP
|
|
||||||
It is possible to produce loops in the parent/child relationship if you are not careful with talloc_steal()\&. No guarantees are provided as to your sanity or the safety of your data if you do this\&.
|
|
||||||
.PP
|
|
||||||
Note that if you try and call talloc_steal() on a pointer that has more than one parent then the result is ambiguous\&. Talloc will choose to remove the parent that is currently indicated by talloc_parent() and replace it with the chosen parent\&. You will also get a message like this via the talloc logging functions:
|
|
||||||
.PP
|
|
||||||
.if n \{\
|
|
||||||
.RS 4
|
|
||||||
.\}
|
|
||||||
.nf
|
|
||||||
WARNING: talloc_steal with references at some_dir/source/foo\&.c:123
|
|
||||||
reference at some_dir/source/other\&.c:325
|
|
||||||
reference at some_dir/source/third\&.c:121
|
|
||||||
|
|
||||||
.fi
|
|
||||||
.if n \{\
|
|
||||||
.RE
|
|
||||||
.\}
|
|
||||||
.PP
|
|
||||||
To unambiguously change the parent of a pointer please see the function
|
|
||||||
\(lqtalloc_reparent()\(rq\&. See the talloc_set_log_fn() documentation for more information on talloc logging\&.
|
|
||||||
.SS "TYPE *talloc_reparent(const void *\fIold_parent\fR, const void *\fInew_parent\fR, const TYPE *\fIptr\fR);"
|
|
||||||
.PP
|
|
||||||
The talloc_reparent() function changes the parent context of a talloc pointer\&. It is typically used when the context that the pointer is currently a child of is going to be freed and you wish to keep the memory for a longer time\&.
|
|
||||||
.PP
|
|
||||||
The talloc_reparent() function returns the pointer that you pass it\&. It does not have any failure modes\&.
|
|
||||||
.PP
|
|
||||||
The difference between talloc_reparent() and talloc_steal() is that talloc_reparent() can specify which parent you wish to change\&. This is useful when a pointer has multiple parents via references\&.
|
|
||||||
.SS "TYPE *talloc_move(const void *\fInew_ctx\fR, TYPE **\fIptr\fR);"
|
|
||||||
.PP
|
|
||||||
The talloc_move() function is a wrapper around talloc_steal() which zeros the source pointer after the move\&. This avoids a potential source of bugs where a programmer leaves a pointer in two structures, and uses the pointer from the old structure after it has been moved to a new one\&.
|
|
||||||
.SS "size_t talloc_total_size(const void *\fIptr\fR);"
|
|
||||||
.PP
|
|
||||||
The talloc_total_size() function returns the total size in bytes used by this pointer and all child pointers\&. Mostly useful for debugging\&.
|
|
||||||
.PP
|
|
||||||
Passing NULL is allowed, but it will only give a meaningful result if talloc_enable_leak_report() or talloc_enable_leak_report_full() has been called\&.
|
|
||||||
.SS "size_t talloc_total_blocks(const void *\fIptr\fR);"
|
|
||||||
.PP
|
|
||||||
The talloc_total_blocks() function returns the total memory block count used by this pointer and all child pointers\&. Mostly useful for debugging\&.
|
|
||||||
.PP
|
|
||||||
Passing NULL is allowed, but it will only give a meaningful result if talloc_enable_leak_report() or talloc_enable_leak_report_full() has been called\&.
|
|
||||||
.SS "void talloc_report(const void *ptr, FILE *f);"
|
|
||||||
.PP
|
|
||||||
The talloc_report() function prints a summary report of all memory used by
|
|
||||||
\fIptr\fR\&. One line of report is printed for each immediate child of ptr, showing the total memory and number of blocks used by that child\&.
|
|
||||||
.PP
|
|
||||||
You can pass NULL for the pointer, in which case a report is printed for the top level memory context, but only if talloc_enable_leak_report() or talloc_enable_leak_report_full() has been called\&.
|
|
||||||
.SS "void talloc_report_full(const void *\fIptr\fR, FILE *\fIf\fR);"
|
|
||||||
.PP
|
|
||||||
This provides a more detailed report than talloc_report()\&. It will recursively print the entire tree of memory referenced by the pointer\&. References in the tree are shown by giving the name of the pointer that is referenced\&.
|
|
||||||
.PP
|
|
||||||
You can pass NULL for the pointer, in which case a report is printed for the top level memory context, but only if talloc_enable_leak_report() or talloc_enable_leak_report_full() has been called\&.
|
|
||||||
.SS ""
|
|
||||||
.HP \w'void\ talloc_report_depth_cb('u
|
|
||||||
.BI "void talloc_report_depth_cb(" "const\ void\ *ptr" ", " "int\ depth" ", " "int\ max_depth" ", " "void\ (*callback)(const\ void\ *ptr,\ int\ depth,\ int\ max_depth,\ int\ is_ref,\ void\ *priv)" ", " "void\ *priv" ");"
|
|
||||||
.PP
|
|
||||||
This provides a more flexible reports than talloc_report()\&. It will recursively call the callback for the entire tree of memory referenced by the pointer\&. References in the tree are passed with
|
|
||||||
\fIis_ref = 1\fR
|
|
||||||
and the pointer that is referenced\&.
|
|
||||||
.PP
|
|
||||||
You can pass NULL for the pointer, in which case a report is printed for the top level memory context, but only if talloc_enable_leak_report() or talloc_enable_leak_report_full() has been called\&.
|
|
||||||
.PP
|
|
||||||
The recursion is stopped when depth >= max_depth\&. max_depth = \-1 means only stop at leaf nodes\&.
|
|
||||||
.SS ""
|
|
||||||
.HP \w'void\ talloc_report_depth_file('u
|
|
||||||
.BI "void talloc_report_depth_file(" "const\ void\ *ptr" ", " "int\ depth" ", " "int\ max_depth" ", " "FILE\ *f" ");"
|
|
||||||
.PP
|
|
||||||
This provides a more flexible reports than talloc_report()\&. It will let you specify the depth and max_depth\&.
|
|
||||||
.SS "void talloc_enable_leak_report(void);"
|
|
||||||
.PP
|
|
||||||
This enables calling of talloc_report(NULL, stderr) when the program exits\&. In Samba4 this is enabled by using the \-\-leak\-report command line option\&.
|
|
||||||
.PP
|
|
||||||
For it to be useful, this function must be called before any other talloc function as it establishes a "null context" that acts as the top of the tree\&. If you don\*(Aqt call this function first then passing NULL to talloc_report() or talloc_report_full() won\*(Aqt give you the full tree printout\&.
|
|
||||||
.PP
|
|
||||||
Here is a typical talloc report:
|
|
||||||
.sp
|
|
||||||
.if n \{\
|
|
||||||
.RS 4
|
|
||||||
.\}
|
|
||||||
.nf
|
|
||||||
talloc report on \*(Aqnull_context\*(Aq (total 267 bytes in 15 blocks)
|
|
||||||
libcli/auth/spnego_parse\&.c:55 contains 31 bytes in 2 blocks
|
|
||||||
libcli/auth/spnego_parse\&.c:55 contains 31 bytes in 2 blocks
|
|
||||||
iconv(UTF8,CP850) contains 42 bytes in 2 blocks
|
|
||||||
libcli/auth/spnego_parse\&.c:55 contains 31 bytes in 2 blocks
|
|
||||||
iconv(CP850,UTF8) contains 42 bytes in 2 blocks
|
|
||||||
iconv(UTF8,UTF\-16LE) contains 45 bytes in 2 blocks
|
|
||||||
iconv(UTF\-16LE,UTF8) contains 45 bytes in 2 blocks
|
|
||||||
|
|
||||||
.fi
|
|
||||||
.if n \{\
|
|
||||||
.RE
|
|
||||||
.\}
|
|
||||||
.SS "void talloc_enable_leak_report_full(void);"
|
|
||||||
.PP
|
|
||||||
This enables calling of talloc_report_full(NULL, stderr) when the program exits\&. In Samba4 this is enabled by using the \-\-leak\-report\-full command line option\&.
|
|
||||||
.PP
|
|
||||||
For it to be useful, this function must be called before any other talloc function as it establishes a "null context" that acts as the top of the tree\&. If you don\*(Aqt call this function first then passing NULL to talloc_report() or talloc_report_full() won\*(Aqt give you the full tree printout\&.
|
|
||||||
.PP
|
|
||||||
Here is a typical full report:
|
|
||||||
.sp
|
|
||||||
.if n \{\
|
|
||||||
.RS 4
|
|
||||||
.\}
|
|
||||||
.nf
|
|
||||||
full talloc report on \*(Aqroot\*(Aq (total 18 bytes in 8 blocks)
|
|
||||||
p1 contains 18 bytes in 7 blocks (ref 0)
|
|
||||||
r1 contains 13 bytes in 2 blocks (ref 0)
|
|
||||||
reference to: p2
|
|
||||||
p2 contains 1 bytes in 1 blocks (ref 1)
|
|
||||||
x3 contains 1 bytes in 1 blocks (ref 0)
|
|
||||||
x2 contains 1 bytes in 1 blocks (ref 0)
|
|
||||||
x1 contains 1 bytes in 1 blocks (ref 0)
|
|
||||||
|
|
||||||
.fi
|
|
||||||
.if n \{\
|
|
||||||
.RE
|
|
||||||
.\}
|
|
||||||
.SS "(\fItype\fR *)talloc_zero(const void *\fIctx\fR, \fItype\fR);"
|
|
||||||
.PP
|
|
||||||
The talloc_zero() macro is equivalent to:
|
|
||||||
.sp
|
|
||||||
.if n \{\
|
|
||||||
.RS 4
|
|
||||||
.\}
|
|
||||||
.nf
|
|
||||||
ptr = talloc(ctx, type);
|
|
||||||
if (ptr) memset(ptr, 0, sizeof(type));
|
|
||||||
.fi
|
|
||||||
.if n \{\
|
|
||||||
.RE
|
|
||||||
.\}
|
|
||||||
.SS "void *talloc_zero_size(const void *\fIctx\fR, size_t \fIsize\fR)"
|
|
||||||
.PP
|
|
||||||
The talloc_zero_size() function is useful when you don\*(Aqt have a known type\&.
|
|
||||||
.SS "void *talloc_memdup(const void *\fIctx\fR, const void *\fIp\fR, size_t size);"
|
|
||||||
.PP
|
|
||||||
The talloc_memdup() function is equivalent to:
|
|
||||||
.sp
|
|
||||||
.if n \{\
|
|
||||||
.RS 4
|
|
||||||
.\}
|
|
||||||
.nf
|
|
||||||
ptr = talloc_size(ctx, size);
|
|
||||||
if (ptr) memcpy(ptr, p, size);
|
|
||||||
.fi
|
|
||||||
.if n \{\
|
|
||||||
.RE
|
|
||||||
.\}
|
|
||||||
.SS "char *talloc_strdup(const void *\fIctx\fR, const char *\fIp\fR);"
|
|
||||||
.PP
|
|
||||||
The talloc_strdup() function is equivalent to:
|
|
||||||
.sp
|
|
||||||
.if n \{\
|
|
||||||
.RS 4
|
|
||||||
.\}
|
|
||||||
.nf
|
|
||||||
ptr = talloc_size(ctx, strlen(p)+1);
|
|
||||||
if (ptr) memcpy(ptr, p, strlen(p)+1);
|
|
||||||
.fi
|
|
||||||
.if n \{\
|
|
||||||
.RE
|
|
||||||
.\}
|
|
||||||
.PP
|
|
||||||
This function sets the name of the new pointer to the passed string\&. This is equivalent to:
|
|
||||||
.sp
|
|
||||||
.if n \{\
|
|
||||||
.RS 4
|
|
||||||
.\}
|
|
||||||
.nf
|
|
||||||
talloc_set_name_const(ptr, ptr)
|
|
||||||
.fi
|
|
||||||
.if n \{\
|
|
||||||
.RE
|
|
||||||
.\}
|
|
||||||
.SS "char *talloc_strndup(const void *\fIt\fR, const char *\fIp\fR, size_t \fIn\fR);"
|
|
||||||
.PP
|
|
||||||
The talloc_strndup() function is the talloc equivalent of the C library function strndup(3)\&.
|
|
||||||
.PP
|
|
||||||
This function sets the name of the new pointer to the passed string\&. This is equivalent to:
|
|
||||||
.sp
|
|
||||||
.if n \{\
|
|
||||||
.RS 4
|
|
||||||
.\}
|
|
||||||
.nf
|
|
||||||
talloc_set_name_const(ptr, ptr)
|
|
||||||
.fi
|
|
||||||
.if n \{\
|
|
||||||
.RE
|
|
||||||
.\}
|
|
||||||
.SS "char *talloc_vasprintf(const void *\fIt\fR, const char *\fIfmt\fR, va_list \fIap\fR);"
|
|
||||||
.PP
|
|
||||||
The talloc_vasprintf() function is the talloc equivalent of the C library function vasprintf(3)\&.
|
|
||||||
.PP
|
|
||||||
This function sets the name of the new pointer to the new string\&. This is equivalent to:
|
|
||||||
.sp
|
|
||||||
.if n \{\
|
|
||||||
.RS 4
|
|
||||||
.\}
|
|
||||||
.nf
|
|
||||||
talloc_set_name_const(ptr, ptr)
|
|
||||||
.fi
|
|
||||||
.if n \{\
|
|
||||||
.RE
|
|
||||||
.\}
|
|
||||||
.SS "char *talloc_asprintf(const void *\fIt\fR, const char *\fIfmt\fR, \&.\&.\&.);"
|
|
||||||
.PP
|
|
||||||
The talloc_asprintf() function is the talloc equivalent of the C library function asprintf(3)\&.
|
|
||||||
.PP
|
|
||||||
This function sets the name of the new pointer to the passed string\&. This is equivalent to:
|
|
||||||
.sp
|
|
||||||
.if n \{\
|
|
||||||
.RS 4
|
|
||||||
.\}
|
|
||||||
.nf
|
|
||||||
talloc_set_name_const(ptr, ptr)
|
|
||||||
.fi
|
|
||||||
.if n \{\
|
|
||||||
.RE
|
|
||||||
.\}
|
|
||||||
.SS "char *talloc_asprintf_append(char *s, const char *fmt, \&.\&.\&.);"
|
|
||||||
.PP
|
|
||||||
The talloc_asprintf_append() function appends the given formatted string to the given string\&.
|
|
||||||
.PP
|
|
||||||
This function sets the name of the new pointer to the new string\&. This is equivalent to:
|
|
||||||
.sp
|
|
||||||
.if n \{\
|
|
||||||
.RS 4
|
|
||||||
.\}
|
|
||||||
.nf
|
|
||||||
talloc_set_name_const(ptr, ptr)
|
|
||||||
.fi
|
|
||||||
.if n \{\
|
|
||||||
.RE
|
|
||||||
.\}
|
|
||||||
.SS "(type *)talloc_array(const void *ctx, type, unsigned int count);"
|
|
||||||
.PP
|
|
||||||
The talloc_array() macro is equivalent to:
|
|
||||||
.sp
|
|
||||||
.if n \{\
|
|
||||||
.RS 4
|
|
||||||
.\}
|
|
||||||
.nf
|
|
||||||
(type *)talloc_size(ctx, sizeof(type) * count);
|
|
||||||
.fi
|
|
||||||
.if n \{\
|
|
||||||
.RE
|
|
||||||
.\}
|
|
||||||
.PP
|
|
||||||
except that it provides integer overflow protection for the multiply, returning NULL if the multiply overflows\&.
|
|
||||||
.SS "void *talloc_array_size(const void *ctx, size_t size, unsigned int count);"
|
|
||||||
.PP
|
|
||||||
The talloc_array_size() function is useful when the type is not known\&. It operates in the same way as talloc_array(), but takes a size instead of a type\&.
|
|
||||||
.SS "(typeof(ptr)) talloc_array_ptrtype(const void *ctx, ptr, unsigned int count);"
|
|
||||||
.PP
|
|
||||||
The talloc_ptrtype() macro should be used when you have a pointer to an array and want to allocate memory of an array to point at with this pointer\&. When compiling with gcc >= 3 it is typesafe\&. Note this is a wrapper of talloc_array_size() and talloc_get_name() will return the current location in the source file\&. and not the type\&.
|
|
||||||
.SS "void *talloc_realloc_fn(const void *ctx, void *ptr, size_t size)"
|
|
||||||
.PP
|
|
||||||
This is a non\-macro version of talloc_realloc(), which is useful as libraries sometimes want a realloc function pointer\&. A realloc(3) implementation encapsulates the functionality of malloc(3), free(3) and realloc(3) in one call, which is why it is useful to be able to pass around a single function pointer\&.
|
|
||||||
.SS "void *talloc_autofree_context(void);"
|
|
||||||
.PP
|
|
||||||
This is a handy utility function that returns a talloc context which will be automatically freed on program exit\&. This can be used to reduce the noise in memory leak reports\&.
|
|
||||||
.SS "void *talloc_check_name(const void *ptr, const char *name);"
|
|
||||||
.PP
|
|
||||||
This function checks if a pointer has the specified
|
|
||||||
\fIname\fR\&. If it does then the pointer is returned\&. It it doesn\*(Aqt then NULL is returned\&.
|
|
||||||
.SS "(type *)talloc_get_type(const void *ptr, type);"
|
|
||||||
.PP
|
|
||||||
This macro allows you to do type checking on talloc pointers\&. It is particularly useful for void* private pointers\&. It is equivalent to this:
|
|
||||||
.sp
|
|
||||||
.if n \{\
|
|
||||||
.RS 4
|
|
||||||
.\}
|
|
||||||
.nf
|
|
||||||
(type *)talloc_check_name(ptr, #type)
|
|
||||||
.fi
|
|
||||||
.if n \{\
|
|
||||||
.RE
|
|
||||||
.\}
|
|
||||||
.SS "talloc_set_type(const void *ptr, type);"
|
|
||||||
.PP
|
|
||||||
This macro allows you to force the name of a pointer to be a particular
|
|
||||||
\fItype\fR\&. This can be used in conjunction with talloc_get_type() to do type checking on void* pointers\&.
|
|
||||||
.PP
|
|
||||||
It is equivalent to this:
|
|
||||||
.sp
|
|
||||||
.if n \{\
|
|
||||||
.RS 4
|
|
||||||
.\}
|
|
||||||
.nf
|
|
||||||
talloc_set_name_const(ptr, #type)
|
|
||||||
.fi
|
|
||||||
.if n \{\
|
|
||||||
.RE
|
|
||||||
.\}
|
|
||||||
.SS "talloc_set_log_fn(void (*log_fn)(const char *message));"
|
|
||||||
.PP
|
|
||||||
This function sets a logging function that talloc will use for warnings and errors\&. By default talloc will not print any warnings or errors\&.
|
|
||||||
.SS "talloc_set_log_stderr(void);"
|
|
||||||
.PP
|
|
||||||
This sets the talloc log function to write log messages to stderr
|
|
||||||
.SH "PERFORMANCE"
|
|
||||||
.PP
|
|
||||||
All the additional features of talloc(3) over malloc(3) do come at a price\&. We have a simple performance test in Samba4 that measures talloc() versus malloc() performance, and it seems that talloc() is about 10% slower than malloc() on my x86 Debian Linux box\&. For Samba, the great reduction in code complexity that we get by using talloc makes this worthwhile, especially as the total overhead of talloc/malloc in Samba is already quite small\&.
|
|
||||||
.SH "SEE ALSO"
|
|
||||||
.PP
|
|
||||||
malloc(3), strndup(3), vasprintf(3), asprintf(3),
|
|
||||||
\m[blue]\fB\%http://talloc.samba.org/\fR\m[]
|
|
||||||
.SH "AUTHOR"
|
|
||||||
.PP
|
|
||||||
The original Samba software and related utilities were created by Andrew Tridgell\&. Samba is now developed by the Samba Team as an Open Source project similar to the way the Linux kernel is developed\&.
|
|
||||||
.SH "COPYRIGHT/LICENSE"
|
|
||||||
.PP
|
|
||||||
Copyright (C) Andrew Tridgell 2004
|
|
||||||
.PP
|
|
||||||
This program is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 3 of the License, or (at your option) any later version\&.
|
|
||||||
.PP
|
|
||||||
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE\&. See the GNU General Public License for more details\&.
|
|
||||||
.PP
|
|
||||||
You should have received a copy of the GNU General Public License along with this program; if not, see http://www\&.gnu\&.org/licenses/\&.
|
|
||||||
@ -1,2 +0,0 @@
|
|||||||
A hierarchical pool based memory allocator with destructors. It uses
|
|
||||||
reference counting to determine when memory should be freed.
|
|
||||||
@ -1,10 +0,0 @@
|
|||||||
%%PYTHON%%include/pytalloc.h
|
|
||||||
include/talloc.h
|
|
||||||
%%PYTHON%%lib/libpytalloc-util%%PYTHON_EXT_SUFFIX%%.so
|
|
||||||
%%PYTHON%%lib/libpytalloc-util%%PYTHON_EXT_SUFFIX%%.so.2
|
|
||||||
lib/libtalloc.so
|
|
||||||
lib/libtalloc.so.2
|
|
||||||
%%PYTHON%%%%PYTHON_SITELIBDIR%%/talloc%%PYTHON_EXT_SUFFIX%%.so
|
|
||||||
%%PYTHON%%%%PKGCONFIGDIR%%/pytalloc-util%%PYTHON_EXT_SUFFIX%%.pc
|
|
||||||
%%PKGCONFIGDIR%%/talloc.pc
|
|
||||||
share/man/man3/talloc.3.gz
|
|
||||||
@ -1,77 +0,0 @@
|
|||||||
PORTNAME= tevent
|
|
||||||
DISTVERSION= 0.16.1
|
|
||||||
PORTEPOCH= 0
|
|
||||||
CATEGORIES= devel
|
|
||||||
MASTER_SITES= SAMBA
|
|
||||||
|
|
||||||
MAINTAINER= samba@FreeBSD.org
|
|
||||||
COMMENT= Talloc based event loop library
|
|
||||||
WWW= https://tevent.samba.org/
|
|
||||||
|
|
||||||
LICENSE= LGPL3
|
|
||||||
|
|
||||||
BUILD_DEPENDS= talloc>=2.3.4:devel/talloc242
|
|
||||||
RUN_DEPENDS= talloc>=2.3.4:devel/talloc242
|
|
||||||
|
|
||||||
USES= compiler pkgconfig shebangfix waf
|
|
||||||
USE_LDCONFIG= yes
|
|
||||||
SHEBANG_GLOB= *.py
|
|
||||||
WAF_CMD= buildtools/bin/waf
|
|
||||||
CONFIGURE_LOG= bin/config.log
|
|
||||||
|
|
||||||
PKGCONFIGDIR?= ${PREFIX}/libdata/pkgconfig
|
|
||||||
PLIST_SUB= PKGCONFIGDIR=${PKGCONFIGDIR:S;^${PREFIX}/;;}
|
|
||||||
|
|
||||||
CONFIGURE_ARGS= --disable-rpath \
|
|
||||||
--disable-rpath-install \
|
|
||||||
--bundled-libraries=!talloc,cmocka \
|
|
||||||
--builtin-libraries=replace \
|
|
||||||
--without-gettext
|
|
||||||
CONFIGURE_ENV= PYTHONHASHSEED=1
|
|
||||||
MAKE_ENV= PYTHONHASHSEED=1
|
|
||||||
|
|
||||||
MANPAGES_DESC= Build and install manpages (requires textproc/docbook-xsl)
|
|
||||||
|
|
||||||
OPTIONS_DEFINE= DEBUG MANPAGES PYTHON
|
|
||||||
OPTIONS_DEFAULT= PYTHON
|
|
||||||
OPTIONS_SUB= yes
|
|
||||||
|
|
||||||
DEBUG_CFLAGS= -g -ggdb3 -O0
|
|
||||||
DEBUG_CONFIGURE_ON= --verbose --enable-debug
|
|
||||||
DEBUG_MAKE_ARGS= --verbose
|
|
||||||
|
|
||||||
PYTHON_USES= gettext-runtime python
|
|
||||||
PYTHON_USE= python=py3kplist
|
|
||||||
PYTHON_USES_OFF= python:build,test
|
|
||||||
PYTHON_CONFIGURE_OFF= --disable-python
|
|
||||||
|
|
||||||
MANPAGES_CONFIGURE_ENV_OFF= XSLTPROC="true"
|
|
||||||
MANPAGES_BUILD_DEPENDS= ${LOCALBASE}/share/xsl/docbook/manpages/docbook.xsl:textproc/docbook-xsl \
|
|
||||||
xsltproc:textproc/libxslt
|
|
||||||
# No fancy color error messages
|
|
||||||
CFLAGS+= ${CFLAGS_${CHOSEN_COMPILER_TYPE}}
|
|
||||||
CFLAGS_clang= -fno-color-diagnostics
|
|
||||||
CONFIGURE_ENV+= NOCOLOR=yes
|
|
||||||
MAKE_ENV+= NOCOLOR=yes
|
|
||||||
# Some symbols in tevent's linker version scripts are not defined, but since the
|
|
||||||
# scripts are generated dynamically, suppress errors with lld >= 17 due to these
|
|
||||||
# undefined symbols.
|
|
||||||
LDFLAGS+= -Wl,--undefined-version
|
|
||||||
|
|
||||||
CONFLICTS_INSTALL= tevent
|
|
||||||
|
|
||||||
post-patch:
|
|
||||||
@${REINPLACE_CMD} -e 's|%%PKGCONFIGDIR%%|${PKGCONFIGDIR}|g' \
|
|
||||||
${BUILD_WRKSRC}/wscript
|
|
||||||
|
|
||||||
post-install:
|
|
||||||
${RM} ${STAGEDIR}${PREFIX}/lib/tevent/libcmocka-tevent.so
|
|
||||||
${RM} ${STAGEDIR}${PREFIX}/lib/tevent/libpytalloc-util.cpython-${PYTHON_SUFFIX}-tevent.so
|
|
||||||
${RMDIR} ${STAGEDIR}${PREFIX}/lib/tevent
|
|
||||||
${STRIP_CMD} ${STAGEDIR}${PREFIX}/lib/libtevent.so
|
|
||||||
|
|
||||||
post-install-PYTHON-on:
|
|
||||||
${STRIP_CMD} ${STAGEDIR}${PYTHONPREFIX_SITELIBDIR}/_tevent*.so
|
|
||||||
${PYTHON_CMD} -m compileall -d ${PYTHON_SITELIBDIR} ${STAGEDIR}${PYTHON_SITELIBDIR}
|
|
||||||
|
|
||||||
.include <bsd.port.mk>
|
|
||||||
@ -1,3 +0,0 @@
|
|||||||
TIMESTAMP = 1737642434
|
|
||||||
SHA256 (tevent-0.16.1.tar.gz) = 362971e0f32dc1905f6fe4736319c4b8348c22dc85aa6c3f690a28efe548029e
|
|
||||||
SIZE (tevent-0.16.1.tar.gz) = 890010
|
|
||||||
@ -1,35 +0,0 @@
|
|||||||
--- buildtools/wafsamba/samba_autoconf.py.orig 2019-09-04 15:42:16 UTC
|
|
||||||
+++ buildtools/wafsamba/samba_autoconf.py
|
|
||||||
@@ -573,7 +573,7 @@ def library_flags(self, libs):
|
|
||||||
|
|
||||||
|
|
||||||
@conf
|
|
||||||
-def CHECK_LIB(conf, libs, mandatory=False, empty_decl=True, set_target=True, shlib=False):
|
|
||||||
+def CHECK_LIB(conf, libs, mandatory=False, empty_decl=True, set_target=True, shlib=False, msg=None):
|
|
||||||
'''check if a set of libraries exist as system libraries
|
|
||||||
|
|
||||||
returns the sublist of libs that do exist as a syslib or []
|
|
||||||
@@ -593,11 +593,14 @@ int foo()
|
|
||||||
ret.append(lib)
|
|
||||||
continue
|
|
||||||
|
|
||||||
+ if msg is None:
|
|
||||||
+ msg = 'Checking for library %s' % lib
|
|
||||||
+
|
|
||||||
(ccflags, ldflags, cpppath) = library_flags(conf, lib)
|
|
||||||
if shlib:
|
|
||||||
- res = conf.check(features='c cshlib', fragment=fragment, lib=lib, uselib_store=lib, cflags=ccflags, ldflags=ldflags, uselib=lib.upper(), mandatory=False)
|
|
||||||
+ res = conf.check(features='c cshlib', fragment=fragment, lib=lib, uselib_store=lib, cflags=ccflags, ldflags=ldflags, uselib=lib.upper(), mandatory=False, msg=msg)
|
|
||||||
else:
|
|
||||||
- res = conf.check(lib=lib, uselib_store=lib, cflags=ccflags, ldflags=ldflags, uselib=lib.upper(), mandatory=False)
|
|
||||||
+ res = conf.check(lib=lib, uselib_store=lib, cflags=ccflags, ldflags=ldflags, uselib=lib.upper(), mandatory=False, msg=msg)
|
|
||||||
|
|
||||||
if not res:
|
|
||||||
if mandatory:
|
|
||||||
@@ -949,5 +952,5 @@ def SAMBA_CHECK_UNDEFINED_SYMBOL_FLAGS(conf):
|
|
||||||
conf.env.undefined_ldflags = conf.ADD_LDFLAGS('-Wl,-no-undefined', testflags=True)
|
|
||||||
|
|
||||||
if (conf.env.undefined_ignore_ldflags == [] and
|
|
||||||
- conf.CHECK_LDFLAGS(['-undefined', 'dynamic_lookup'])):
|
|
||||||
+ conf.CHECK_LDFLAGS(['-undefined', 'dynamic_lookup'] + conf.env.WERROR_CFLAGS)):
|
|
||||||
conf.env.undefined_ignore_ldflags = ['-undefined', 'dynamic_lookup']
|
|
||||||
@ -1,11 +0,0 @@
|
|||||||
--- buildtools/wafsamba/samba_install.py.orig 2019-03-21 10:12:32 UTC
|
|
||||||
+++ buildtools/wafsamba/samba_install.py
|
|
||||||
@@ -115,7 +115,7 @@ def install_library(self):
|
|
||||||
inst_name = bld.make_libname(t.target)
|
|
||||||
elif self.vnum:
|
|
||||||
vnum_base = self.vnum.split('.')[0]
|
|
||||||
- install_name = bld.make_libname(target_name, version=self.vnum)
|
|
||||||
+ install_name = bld.make_libname(target_name, version=vnum_base)
|
|
||||||
install_link = bld.make_libname(target_name, version=vnum_base)
|
|
||||||
inst_name = bld.make_libname(t.target)
|
|
||||||
if not self.private_library or not t.env.SONAME_ST:
|
|
||||||
@ -1,15 +0,0 @@
|
|||||||
--- buildtools/wafsamba/wscript.orig 2019-03-21 10:12:32 UTC
|
|
||||||
+++ buildtools/wafsamba/wscript
|
|
||||||
@@ -82,10 +82,10 @@ def options(opt):
|
|
||||||
|
|
||||||
opt.add_option('--with-libiconv',
|
|
||||||
help='additional directory to search for libiconv',
|
|
||||||
- action='store', dest='iconv_open', default='/usr/local',
|
|
||||||
+ action='store', dest='iconv_open', default=None,
|
|
||||||
match = ['Checking for library iconv', 'Checking for iconv_open', 'Checking for header iconv.h'])
|
|
||||||
opt.add_option('--without-gettext',
|
|
||||||
- help=("Disable use of gettext"),
|
|
||||||
+ help=("disable use of gettext"),
|
|
||||||
action="store_true", dest='disable_gettext', default=False)
|
|
||||||
|
|
||||||
gr = opt.option_group('developer options')
|
|
||||||
@ -1,11 +0,0 @@
|
|||||||
--- lib/replace/wscript.orig 2019-03-21 10:12:32 UTC
|
|
||||||
+++ lib/replace/wscript
|
|
||||||
@@ -119,7 +119,7 @@ def configure(conf):
|
|
||||||
conf.CHECK_HEADERS('sys/atomic.h stdatomic.h')
|
|
||||||
conf.CHECK_HEADERS('libgen.h')
|
|
||||||
|
|
||||||
- if conf.CHECK_CFLAGS('-Wno-format-truncation'):
|
|
||||||
+ if conf.CHECK_CFLAGS(['-Wno-format-truncation'] + conf.env.WERROR_CFLAGS):
|
|
||||||
conf.define('HAVE_WNO_FORMAT_TRUNCATION', '1')
|
|
||||||
|
|
||||||
if conf.CHECK_CFLAGS('-Wno-unused-function'):
|
|
||||||
@ -1,11 +0,0 @@
|
|||||||
--- wscript.orig 2017-07-22 22:25:22 UTC
|
|
||||||
+++ wscript
|
|
||||||
@@ -88,7 +88,7 @@ def build(bld):
|
|
||||||
SRC += ' tevent_port.c'
|
|
||||||
|
|
||||||
if bld.env.standalone_tevent:
|
|
||||||
- bld.env.PKGCONFIGDIR = '${LIBDIR}/pkgconfig'
|
|
||||||
+ bld.env.PKGCONFIGDIR = '%%PKGCONFIGDIR%%'
|
|
||||||
private_library = False
|
|
||||||
else:
|
|
||||||
private_library = True
|
|
||||||
@ -1,6 +0,0 @@
|
|||||||
tevent is a simple library that can handle the main event loop for an
|
|
||||||
application. It supports three kinds of events: timed events, file
|
|
||||||
descriptors becoming readable or writable and signals.
|
|
||||||
|
|
||||||
Talloc is used for memory management, both internally and for private
|
|
||||||
data provided by users of the library.
|
|
||||||
@ -1,7 +0,0 @@
|
|||||||
include/tevent.h
|
|
||||||
lib/libtevent.so
|
|
||||||
lib/libtevent.so.0
|
|
||||||
%%PYTHON%%%%PYTHON_SITELIBDIR%%/__pycache__/tevent.cpython-%%PYTHON_SUFFIX%%.pyc
|
|
||||||
%%PYTHON%%%%PYTHON_SITELIBDIR%%/_tevent%%PYTHON_EXT_SUFFIX%%.so
|
|
||||||
%%PYTHON%%%%PYTHON_SITELIBDIR%%/tevent.py
|
|
||||||
%%PKGCONFIGDIR%%/tevent.pc
|
|
||||||
@ -1,55 +0,0 @@
|
|||||||
PORTNAME= freeipa-client
|
|
||||||
DISTVERSION= 4.12.2
|
|
||||||
PORTREVISION= 2
|
|
||||||
CATEGORIES= net
|
|
||||||
MASTER_SITES= https://releases.pagure.org/freeipa/
|
|
||||||
DISTNAME= freeipa-${DISTVERSION}
|
|
||||||
|
|
||||||
MAINTAINER= kiwi@oav.net
|
|
||||||
COMMENT= FreeIPA Client tools
|
|
||||||
WWW= https://www.freeipa.org/
|
|
||||||
|
|
||||||
LICENSE= GPLv3+
|
|
||||||
LICENSE_FILE= ${WRKSRC}/COPYING
|
|
||||||
|
|
||||||
BUILD_DEPENDS= ${PY_SETUPTOOLS} \
|
|
||||||
${PYTHON_PKGNAMEPREFIX}pip>0:devel/py-pip@${PY_FLAVOR}
|
|
||||||
|
|
||||||
LIB_DEPENDS= libcmocka.so:sysutils/cmocka \
|
|
||||||
libcurl.so:ftp/curl \
|
|
||||||
libini_config.so:devel/ding-libs \
|
|
||||||
libjansson.so:devel/jansson \
|
|
||||||
libnspr4.so:devel/nspr \
|
|
||||||
libnss3.so:security/nss \
|
|
||||||
libpopt.so:devel/popt \
|
|
||||||
libpwquality.so:security/libpwquality \
|
|
||||||
libsasl2.so:security/cyrus-sasl2 \
|
|
||||||
libxmlrpc.so:net/xmlrpc-c
|
|
||||||
|
|
||||||
USES= autoreconf gettext gmake gssapi:mit ldap libtool \
|
|
||||||
localbase:ldflags pkgconfig python
|
|
||||||
|
|
||||||
GNU_CONFIGURE= yes
|
|
||||||
GNU_CONFIGURE_MANPREFIX=${PREFIX}/share
|
|
||||||
CONFIGURE_ARGS= --disable-dependency-tracking \
|
|
||||||
--disable-server \
|
|
||||||
--with-ipaplatform=freebsd \
|
|
||||||
--without-ipatests \
|
|
||||||
--without-server
|
|
||||||
|
|
||||||
# Don't bytecode python files
|
|
||||||
MAKE_ENV= PYTHONDONTWRITEBYTECODE=1
|
|
||||||
|
|
||||||
# Remove all systemd dependant things
|
|
||||||
EXTRACT_AFTER_ARGS= --exclude client/systemd --exclude daemons/dnssec \
|
|
||||||
--exclude daemons/ipa-otpd --exclude \
|
|
||||||
daemons/ipa-slapi-plugins --exclude init/systemd \
|
|
||||||
--exclude init/tmpfilesd
|
|
||||||
|
|
||||||
PLIST_SUB= DISTVERSION=${DISTVERSION}
|
|
||||||
|
|
||||||
# Make sample configuration file
|
|
||||||
post-install:
|
|
||||||
@${MV} ${STAGEDIR}${PREFIX}/etc/ipa/epn.conf ${STAGEDIR}${PREFIX}/etc/ipa/epn.conf.sample
|
|
||||||
|
|
||||||
.include <bsd.port.mk>
|
|
||||||
@ -1,3 +0,0 @@
|
|||||||
TIMESTAMP = 1725364321
|
|
||||||
SHA256 (freeipa-4.12.2.tar.gz) = dc88f5404e7613eb6530d71142ef43a9f89019d59cdc6ec25b778413258c317f
|
|
||||||
SIZE (freeipa-4.12.2.tar.gz) = 5699673
|
|
||||||
@ -1,10 +0,0 @@
|
|||||||
--- asn1/asn1c/INTEGER.c.orig 2024-08-21 15:06:37 UTC
|
|
||||||
+++ asn1/asn1c/INTEGER.c
|
|
||||||
@@ -7,6 +7,7 @@
|
|
||||||
#include <INTEGER.h>
|
|
||||||
#include <asn_codecs_prim.h> /* Encoder and decoder of a primitive type */
|
|
||||||
#include <errno.h>
|
|
||||||
+#include <stdlib.h>
|
|
||||||
|
|
||||||
/*
|
|
||||||
* INTEGER basic type description.
|
|
||||||
@ -1,11 +0,0 @@
|
|||||||
--- asn1/asn1c/Makefile.am.orig 2021-11-25 17:34:42 UTC
|
|
||||||
+++ asn1/asn1c/Makefile.am
|
|
||||||
@@ -70,7 +70,7 @@ libasn1c_la_SOURCES = \
|
|
||||||
|
|
||||||
EXTRA_DIST = ipa.asn1
|
|
||||||
|
|
||||||
-AM_CPPFLAGS = -I$(top_srcdir)/util
|
|
||||||
+AM_CPPFLAGS = -I$(top_srcdir)/util -D_GNU_SOURCE
|
|
||||||
|
|
||||||
noinst_LTLIBRARIES=libasn1c.la
|
|
||||||
|
|
||||||
@ -1,10 +0,0 @@
|
|||||||
--- asn1/asn1c/NativeEnumerated.c.orig 2024-08-21 15:06:37 UTC
|
|
||||||
+++ asn1/asn1c/NativeEnumerated.c
|
|
||||||
@@ -11,6 +11,7 @@
|
|
||||||
*/
|
|
||||||
#include <asn_internal.h>
|
|
||||||
#include <NativeEnumerated.h>
|
|
||||||
+#include <stdlib.h>
|
|
||||||
|
|
||||||
/*
|
|
||||||
* NativeEnumerated basic type description.
|
|
||||||
@ -1,10 +0,0 @@
|
|||||||
--- asn1/asn1c/der_encoder.c.orig 2024-08-21 15:06:37 UTC
|
|
||||||
+++ asn1/asn1c/der_encoder.c
|
|
||||||
@@ -4,6 +4,7 @@
|
|
||||||
*/
|
|
||||||
#include <asn_internal.h>
|
|
||||||
#include <errno.h>
|
|
||||||
+#include <stdlib.h>
|
|
||||||
|
|
||||||
static ssize_t der_write_TL(ber_tlv_tag_t tag, ber_tlv_len_t len,
|
|
||||||
asn_app_consume_bytes_f *cb, void *app_key, int constructed);
|
|
||||||
@ -1,11 +0,0 @@
|
|||||||
--- client/Makefile.am.orig 2024-08-21 15:06:37 UTC
|
|
||||||
+++ client/Makefile.am
|
|
||||||
@@ -94,8 +94,6 @@ SUBDIRS = \
|
|
||||||
SUBDIRS = \
|
|
||||||
share \
|
|
||||||
man \
|
|
||||||
- sysconfig \
|
|
||||||
- systemd \
|
|
||||||
$(NULL)
|
|
||||||
# init
|
|
||||||
|
|
||||||
@ -1,16 +0,0 @@
|
|||||||
--- client/ipa-getkeytab.c.orig 2023-08-21 14:29:00 UTC
|
|
||||||
+++ client/ipa-getkeytab.c
|
|
||||||
@@ -34,6 +34,13 @@
|
|
||||||
#include <time.h>
|
|
||||||
#include <krb5.h>
|
|
||||||
#include <ldap.h>
|
|
||||||
+typedef unsigned char u_char;
|
|
||||||
+typedef unsigned short u_short;
|
|
||||||
+typedef unsigned int u_int;
|
|
||||||
+typedef unsigned long u_long;
|
|
||||||
+#include <sys/types.h>
|
|
||||||
+#include <netinet/in.h>
|
|
||||||
+#include <arpa/nameser.h>
|
|
||||||
#include <resolv.h>
|
|
||||||
#include <sasl/sasl.h>
|
|
||||||
#include <popt.h>
|
|
||||||
@ -1,112 +0,0 @@
|
|||||||
--- configure.ac.orig 2024-08-21 15:06:37 UTC
|
|
||||||
+++ configure.ac
|
|
||||||
@@ -25,9 +25,12 @@ dnl fail hard when includes statements are missing
|
|
||||||
dnl Enable features like strndup()
|
|
||||||
CFLAGS="$CFLAGS -D_POSIX_C_SOURCE=200809L"
|
|
||||||
dnl fail hard when includes statements are missing
|
|
||||||
-CFLAGS="$CFLAGS -Werror=implicit-function-declaration"
|
|
||||||
+dnl Removing this failing hard because on implicit declaration of
|
|
||||||
+dnl alloca() used several plaice in the code.
|
|
||||||
+dnl CFLAGS="$CFLAGS -Werror=implicit-function-declaration"
|
|
||||||
|
|
||||||
AC_PROG_CC_C99
|
|
||||||
+AC_GNU_SOURCE
|
|
||||||
AC_DISABLE_STATIC
|
|
||||||
LT_INIT
|
|
||||||
|
|
||||||
@@ -211,14 +214,7 @@ SAVE_LIBS="$LIBS"
|
|
||||||
dnl - Check for libintl
|
|
||||||
dnl ---------------------------------------------------------------------------
|
|
||||||
SAVE_LIBS="$LIBS"
|
|
||||||
-LIBINTL_LIBS=
|
|
||||||
-AC_CHECK_HEADER(libintl.h, [], [AC_MSG_ERROR([libintl.h not found, please install xgettext])])
|
|
||||||
-AC_SEARCH_LIBS([bindtextdomain], [libintl],[], [])
|
|
||||||
-if test "x$ac_cv_search_bindtextdomain" = "xno" ; then
|
|
||||||
- AC_MSG_ERROR([libintl is not found and your libc does not support gettext, please install xgettext])
|
|
||||||
-elif test "x$ac_cv_search_bindtextdomain" != "xnone required" ; then
|
|
||||||
- LIBINTL_LIBS="$ac_cv_search_bindtextdomain"
|
|
||||||
-fi
|
|
||||||
+LIBINTL_LIBS="-lintl"
|
|
||||||
LIBS="$SAVELIBS"
|
|
||||||
AC_SUBST(LIBINTL_LIBS)
|
|
||||||
|
|
||||||
@@ -249,39 +245,13 @@ dnl --------------------------------------------------
|
|
||||||
AC_SUBST([runstatedir])
|
|
||||||
|
|
||||||
dnl ---------------------------------------------------------------------------
|
|
||||||
-dnl - Check for systemd directories
|
|
||||||
-dnl ---------------------------------------------------------------------------
|
|
||||||
-
|
|
||||||
-PKG_CHECK_EXISTS([systemd], [], [AC_MSG_ERROR([systemd not found])])
|
|
||||||
-AC_ARG_WITH([systemdsystemunitdir],
|
|
||||||
- AS_HELP_STRING([--with-systemdsystemunitdir=DIR],
|
|
||||||
- [Directory for systemd service files]),
|
|
||||||
- [systemdsystemunitdir=$with_systemdsystemunitdir],
|
|
||||||
- [systemdsystemunitdir=$($PKG_CONFIG --define-variable=prefix='${prefix}' --variable=systemdsystemunitdir systemd)])
|
|
||||||
-AC_SUBST([systemdsystemunitdir])
|
|
||||||
-
|
|
||||||
-AC_ARG_WITH([systemdtmpfilesdir],
|
|
||||||
- AS_HELP_STRING([--with-systemdtmpfilesdir=DIR],
|
|
||||||
- [Directory for systemd-tmpfiles configuration files]),
|
|
||||||
- [systemdtmpfilesdir=$with_systemdtmpfilesdir],
|
|
||||||
- [systemdtmpfilesdir=$($PKG_CONFIG --define-variable=prefix='${prefix}' --variable=tmpfilesdir systemd)])
|
|
||||||
-AC_SUBST([systemdtmpfilesdir])
|
|
||||||
-
|
|
||||||
-AC_ARG_WITH([systemdcatalogdir],
|
|
||||||
- AS_HELP_STRING([--with-systemdcatalogdir=DIR],
|
|
||||||
- [Directory for systemd journal catalog files]),
|
|
||||||
- [systemdcatalogdir=$with_systemdcatalogdir],
|
|
||||||
- [systemdcatalogdir=$($PKG_CONFIG --define-variable=prefix='${prefix}' --variable=catalogdir systemd)])
|
|
||||||
-AC_SUBST([systemdcatalogdir])
|
|
||||||
-
|
|
||||||
-dnl ---------------------------------------------------------------------------
|
|
||||||
dnl - Server-only configuration
|
|
||||||
dnl ---------------------------------------------------------------------------
|
|
||||||
|
|
||||||
-AM_COND_IF([ENABLE_SERVER], [
|
|
||||||
- m4_include(server.m4)
|
|
||||||
-])
|
|
||||||
-AM_CONDITIONAL([USE_SSS_NSS_TIMEOUT], [test "x$ac_cv_have_decl_sss_nss_getpwnam_timeout" = xyes])
|
|
||||||
+dnl AM_COND_IF([ENABLE_SERVER], [
|
|
||||||
+dnl m4_include(server.m4)
|
|
||||||
+dnl ])
|
|
||||||
+dnl AM_CONDITIONAL([USE_SSS_NSS_TIMEOUT], [test "x$ac_cv_have_decl_sss_nss_getpwnam_timeout" = xyes])
|
|
||||||
|
|
||||||
dnl ---------------------------------------------------------------------------
|
|
||||||
dnl - Check if IPA certauth plugin can be build
|
|
||||||
@@ -625,35 +595,11 @@ AC_CONFIG_FILES([
|
|
||||||
client/Makefile
|
|
||||||
client/share/Makefile
|
|
||||||
client/man/Makefile
|
|
||||||
- client/sysconfig/Makefile
|
|
||||||
- client/systemd/Makefile
|
|
||||||
contrib/completion/Makefile
|
|
||||||
contrib/Makefile
|
|
||||||
- daemons/dnssec/Makefile
|
|
||||||
daemons/Makefile
|
|
||||||
daemons/ipa-kdb/Makefile
|
|
||||||
daemons/ipa-sam/Makefile
|
|
||||||
- daemons/ipa-otpd/Makefile
|
|
||||||
- daemons/ipa-slapi-plugins/Makefile
|
|
||||||
- daemons/ipa-slapi-plugins/libotp/Makefile
|
|
||||||
- daemons/ipa-slapi-plugins/ipa-cldap/Makefile
|
|
||||||
- daemons/ipa-slapi-plugins/ipa-dns/Makefile
|
|
||||||
- daemons/ipa-slapi-plugins/ipa-enrollment/Makefile
|
|
||||||
- daemons/ipa-slapi-plugins/ipa-graceperiod/Makefile
|
|
||||||
- daemons/ipa-slapi-plugins/ipa-lockout/Makefile
|
|
||||||
- daemons/ipa-slapi-plugins/ipa-otp-counter/Makefile
|
|
||||||
- daemons/ipa-slapi-plugins/ipa-otp-lasttoken/Makefile
|
|
||||||
- daemons/ipa-slapi-plugins/ipa-pwd-extop/Makefile
|
|
||||||
- daemons/ipa-slapi-plugins/ipa-extdom-extop/Makefile
|
|
||||||
- daemons/ipa-slapi-plugins/ipa-winsync/Makefile
|
|
||||||
- daemons/ipa-slapi-plugins/ipa-version/Makefile
|
|
||||||
- daemons/ipa-slapi-plugins/ipa-uuid/Makefile
|
|
||||||
- daemons/ipa-slapi-plugins/ipa-modrdn/Makefile
|
|
||||||
- daemons/ipa-slapi-plugins/ipa-sidgen/Makefile
|
|
||||||
- daemons/ipa-slapi-plugins/ipa-range-check/Makefile
|
|
||||||
- daemons/ipa-slapi-plugins/topology/Makefile
|
|
||||||
- init/systemd/Makefile
|
|
||||||
- init/tmpfilesd/Makefile
|
|
||||||
init/Makefile
|
|
||||||
install/Makefile
|
|
||||||
install/certmonger/Makefile
|
|
||||||
@ -1,14 +0,0 @@
|
|||||||
--- daemons/Makefile.am.orig 2023-08-21 16:29:00.040643147 +0200
|
|
||||||
+++ daemons/Makefile.am 2023-10-24 17:56:44.164932000 +0200
|
|
||||||
@@ -9,11 +9,8 @@
|
|
||||||
|
|
||||||
SUBDIRS = \
|
|
||||||
. \
|
|
||||||
- dnssec \
|
|
||||||
ipa-kdb \
|
|
||||||
- ipa-slapi-plugins \
|
|
||||||
ipa-sam \
|
|
||||||
- ipa-otpd \
|
|
||||||
$(NULL)
|
|
||||||
|
|
||||||
ipa-version.h: ipa-version.h.in $(top_builddir)/$(CONFIG_STATUS)
|
|
||||||
@ -1,11 +0,0 @@
|
|||||||
--- init/Makefile.am.orig 2023-10-24 17:29:14.662539000 +0200
|
|
||||||
+++ init/Makefile.am 2023-10-24 17:29:28.779983000 +0200
|
|
||||||
@@ -2,7 +2,7 @@
|
|
||||||
#
|
|
||||||
AUTOMAKE_OPTIONS = 1.7
|
|
||||||
|
|
||||||
-SUBDIRS = systemd tmpfilesd
|
|
||||||
+#SUBDIRS = systemd tmpfilesd
|
|
||||||
|
|
||||||
dist_sysconfenv_DATA = \
|
|
||||||
ipa-dnskeysyncd \
|
|
||||||
@ -1,4 +0,0 @@
|
|||||||
--- /dev/null 2023-10-25 10:42:48.658581000 +0200
|
|
||||||
+++ ipaplatform/freebsd/__init__.py 2023-10-25 10:42:03.380066000 +0200
|
|
||||||
@@ -0,0 +1 @@
|
|
||||||
+NAME = 'freebsd'
|
|
||||||
@ -1,10 +0,0 @@
|
|||||||
--- ipaplatform/setup.py.orig 2023-10-03 12:48:36 UTC
|
|
||||||
+++ ipaplatform/setup.py
|
|
||||||
@@ -37,6 +37,7 @@ if __name__ == '__main__':
|
|
||||||
"ipaplatform.debian",
|
|
||||||
"ipaplatform.fedora",
|
|
||||||
"ipaplatform.fedora_container",
|
|
||||||
+ "ipaplatform.freebsd",
|
|
||||||
"ipaplatform.nixos",
|
|
||||||
"ipaplatform.redhat",
|
|
||||||
"ipaplatform.rhel",
|
|
||||||
@ -1,10 +0,0 @@
|
|||||||
--- util/ipa_krb5.c.orig 2021-11-25 17:34:42 UTC
|
|
||||||
+++ util/ipa_krb5.c
|
|
||||||
@@ -25,6 +25,7 @@
|
|
||||||
#include <errno.h>
|
|
||||||
#include <lber.h>
|
|
||||||
#include <errno.h>
|
|
||||||
+#include <sys/endian.h>
|
|
||||||
|
|
||||||
#include <libintl.h>
|
|
||||||
#define _(STRING) gettext(STRING)
|
|
||||||
@ -1,2 +0,0 @@
|
|||||||
FreeIPA is a free and open source identity management system. This
|
|
||||||
package provides its command-line administration tools.
|
|
||||||
@ -1,446 +0,0 @@
|
|||||||
bin/ipa
|
|
||||||
etc/bash_completion.d/ipa
|
|
||||||
@sample etc/ipa/epn.conf.sample
|
|
||||||
etc/ipa/epn/expire_msg.template
|
|
||||||
%%PYTHON_SITELIBDIR%%/ipaclient-%%DISTVERSION%%-py%%PYTHON_VER%%.egg-info/PKG-INFO
|
|
||||||
%%PYTHON_SITELIBDIR%%/ipaclient-%%DISTVERSION%%-py%%PYTHON_VER%%.egg-info/SOURCES.txt
|
|
||||||
%%PYTHON_SITELIBDIR%%/ipaclient-%%DISTVERSION%%-py%%PYTHON_VER%%.egg-info/dependency_links.txt
|
|
||||||
%%PYTHON_SITELIBDIR%%/ipaclient-%%DISTVERSION%%-py%%PYTHON_VER%%.egg-info/entry_points.txt
|
|
||||||
%%PYTHON_SITELIBDIR%%/ipaclient-%%DISTVERSION%%-py%%PYTHON_VER%%.egg-info/not-zip-safe
|
|
||||||
%%PYTHON_SITELIBDIR%%/ipaclient-%%DISTVERSION%%-py%%PYTHON_VER%%.egg-info/requires.txt
|
|
||||||
%%PYTHON_SITELIBDIR%%/ipaclient-%%DISTVERSION%%-py%%PYTHON_VER%%.egg-info/top_level.txt
|
|
||||||
%%PYTHON_SITELIBDIR%%/ipaclient/__init__.py
|
|
||||||
%%PYTHON_SITELIBDIR%%/ipaclient/__main__.py
|
|
||||||
%%PYTHON_SITELIBDIR%%/ipaclient/discovery.py
|
|
||||||
%%PYTHON_SITELIBDIR%%/ipaclient/frontend.py
|
|
||||||
%%PYTHON_SITELIBDIR%%/ipaclient/install/__init__.py
|
|
||||||
%%PYTHON_SITELIBDIR%%/ipaclient/install/automount.py
|
|
||||||
%%PYTHON_SITELIBDIR%%/ipaclient/install/client.py
|
|
||||||
%%PYTHON_SITELIBDIR%%/ipaclient/install/ipa_certupdate.py
|
|
||||||
%%PYTHON_SITELIBDIR%%/ipaclient/install/ipa_client_automount.py
|
|
||||||
%%PYTHON_SITELIBDIR%%/ipaclient/install/ipa_client_install.py
|
|
||||||
%%PYTHON_SITELIBDIR%%/ipaclient/install/ipa_client_samba.py
|
|
||||||
%%PYTHON_SITELIBDIR%%/ipaclient/install/ipa_epn.py
|
|
||||||
%%PYTHON_SITELIBDIR%%/ipaclient/install/ipachangeconf.py
|
|
||||||
%%PYTHON_SITELIBDIR%%/ipaclient/install/ipadiscovery.py
|
|
||||||
%%PYTHON_SITELIBDIR%%/ipaclient/install/sssd.py
|
|
||||||
%%PYTHON_SITELIBDIR%%/ipaclient/install/timeconf.py
|
|
||||||
%%PYTHON_SITELIBDIR%%/ipaclient/install_files.txt
|
|
||||||
%%PYTHON_SITELIBDIR%%/ipaclient/plugins/__init__.py
|
|
||||||
%%PYTHON_SITELIBDIR%%/ipaclient/plugins/automember.py
|
|
||||||
%%PYTHON_SITELIBDIR%%/ipaclient/plugins/automount.py
|
|
||||||
%%PYTHON_SITELIBDIR%%/ipaclient/plugins/baseuser.py
|
|
||||||
%%PYTHON_SITELIBDIR%%/ipaclient/plugins/ca.py
|
|
||||||
%%PYTHON_SITELIBDIR%%/ipaclient/plugins/cert.py
|
|
||||||
%%PYTHON_SITELIBDIR%%/ipaclient/plugins/certmap.py
|
|
||||||
%%PYTHON_SITELIBDIR%%/ipaclient/plugins/certprofile.py
|
|
||||||
%%PYTHON_SITELIBDIR%%/ipaclient/plugins/dns.py
|
|
||||||
%%PYTHON_SITELIBDIR%%/ipaclient/plugins/hbacrule.py
|
|
||||||
%%PYTHON_SITELIBDIR%%/ipaclient/plugins/hbactest.py
|
|
||||||
%%PYTHON_SITELIBDIR%%/ipaclient/plugins/host.py
|
|
||||||
%%PYTHON_SITELIBDIR%%/ipaclient/plugins/idrange.py
|
|
||||||
%%PYTHON_SITELIBDIR%%/ipaclient/plugins/internal.py
|
|
||||||
%%PYTHON_SITELIBDIR%%/ipaclient/plugins/location.py
|
|
||||||
%%PYTHON_SITELIBDIR%%/ipaclient/plugins/migration.py
|
|
||||||
%%PYTHON_SITELIBDIR%%/ipaclient/plugins/misc.py
|
|
||||||
%%PYTHON_SITELIBDIR%%/ipaclient/plugins/otptoken.py
|
|
||||||
%%PYTHON_SITELIBDIR%%/ipaclient/plugins/otptoken_yubikey.py
|
|
||||||
%%PYTHON_SITELIBDIR%%/ipaclient/plugins/passwd.py
|
|
||||||
%%PYTHON_SITELIBDIR%%/ipaclient/plugins/permission.py
|
|
||||||
%%PYTHON_SITELIBDIR%%/ipaclient/plugins/rpcclient.py
|
|
||||||
%%PYTHON_SITELIBDIR%%/ipaclient/plugins/server.py
|
|
||||||
%%PYTHON_SITELIBDIR%%/ipaclient/plugins/service.py
|
|
||||||
%%PYTHON_SITELIBDIR%%/ipaclient/plugins/stageuser.py
|
|
||||||
%%PYTHON_SITELIBDIR%%/ipaclient/plugins/sudorule.py
|
|
||||||
%%PYTHON_SITELIBDIR%%/ipaclient/plugins/topology.py
|
|
||||||
%%PYTHON_SITELIBDIR%%/ipaclient/plugins/trust.py
|
|
||||||
%%PYTHON_SITELIBDIR%%/ipaclient/plugins/user.py
|
|
||||||
%%PYTHON_SITELIBDIR%%/ipaclient/plugins/vault.py
|
|
||||||
%%PYTHON_SITELIBDIR%%/ipaclient/remote_plugins/2_114/__init__.py
|
|
||||||
%%PYTHON_SITELIBDIR%%/ipaclient/remote_plugins/2_114/aci.py
|
|
||||||
%%PYTHON_SITELIBDIR%%/ipaclient/remote_plugins/2_114/automember.py
|
|
||||||
%%PYTHON_SITELIBDIR%%/ipaclient/remote_plugins/2_114/automount.py
|
|
||||||
%%PYTHON_SITELIBDIR%%/ipaclient/remote_plugins/2_114/batch.py
|
|
||||||
%%PYTHON_SITELIBDIR%%/ipaclient/remote_plugins/2_114/cert.py
|
|
||||||
%%PYTHON_SITELIBDIR%%/ipaclient/remote_plugins/2_114/config.py
|
|
||||||
%%PYTHON_SITELIBDIR%%/ipaclient/remote_plugins/2_114/delegation.py
|
|
||||||
%%PYTHON_SITELIBDIR%%/ipaclient/remote_plugins/2_114/dns.py
|
|
||||||
%%PYTHON_SITELIBDIR%%/ipaclient/remote_plugins/2_114/group.py
|
|
||||||
%%PYTHON_SITELIBDIR%%/ipaclient/remote_plugins/2_114/hbacrule.py
|
|
||||||
%%PYTHON_SITELIBDIR%%/ipaclient/remote_plugins/2_114/hbacsvc.py
|
|
||||||
%%PYTHON_SITELIBDIR%%/ipaclient/remote_plugins/2_114/hbacsvcgroup.py
|
|
||||||
%%PYTHON_SITELIBDIR%%/ipaclient/remote_plugins/2_114/hbactest.py
|
|
||||||
%%PYTHON_SITELIBDIR%%/ipaclient/remote_plugins/2_114/host.py
|
|
||||||
%%PYTHON_SITELIBDIR%%/ipaclient/remote_plugins/2_114/hostgroup.py
|
|
||||||
%%PYTHON_SITELIBDIR%%/ipaclient/remote_plugins/2_114/idrange.py
|
|
||||||
%%PYTHON_SITELIBDIR%%/ipaclient/remote_plugins/2_114/idviews.py
|
|
||||||
%%PYTHON_SITELIBDIR%%/ipaclient/remote_plugins/2_114/internal.py
|
|
||||||
%%PYTHON_SITELIBDIR%%/ipaclient/remote_plugins/2_114/join.py
|
|
||||||
%%PYTHON_SITELIBDIR%%/ipaclient/remote_plugins/2_114/krbtpolicy.py
|
|
||||||
%%PYTHON_SITELIBDIR%%/ipaclient/remote_plugins/2_114/migration.py
|
|
||||||
%%PYTHON_SITELIBDIR%%/ipaclient/remote_plugins/2_114/misc.py
|
|
||||||
%%PYTHON_SITELIBDIR%%/ipaclient/remote_plugins/2_114/netgroup.py
|
|
||||||
%%PYTHON_SITELIBDIR%%/ipaclient/remote_plugins/2_114/otpconfig.py
|
|
||||||
%%PYTHON_SITELIBDIR%%/ipaclient/remote_plugins/2_114/otptoken.py
|
|
||||||
%%PYTHON_SITELIBDIR%%/ipaclient/remote_plugins/2_114/otptoken_yubikey.py
|
|
||||||
%%PYTHON_SITELIBDIR%%/ipaclient/remote_plugins/2_114/passwd.py
|
|
||||||
%%PYTHON_SITELIBDIR%%/ipaclient/remote_plugins/2_114/permission.py
|
|
||||||
%%PYTHON_SITELIBDIR%%/ipaclient/remote_plugins/2_114/ping.py
|
|
||||||
%%PYTHON_SITELIBDIR%%/ipaclient/remote_plugins/2_114/pkinit.py
|
|
||||||
%%PYTHON_SITELIBDIR%%/ipaclient/remote_plugins/2_114/privilege.py
|
|
||||||
%%PYTHON_SITELIBDIR%%/ipaclient/remote_plugins/2_114/pwpolicy.py
|
|
||||||
%%PYTHON_SITELIBDIR%%/ipaclient/remote_plugins/2_114/radiusproxy.py
|
|
||||||
%%PYTHON_SITELIBDIR%%/ipaclient/remote_plugins/2_114/realmdomains.py
|
|
||||||
%%PYTHON_SITELIBDIR%%/ipaclient/remote_plugins/2_114/role.py
|
|
||||||
%%PYTHON_SITELIBDIR%%/ipaclient/remote_plugins/2_114/selfservice.py
|
|
||||||
%%PYTHON_SITELIBDIR%%/ipaclient/remote_plugins/2_114/selinuxusermap.py
|
|
||||||
%%PYTHON_SITELIBDIR%%/ipaclient/remote_plugins/2_114/service.py
|
|
||||||
%%PYTHON_SITELIBDIR%%/ipaclient/remote_plugins/2_114/session.py
|
|
||||||
%%PYTHON_SITELIBDIR%%/ipaclient/remote_plugins/2_114/sudocmd.py
|
|
||||||
%%PYTHON_SITELIBDIR%%/ipaclient/remote_plugins/2_114/sudocmdgroup.py
|
|
||||||
%%PYTHON_SITELIBDIR%%/ipaclient/remote_plugins/2_114/sudorule.py
|
|
||||||
%%PYTHON_SITELIBDIR%%/ipaclient/remote_plugins/2_114/trust.py
|
|
||||||
%%PYTHON_SITELIBDIR%%/ipaclient/remote_plugins/2_114/user.py
|
|
||||||
%%PYTHON_SITELIBDIR%%/ipaclient/remote_plugins/2_156/__init__.py
|
|
||||||
%%PYTHON_SITELIBDIR%%/ipaclient/remote_plugins/2_156/aci.py
|
|
||||||
%%PYTHON_SITELIBDIR%%/ipaclient/remote_plugins/2_156/automember.py
|
|
||||||
%%PYTHON_SITELIBDIR%%/ipaclient/remote_plugins/2_156/automount.py
|
|
||||||
%%PYTHON_SITELIBDIR%%/ipaclient/remote_plugins/2_156/batch.py
|
|
||||||
%%PYTHON_SITELIBDIR%%/ipaclient/remote_plugins/2_156/caacl.py
|
|
||||||
%%PYTHON_SITELIBDIR%%/ipaclient/remote_plugins/2_156/cert.py
|
|
||||||
%%PYTHON_SITELIBDIR%%/ipaclient/remote_plugins/2_156/certprofile.py
|
|
||||||
%%PYTHON_SITELIBDIR%%/ipaclient/remote_plugins/2_156/config.py
|
|
||||||
%%PYTHON_SITELIBDIR%%/ipaclient/remote_plugins/2_156/delegation.py
|
|
||||||
%%PYTHON_SITELIBDIR%%/ipaclient/remote_plugins/2_156/dns.py
|
|
||||||
%%PYTHON_SITELIBDIR%%/ipaclient/remote_plugins/2_156/domainlevel.py
|
|
||||||
%%PYTHON_SITELIBDIR%%/ipaclient/remote_plugins/2_156/group.py
|
|
||||||
%%PYTHON_SITELIBDIR%%/ipaclient/remote_plugins/2_156/hbacrule.py
|
|
||||||
%%PYTHON_SITELIBDIR%%/ipaclient/remote_plugins/2_156/hbacsvc.py
|
|
||||||
%%PYTHON_SITELIBDIR%%/ipaclient/remote_plugins/2_156/hbacsvcgroup.py
|
|
||||||
%%PYTHON_SITELIBDIR%%/ipaclient/remote_plugins/2_156/hbactest.py
|
|
||||||
%%PYTHON_SITELIBDIR%%/ipaclient/remote_plugins/2_156/host.py
|
|
||||||
%%PYTHON_SITELIBDIR%%/ipaclient/remote_plugins/2_156/hostgroup.py
|
|
||||||
%%PYTHON_SITELIBDIR%%/ipaclient/remote_plugins/2_156/idrange.py
|
|
||||||
%%PYTHON_SITELIBDIR%%/ipaclient/remote_plugins/2_156/idviews.py
|
|
||||||
%%PYTHON_SITELIBDIR%%/ipaclient/remote_plugins/2_156/internal.py
|
|
||||||
%%PYTHON_SITELIBDIR%%/ipaclient/remote_plugins/2_156/join.py
|
|
||||||
%%PYTHON_SITELIBDIR%%/ipaclient/remote_plugins/2_156/krbtpolicy.py
|
|
||||||
%%PYTHON_SITELIBDIR%%/ipaclient/remote_plugins/2_156/migration.py
|
|
||||||
%%PYTHON_SITELIBDIR%%/ipaclient/remote_plugins/2_156/misc.py
|
|
||||||
%%PYTHON_SITELIBDIR%%/ipaclient/remote_plugins/2_156/netgroup.py
|
|
||||||
%%PYTHON_SITELIBDIR%%/ipaclient/remote_plugins/2_156/otpconfig.py
|
|
||||||
%%PYTHON_SITELIBDIR%%/ipaclient/remote_plugins/2_156/otptoken.py
|
|
||||||
%%PYTHON_SITELIBDIR%%/ipaclient/remote_plugins/2_156/otptoken_yubikey.py
|
|
||||||
%%PYTHON_SITELIBDIR%%/ipaclient/remote_plugins/2_156/passwd.py
|
|
||||||
%%PYTHON_SITELIBDIR%%/ipaclient/remote_plugins/2_156/permission.py
|
|
||||||
%%PYTHON_SITELIBDIR%%/ipaclient/remote_plugins/2_156/ping.py
|
|
||||||
%%PYTHON_SITELIBDIR%%/ipaclient/remote_plugins/2_156/pkinit.py
|
|
||||||
%%PYTHON_SITELIBDIR%%/ipaclient/remote_plugins/2_156/privilege.py
|
|
||||||
%%PYTHON_SITELIBDIR%%/ipaclient/remote_plugins/2_156/pwpolicy.py
|
|
||||||
%%PYTHON_SITELIBDIR%%/ipaclient/remote_plugins/2_156/radiusproxy.py
|
|
||||||
%%PYTHON_SITELIBDIR%%/ipaclient/remote_plugins/2_156/realmdomains.py
|
|
||||||
%%PYTHON_SITELIBDIR%%/ipaclient/remote_plugins/2_156/role.py
|
|
||||||
%%PYTHON_SITELIBDIR%%/ipaclient/remote_plugins/2_156/selfservice.py
|
|
||||||
%%PYTHON_SITELIBDIR%%/ipaclient/remote_plugins/2_156/selinuxusermap.py
|
|
||||||
%%PYTHON_SITELIBDIR%%/ipaclient/remote_plugins/2_156/server.py
|
|
||||||
%%PYTHON_SITELIBDIR%%/ipaclient/remote_plugins/2_156/service.py
|
|
||||||
%%PYTHON_SITELIBDIR%%/ipaclient/remote_plugins/2_156/servicedelegation.py
|
|
||||||
%%PYTHON_SITELIBDIR%%/ipaclient/remote_plugins/2_156/session.py
|
|
||||||
%%PYTHON_SITELIBDIR%%/ipaclient/remote_plugins/2_156/stageuser.py
|
|
||||||
%%PYTHON_SITELIBDIR%%/ipaclient/remote_plugins/2_156/sudocmd.py
|
|
||||||
%%PYTHON_SITELIBDIR%%/ipaclient/remote_plugins/2_156/sudocmdgroup.py
|
|
||||||
%%PYTHON_SITELIBDIR%%/ipaclient/remote_plugins/2_156/sudorule.py
|
|
||||||
%%PYTHON_SITELIBDIR%%/ipaclient/remote_plugins/2_156/topology.py
|
|
||||||
%%PYTHON_SITELIBDIR%%/ipaclient/remote_plugins/2_156/trust.py
|
|
||||||
%%PYTHON_SITELIBDIR%%/ipaclient/remote_plugins/2_156/user.py
|
|
||||||
%%PYTHON_SITELIBDIR%%/ipaclient/remote_plugins/2_156/vault.py
|
|
||||||
%%PYTHON_SITELIBDIR%%/ipaclient/remote_plugins/2_164/__init__.py
|
|
||||||
%%PYTHON_SITELIBDIR%%/ipaclient/remote_plugins/2_164/aci.py
|
|
||||||
%%PYTHON_SITELIBDIR%%/ipaclient/remote_plugins/2_164/automember.py
|
|
||||||
%%PYTHON_SITELIBDIR%%/ipaclient/remote_plugins/2_164/automount.py
|
|
||||||
%%PYTHON_SITELIBDIR%%/ipaclient/remote_plugins/2_164/batch.py
|
|
||||||
%%PYTHON_SITELIBDIR%%/ipaclient/remote_plugins/2_164/caacl.py
|
|
||||||
%%PYTHON_SITELIBDIR%%/ipaclient/remote_plugins/2_164/cert.py
|
|
||||||
%%PYTHON_SITELIBDIR%%/ipaclient/remote_plugins/2_164/certprofile.py
|
|
||||||
%%PYTHON_SITELIBDIR%%/ipaclient/remote_plugins/2_164/config.py
|
|
||||||
%%PYTHON_SITELIBDIR%%/ipaclient/remote_plugins/2_164/delegation.py
|
|
||||||
%%PYTHON_SITELIBDIR%%/ipaclient/remote_plugins/2_164/dns.py
|
|
||||||
%%PYTHON_SITELIBDIR%%/ipaclient/remote_plugins/2_164/domainlevel.py
|
|
||||||
%%PYTHON_SITELIBDIR%%/ipaclient/remote_plugins/2_164/group.py
|
|
||||||
%%PYTHON_SITELIBDIR%%/ipaclient/remote_plugins/2_164/hbacrule.py
|
|
||||||
%%PYTHON_SITELIBDIR%%/ipaclient/remote_plugins/2_164/hbacsvc.py
|
|
||||||
%%PYTHON_SITELIBDIR%%/ipaclient/remote_plugins/2_164/hbacsvcgroup.py
|
|
||||||
%%PYTHON_SITELIBDIR%%/ipaclient/remote_plugins/2_164/hbactest.py
|
|
||||||
%%PYTHON_SITELIBDIR%%/ipaclient/remote_plugins/2_164/host.py
|
|
||||||
%%PYTHON_SITELIBDIR%%/ipaclient/remote_plugins/2_164/hostgroup.py
|
|
||||||
%%PYTHON_SITELIBDIR%%/ipaclient/remote_plugins/2_164/idrange.py
|
|
||||||
%%PYTHON_SITELIBDIR%%/ipaclient/remote_plugins/2_164/idviews.py
|
|
||||||
%%PYTHON_SITELIBDIR%%/ipaclient/remote_plugins/2_164/internal.py
|
|
||||||
%%PYTHON_SITELIBDIR%%/ipaclient/remote_plugins/2_164/join.py
|
|
||||||
%%PYTHON_SITELIBDIR%%/ipaclient/remote_plugins/2_164/krbtpolicy.py
|
|
||||||
%%PYTHON_SITELIBDIR%%/ipaclient/remote_plugins/2_164/migration.py
|
|
||||||
%%PYTHON_SITELIBDIR%%/ipaclient/remote_plugins/2_164/misc.py
|
|
||||||
%%PYTHON_SITELIBDIR%%/ipaclient/remote_plugins/2_164/netgroup.py
|
|
||||||
%%PYTHON_SITELIBDIR%%/ipaclient/remote_plugins/2_164/otpconfig.py
|
|
||||||
%%PYTHON_SITELIBDIR%%/ipaclient/remote_plugins/2_164/otptoken.py
|
|
||||||
%%PYTHON_SITELIBDIR%%/ipaclient/remote_plugins/2_164/otptoken_yubikey.py
|
|
||||||
%%PYTHON_SITELIBDIR%%/ipaclient/remote_plugins/2_164/passwd.py
|
|
||||||
%%PYTHON_SITELIBDIR%%/ipaclient/remote_plugins/2_164/permission.py
|
|
||||||
%%PYTHON_SITELIBDIR%%/ipaclient/remote_plugins/2_164/ping.py
|
|
||||||
%%PYTHON_SITELIBDIR%%/ipaclient/remote_plugins/2_164/pkinit.py
|
|
||||||
%%PYTHON_SITELIBDIR%%/ipaclient/remote_plugins/2_164/privilege.py
|
|
||||||
%%PYTHON_SITELIBDIR%%/ipaclient/remote_plugins/2_164/pwpolicy.py
|
|
||||||
%%PYTHON_SITELIBDIR%%/ipaclient/remote_plugins/2_164/radiusproxy.py
|
|
||||||
%%PYTHON_SITELIBDIR%%/ipaclient/remote_plugins/2_164/realmdomains.py
|
|
||||||
%%PYTHON_SITELIBDIR%%/ipaclient/remote_plugins/2_164/role.py
|
|
||||||
%%PYTHON_SITELIBDIR%%/ipaclient/remote_plugins/2_164/selfservice.py
|
|
||||||
%%PYTHON_SITELIBDIR%%/ipaclient/remote_plugins/2_164/selinuxusermap.py
|
|
||||||
%%PYTHON_SITELIBDIR%%/ipaclient/remote_plugins/2_164/server.py
|
|
||||||
%%PYTHON_SITELIBDIR%%/ipaclient/remote_plugins/2_164/service.py
|
|
||||||
%%PYTHON_SITELIBDIR%%/ipaclient/remote_plugins/2_164/servicedelegation.py
|
|
||||||
%%PYTHON_SITELIBDIR%%/ipaclient/remote_plugins/2_164/session.py
|
|
||||||
%%PYTHON_SITELIBDIR%%/ipaclient/remote_plugins/2_164/stageuser.py
|
|
||||||
%%PYTHON_SITELIBDIR%%/ipaclient/remote_plugins/2_164/sudocmd.py
|
|
||||||
%%PYTHON_SITELIBDIR%%/ipaclient/remote_plugins/2_164/sudocmdgroup.py
|
|
||||||
%%PYTHON_SITELIBDIR%%/ipaclient/remote_plugins/2_164/sudorule.py
|
|
||||||
%%PYTHON_SITELIBDIR%%/ipaclient/remote_plugins/2_164/topology.py
|
|
||||||
%%PYTHON_SITELIBDIR%%/ipaclient/remote_plugins/2_164/trust.py
|
|
||||||
%%PYTHON_SITELIBDIR%%/ipaclient/remote_plugins/2_164/user.py
|
|
||||||
%%PYTHON_SITELIBDIR%%/ipaclient/remote_plugins/2_164/vault.py
|
|
||||||
%%PYTHON_SITELIBDIR%%/ipaclient/remote_plugins/2_49/__init__.py
|
|
||||||
%%PYTHON_SITELIBDIR%%/ipaclient/remote_plugins/2_49/aci.py
|
|
||||||
%%PYTHON_SITELIBDIR%%/ipaclient/remote_plugins/2_49/automember.py
|
|
||||||
%%PYTHON_SITELIBDIR%%/ipaclient/remote_plugins/2_49/automount.py
|
|
||||||
%%PYTHON_SITELIBDIR%%/ipaclient/remote_plugins/2_49/batch.py
|
|
||||||
%%PYTHON_SITELIBDIR%%/ipaclient/remote_plugins/2_49/cert.py
|
|
||||||
%%PYTHON_SITELIBDIR%%/ipaclient/remote_plugins/2_49/config.py
|
|
||||||
%%PYTHON_SITELIBDIR%%/ipaclient/remote_plugins/2_49/delegation.py
|
|
||||||
%%PYTHON_SITELIBDIR%%/ipaclient/remote_plugins/2_49/dns.py
|
|
||||||
%%PYTHON_SITELIBDIR%%/ipaclient/remote_plugins/2_49/entitle.py
|
|
||||||
%%PYTHON_SITELIBDIR%%/ipaclient/remote_plugins/2_49/group.py
|
|
||||||
%%PYTHON_SITELIBDIR%%/ipaclient/remote_plugins/2_49/hbacrule.py
|
|
||||||
%%PYTHON_SITELIBDIR%%/ipaclient/remote_plugins/2_49/hbacsvc.py
|
|
||||||
%%PYTHON_SITELIBDIR%%/ipaclient/remote_plugins/2_49/hbacsvcgroup.py
|
|
||||||
%%PYTHON_SITELIBDIR%%/ipaclient/remote_plugins/2_49/hbactest.py
|
|
||||||
%%PYTHON_SITELIBDIR%%/ipaclient/remote_plugins/2_49/host.py
|
|
||||||
%%PYTHON_SITELIBDIR%%/ipaclient/remote_plugins/2_49/hostgroup.py
|
|
||||||
%%PYTHON_SITELIBDIR%%/ipaclient/remote_plugins/2_49/idrange.py
|
|
||||||
%%PYTHON_SITELIBDIR%%/ipaclient/remote_plugins/2_49/internal.py
|
|
||||||
%%PYTHON_SITELIBDIR%%/ipaclient/remote_plugins/2_49/join.py
|
|
||||||
%%PYTHON_SITELIBDIR%%/ipaclient/remote_plugins/2_49/krbtpolicy.py
|
|
||||||
%%PYTHON_SITELIBDIR%%/ipaclient/remote_plugins/2_49/migration.py
|
|
||||||
%%PYTHON_SITELIBDIR%%/ipaclient/remote_plugins/2_49/misc.py
|
|
||||||
%%PYTHON_SITELIBDIR%%/ipaclient/remote_plugins/2_49/netgroup.py
|
|
||||||
%%PYTHON_SITELIBDIR%%/ipaclient/remote_plugins/2_49/passwd.py
|
|
||||||
%%PYTHON_SITELIBDIR%%/ipaclient/remote_plugins/2_49/permission.py
|
|
||||||
%%PYTHON_SITELIBDIR%%/ipaclient/remote_plugins/2_49/ping.py
|
|
||||||
%%PYTHON_SITELIBDIR%%/ipaclient/remote_plugins/2_49/pkinit.py
|
|
||||||
%%PYTHON_SITELIBDIR%%/ipaclient/remote_plugins/2_49/privilege.py
|
|
||||||
%%PYTHON_SITELIBDIR%%/ipaclient/remote_plugins/2_49/pwpolicy.py
|
|
||||||
%%PYTHON_SITELIBDIR%%/ipaclient/remote_plugins/2_49/role.py
|
|
||||||
%%PYTHON_SITELIBDIR%%/ipaclient/remote_plugins/2_49/selfservice.py
|
|
||||||
%%PYTHON_SITELIBDIR%%/ipaclient/remote_plugins/2_49/selinuxusermap.py
|
|
||||||
%%PYTHON_SITELIBDIR%%/ipaclient/remote_plugins/2_49/service.py
|
|
||||||
%%PYTHON_SITELIBDIR%%/ipaclient/remote_plugins/2_49/session.py
|
|
||||||
%%PYTHON_SITELIBDIR%%/ipaclient/remote_plugins/2_49/sudocmd.py
|
|
||||||
%%PYTHON_SITELIBDIR%%/ipaclient/remote_plugins/2_49/sudocmdgroup.py
|
|
||||||
%%PYTHON_SITELIBDIR%%/ipaclient/remote_plugins/2_49/sudorule.py
|
|
||||||
%%PYTHON_SITELIBDIR%%/ipaclient/remote_plugins/2_49/trust.py
|
|
||||||
%%PYTHON_SITELIBDIR%%/ipaclient/remote_plugins/2_49/user.py
|
|
||||||
%%PYTHON_SITELIBDIR%%/ipaclient/remote_plugins/__init__.py
|
|
||||||
%%PYTHON_SITELIBDIR%%/ipaclient/remote_plugins/compat.py
|
|
||||||
%%PYTHON_SITELIBDIR%%/ipaclient/remote_plugins/schema.py
|
|
||||||
%%PYTHON_SITELIBDIR%%/ipalib-%%DISTVERSION%%-py%%PYTHON_VER%%.egg-info/PKG-INFO
|
|
||||||
%%PYTHON_SITELIBDIR%%/ipalib-%%DISTVERSION%%-py%%PYTHON_VER%%.egg-info/SOURCES.txt
|
|
||||||
%%PYTHON_SITELIBDIR%%/ipalib-%%DISTVERSION%%-py%%PYTHON_VER%%.egg-info/dependency_links.txt
|
|
||||||
%%PYTHON_SITELIBDIR%%/ipalib-%%DISTVERSION%%-py%%PYTHON_VER%%.egg-info/requires.txt
|
|
||||||
%%PYTHON_SITELIBDIR%%/ipalib-%%DISTVERSION%%-py%%PYTHON_VER%%.egg-info/top_level.txt
|
|
||||||
%%PYTHON_SITELIBDIR%%/ipalib/__init__.py
|
|
||||||
%%PYTHON_SITELIBDIR%%/ipalib/aci.py
|
|
||||||
%%PYTHON_SITELIBDIR%%/ipalib/backend.py
|
|
||||||
%%PYTHON_SITELIBDIR%%/ipalib/base.py
|
|
||||||
%%PYTHON_SITELIBDIR%%/ipalib/capabilities.py
|
|
||||||
%%PYTHON_SITELIBDIR%%/ipalib/cli.py
|
|
||||||
%%PYTHON_SITELIBDIR%%/ipalib/config.py
|
|
||||||
%%PYTHON_SITELIBDIR%%/ipalib/constants.py
|
|
||||||
%%PYTHON_SITELIBDIR%%/ipalib/crud.py
|
|
||||||
%%PYTHON_SITELIBDIR%%/ipalib/dns.py
|
|
||||||
%%PYTHON_SITELIBDIR%%/ipalib/errors.py
|
|
||||||
%%PYTHON_SITELIBDIR%%/ipalib/facts.py
|
|
||||||
%%PYTHON_SITELIBDIR%%/ipalib/frontend.py
|
|
||||||
%%PYTHON_SITELIBDIR%%/ipalib/install/__init__.py
|
|
||||||
%%PYTHON_SITELIBDIR%%/ipalib/install/certmonger.py
|
|
||||||
%%PYTHON_SITELIBDIR%%/ipalib/install/certstore.py
|
|
||||||
%%PYTHON_SITELIBDIR%%/ipalib/install/dnsforwarders.py
|
|
||||||
%%PYTHON_SITELIBDIR%%/ipalib/install/hostname.py
|
|
||||||
%%PYTHON_SITELIBDIR%%/ipalib/install/kinit.py
|
|
||||||
%%PYTHON_SITELIBDIR%%/ipalib/install/service.py
|
|
||||||
%%PYTHON_SITELIBDIR%%/ipalib/install/sysrestore.py
|
|
||||||
%%PYTHON_SITELIBDIR%%/ipalib/install_files.txt
|
|
||||||
%%PYTHON_SITELIBDIR%%/ipalib/krb_utils.py
|
|
||||||
%%PYTHON_SITELIBDIR%%/ipalib/messages.py
|
|
||||||
%%PYTHON_SITELIBDIR%%/ipalib/misc.py
|
|
||||||
%%PYTHON_SITELIBDIR%%/ipalib/output.py
|
|
||||||
%%PYTHON_SITELIBDIR%%/ipalib/parameters.py
|
|
||||||
%%PYTHON_SITELIBDIR%%/ipalib/pkcs10.py
|
|
||||||
%%PYTHON_SITELIBDIR%%/ipalib/plugable.py
|
|
||||||
%%PYTHON_SITELIBDIR%%/ipalib/request.py
|
|
||||||
%%PYTHON_SITELIBDIR%%/ipalib/rpc.py
|
|
||||||
%%PYTHON_SITELIBDIR%%/ipalib/sysrestore.py
|
|
||||||
%%PYTHON_SITELIBDIR%%/ipalib/text.py
|
|
||||||
%%PYTHON_SITELIBDIR%%/ipalib/util.py
|
|
||||||
%%PYTHON_SITELIBDIR%%/ipalib/x509.py
|
|
||||||
%%PYTHON_SITELIBDIR%%/ipaplatform-%%DISTVERSION%%-py%%PYTHON_VER%%.egg-info/PKG-INFO
|
|
||||||
%%PYTHON_SITELIBDIR%%/ipaplatform-%%DISTVERSION%%-py%%PYTHON_VER%%.egg-info/SOURCES.txt
|
|
||||||
%%PYTHON_SITELIBDIR%%/ipaplatform-%%DISTVERSION%%-py%%PYTHON_VER%%.egg-info/dependency_links.txt
|
|
||||||
%%PYTHON_SITELIBDIR%%/ipaplatform-%%DISTVERSION%%-py%%PYTHON_VER%%.egg-info/requires.txt
|
|
||||||
%%PYTHON_SITELIBDIR%%/ipaplatform-%%DISTVERSION%%-py%%PYTHON_VER%%.egg-info/top_level.txt
|
|
||||||
%%PYTHON_SITELIBDIR%%/ipaplatform/__init__.py
|
|
||||||
%%PYTHON_SITELIBDIR%%/ipaplatform/_importhook.py
|
|
||||||
%%PYTHON_SITELIBDIR%%/ipaplatform/base/__init__.py
|
|
||||||
%%PYTHON_SITELIBDIR%%/ipaplatform/base/constants.py
|
|
||||||
%%PYTHON_SITELIBDIR%%/ipaplatform/base/paths.py
|
|
||||||
%%PYTHON_SITELIBDIR%%/ipaplatform/base/services.py
|
|
||||||
%%PYTHON_SITELIBDIR%%/ipaplatform/base/tasks.py
|
|
||||||
%%PYTHON_SITELIBDIR%%/ipaplatform/constants.py
|
|
||||||
%%PYTHON_SITELIBDIR%%/ipaplatform/debian/__init__.py
|
|
||||||
%%PYTHON_SITELIBDIR%%/ipaplatform/debian/constants.py
|
|
||||||
%%PYTHON_SITELIBDIR%%/ipaplatform/debian/paths.py
|
|
||||||
%%PYTHON_SITELIBDIR%%/ipaplatform/debian/services.py
|
|
||||||
%%PYTHON_SITELIBDIR%%/ipaplatform/debian/tasks.py
|
|
||||||
%%PYTHON_SITELIBDIR%%/ipaplatform/fedora/__init__.py
|
|
||||||
%%PYTHON_SITELIBDIR%%/ipaplatform/fedora/constants.py
|
|
||||||
%%PYTHON_SITELIBDIR%%/ipaplatform/fedora/paths.py
|
|
||||||
%%PYTHON_SITELIBDIR%%/ipaplatform/fedora/services.py
|
|
||||||
%%PYTHON_SITELIBDIR%%/ipaplatform/fedora/tasks.py
|
|
||||||
%%PYTHON_SITELIBDIR%%/ipaplatform/fedora_container/__init__.py
|
|
||||||
%%PYTHON_SITELIBDIR%%/ipaplatform/fedora_container/constants.py
|
|
||||||
%%PYTHON_SITELIBDIR%%/ipaplatform/fedora_container/paths.py
|
|
||||||
%%PYTHON_SITELIBDIR%%/ipaplatform/fedora_container/services.py
|
|
||||||
%%PYTHON_SITELIBDIR%%/ipaplatform/fedora_container/tasks.py
|
|
||||||
%%PYTHON_SITELIBDIR%%/ipaplatform/freebsd/__init__.py
|
|
||||||
%%PYTHON_SITELIBDIR%%/ipaplatform/install_files.txt
|
|
||||||
%%PYTHON_SITELIBDIR%%/ipaplatform/nixos/__init__.py
|
|
||||||
%%PYTHON_SITELIBDIR%%/ipaplatform/nixos/constants.py
|
|
||||||
%%PYTHON_SITELIBDIR%%/ipaplatform/nixos/paths.py
|
|
||||||
%%PYTHON_SITELIBDIR%%/ipaplatform/nixos/services.py
|
|
||||||
%%PYTHON_SITELIBDIR%%/ipaplatform/nixos/tasks.py
|
|
||||||
%%PYTHON_SITELIBDIR%%/ipaplatform/osinfo.py
|
|
||||||
%%PYTHON_SITELIBDIR%%/ipaplatform/override.py
|
|
||||||
%%PYTHON_SITELIBDIR%%/ipaplatform/paths.py
|
|
||||||
%%PYTHON_SITELIBDIR%%/ipaplatform/redhat/__init__.py
|
|
||||||
%%PYTHON_SITELIBDIR%%/ipaplatform/redhat/authconfig.py
|
|
||||||
%%PYTHON_SITELIBDIR%%/ipaplatform/redhat/constants.py
|
|
||||||
%%PYTHON_SITELIBDIR%%/ipaplatform/redhat/paths.py
|
|
||||||
%%PYTHON_SITELIBDIR%%/ipaplatform/redhat/services.py
|
|
||||||
%%PYTHON_SITELIBDIR%%/ipaplatform/redhat/tasks.py
|
|
||||||
%%PYTHON_SITELIBDIR%%/ipaplatform/rhel/__init__.py
|
|
||||||
%%PYTHON_SITELIBDIR%%/ipaplatform/rhel/constants.py
|
|
||||||
%%PYTHON_SITELIBDIR%%/ipaplatform/rhel/paths.py
|
|
||||||
%%PYTHON_SITELIBDIR%%/ipaplatform/rhel/services.py
|
|
||||||
%%PYTHON_SITELIBDIR%%/ipaplatform/rhel/tasks.py
|
|
||||||
%%PYTHON_SITELIBDIR%%/ipaplatform/rhel_container/__init__.py
|
|
||||||
%%PYTHON_SITELIBDIR%%/ipaplatform/rhel_container/constants.py
|
|
||||||
%%PYTHON_SITELIBDIR%%/ipaplatform/rhel_container/paths.py
|
|
||||||
%%PYTHON_SITELIBDIR%%/ipaplatform/rhel_container/services.py
|
|
||||||
%%PYTHON_SITELIBDIR%%/ipaplatform/rhel_container/tasks.py
|
|
||||||
%%PYTHON_SITELIBDIR%%/ipaplatform/services.py
|
|
||||||
%%PYTHON_SITELIBDIR%%/ipaplatform/suse/__init__.py
|
|
||||||
%%PYTHON_SITELIBDIR%%/ipaplatform/suse/constants.py
|
|
||||||
%%PYTHON_SITELIBDIR%%/ipaplatform/suse/paths.py
|
|
||||||
%%PYTHON_SITELIBDIR%%/ipaplatform/suse/services.py
|
|
||||||
%%PYTHON_SITELIBDIR%%/ipaplatform/suse/tasks.py
|
|
||||||
%%PYTHON_SITELIBDIR%%/ipaplatform/tasks.py
|
|
||||||
%%PYTHON_SITELIBDIR%%/ipapython-%%DISTVERSION%%-py%%PYTHON_VER%%.egg-info/PKG-INFO
|
|
||||||
%%PYTHON_SITELIBDIR%%/ipapython-%%DISTVERSION%%-py%%PYTHON_VER%%.egg-info/SOURCES.txt
|
|
||||||
%%PYTHON_SITELIBDIR%%/ipapython-%%DISTVERSION%%-py%%PYTHON_VER%%.egg-info/dependency_links.txt
|
|
||||||
%%PYTHON_SITELIBDIR%%/ipapython-%%DISTVERSION%%-py%%PYTHON_VER%%.egg-info/requires.txt
|
|
||||||
%%PYTHON_SITELIBDIR%%/ipapython-%%DISTVERSION%%-py%%PYTHON_VER%%.egg-info/top_level.txt
|
|
||||||
%%PYTHON_SITELIBDIR%%/ipapython/__init__.py
|
|
||||||
%%PYTHON_SITELIBDIR%%/ipapython/admintool.py
|
|
||||||
%%PYTHON_SITELIBDIR%%/ipapython/certdb.py
|
|
||||||
%%PYTHON_SITELIBDIR%%/ipapython/config.py
|
|
||||||
%%PYTHON_SITELIBDIR%%/ipapython/cookie.py
|
|
||||||
%%PYTHON_SITELIBDIR%%/ipapython/directivesetter.py
|
|
||||||
%%PYTHON_SITELIBDIR%%/ipapython/dn.py
|
|
||||||
%%PYTHON_SITELIBDIR%%/ipapython/dn_ctypes.py
|
|
||||||
%%PYTHON_SITELIBDIR%%/ipapython/dnsutil.py
|
|
||||||
%%PYTHON_SITELIBDIR%%/ipapython/dogtag.py
|
|
||||||
%%PYTHON_SITELIBDIR%%/ipapython/errors.py
|
|
||||||
%%PYTHON_SITELIBDIR%%/ipapython/fqdn.py
|
|
||||||
%%PYTHON_SITELIBDIR%%/ipapython/graph.py
|
|
||||||
%%PYTHON_SITELIBDIR%%/ipapython/install/__init__.py
|
|
||||||
%%PYTHON_SITELIBDIR%%/ipapython/install/cli.py
|
|
||||||
%%PYTHON_SITELIBDIR%%/ipapython/install/common.py
|
|
||||||
%%PYTHON_SITELIBDIR%%/ipapython/install/core.py
|
|
||||||
%%PYTHON_SITELIBDIR%%/ipapython/install/typing.py
|
|
||||||
%%PYTHON_SITELIBDIR%%/ipapython/install/util.py
|
|
||||||
%%PYTHON_SITELIBDIR%%/ipapython/install_files.txt
|
|
||||||
%%PYTHON_SITELIBDIR%%/ipapython/ipa_log_manager.py
|
|
||||||
%%PYTHON_SITELIBDIR%%/ipapython/ipachangeconf.py
|
|
||||||
%%PYTHON_SITELIBDIR%%/ipapython/ipaldap.py
|
|
||||||
%%PYTHON_SITELIBDIR%%/ipapython/ipautil.py
|
|
||||||
%%PYTHON_SITELIBDIR%%/ipapython/ipavalidate.py
|
|
||||||
%%PYTHON_SITELIBDIR%%/ipapython/kerberos.py
|
|
||||||
%%PYTHON_SITELIBDIR%%/ipapython/kernel_keyring.py
|
|
||||||
%%PYTHON_SITELIBDIR%%/ipapython/nsslib.py
|
|
||||||
%%PYTHON_SITELIBDIR%%/ipapython/session_storage.py
|
|
||||||
%%PYTHON_SITELIBDIR%%/ipapython/ssh.py
|
|
||||||
%%PYTHON_SITELIBDIR%%/ipapython/version.py
|
|
||||||
libexec/ipa/acme/certbot-dns-ipa
|
|
||||||
share/man/man1/ipa-certupdate.1.gz
|
|
||||||
share/man/man1/ipa-client-automount.1.gz
|
|
||||||
share/man/man1/ipa-client-install.1.gz
|
|
||||||
share/man/man1/ipa-client-samba.1.gz
|
|
||||||
share/man/man1/ipa-epn.1.gz
|
|
||||||
share/man/man1/ipa-getkeytab.1.gz
|
|
||||||
share/man/man1/ipa-join.1.gz
|
|
||||||
share/man/man1/ipa-rmkeytab.1.gz
|
|
||||||
share/man/man1/ipa.1.gz
|
|
||||||
share/man/man5/default.conf.5.gz
|
|
||||||
share/man/man5/epn.conf.5.gz
|
|
||||||
sbin/ipa-certupdate
|
|
||||||
sbin/ipa-client-automount
|
|
||||||
sbin/ipa-client-install
|
|
||||||
sbin/ipa-client-samba
|
|
||||||
sbin/ipa-epn
|
|
||||||
sbin/ipa-getkeytab
|
|
||||||
sbin/ipa-join
|
|
||||||
sbin/ipa-rmkeytab
|
|
||||||
share/ipa/client/freeipa.template
|
|
||||||
share/ipa/client/ssh_ipa.conf.template
|
|
||||||
share/ipa/client/sshd_ipa.conf.template
|
|
||||||
share/locale/bn_IN/LC_MESSAGES/ipa.mo
|
|
||||||
share/locale/ca/LC_MESSAGES/ipa.mo
|
|
||||||
share/locale/cs/LC_MESSAGES/ipa.mo
|
|
||||||
share/locale/de/LC_MESSAGES/ipa.mo
|
|
||||||
share/locale/en_GB/LC_MESSAGES/ipa.mo
|
|
||||||
share/locale/es/LC_MESSAGES/ipa.mo
|
|
||||||
share/locale/eu/LC_MESSAGES/ipa.mo
|
|
||||||
share/locale/fi/LC_MESSAGES/ipa.mo
|
|
||||||
share/locale/fr/LC_MESSAGES/ipa.mo
|
|
||||||
share/locale/hi/LC_MESSAGES/ipa.mo
|
|
||||||
share/locale/hu/LC_MESSAGES/ipa.mo
|
|
||||||
share/locale/id/LC_MESSAGES/ipa.mo
|
|
||||||
share/locale/ja/LC_MESSAGES/ipa.mo
|
|
||||||
share/locale/ka/LC_MESSAGES/ipa.mo
|
|
||||||
share/locale/kn/LC_MESSAGES/ipa.mo
|
|
||||||
share/locale/ko/LC_MESSAGES/ipa.mo
|
|
||||||
share/locale/mr/LC_MESSAGES/ipa.mo
|
|
||||||
share/locale/nl/LC_MESSAGES/ipa.mo
|
|
||||||
share/locale/pa/LC_MESSAGES/ipa.mo
|
|
||||||
share/locale/pl/LC_MESSAGES/ipa.mo
|
|
||||||
share/locale/pt/LC_MESSAGES/ipa.mo
|
|
||||||
share/locale/pt_BR/LC_MESSAGES/ipa.mo
|
|
||||||
share/locale/ru/LC_MESSAGES/ipa.mo
|
|
||||||
share/locale/sk/LC_MESSAGES/ipa.mo
|
|
||||||
share/locale/tg/LC_MESSAGES/ipa.mo
|
|
||||||
share/locale/tr/LC_MESSAGES/ipa.mo
|
|
||||||
share/locale/uk/LC_MESSAGES/ipa.mo
|
|
||||||
share/locale/zh_CN/LC_MESSAGES/ipa.mo
|
|
||||||
@dir etc/ipa/nssdb
|
|
||||||
@dir share/selinux/packages/targeted
|
|
||||||
@dir /var/lib/ipa-client/pki
|
|
||||||
@dir /var/lib/ipa-client/sysrestore
|
|
||||||
@dir /var/lib/ipa-client
|
|
||||||
@dir /var/lib
|
|
||||||
@ -1,707 +0,0 @@
|
|||||||
PORTNAME= ${SAMBA4_BASENAME}420
|
|
||||||
PORTVERSION= ${SAMBA4_VERSION}
|
|
||||||
#PORTREVISION= 7
|
|
||||||
CATEGORIES?= net
|
|
||||||
MASTER_SITES= SAMBA/samba/stable SAMBA/samba/rc
|
|
||||||
DISTNAME= ${SAMBA4_DISTNAME}
|
|
||||||
|
|
||||||
MAINTAINER= samba@FreeBSD.org
|
|
||||||
COMMENT= Free SMB/CIFS and AD/DC server and client for Unix
|
|
||||||
WWW= https://gitlab.com/samba-freebsd/
|
|
||||||
|
|
||||||
LICENSE= GPLv3+
|
|
||||||
LICENSE_FILE= ${WRKSRC}/COPYING
|
|
||||||
|
|
||||||
USES= cpe
|
|
||||||
|
|
||||||
CONFLICTS_INSTALL?= samba4*
|
|
||||||
|
|
||||||
EXTRA_PATCHES= \
|
|
||||||
${PATCHDIR}/0001-Compact-and-simplify-modules-build-and-config-genera.patch:-p1 \
|
|
||||||
${PATCHDIR}/0002-Adjust-abi_gen.sh-script-to-run-under-FreeBSD-with-i.patch:-p1 \
|
|
||||||
${PATCHDIR}/0003-Mask-CLang-prototype-warnings-in-kadm5-admin.h.patch:-p1 \
|
|
||||||
${PATCHDIR}/0004-On-FreeBSD-date-1-has-different-semantics-than-on-Li.patch:-p1 \
|
|
||||||
${PATCHDIR}/0005-Include-jemalloc-jemalloc.h-if-ENABLE_JEMALLOC-is-se.patch:-p1 \
|
|
||||||
${PATCHDIR}/0006-Install-nss_-modules-into-PAMMODULESDIR-path.patch:-p1 \
|
|
||||||
${PATCHDIR}/0007-Use-macro-value-as-a-default-backlog-size-for-the-li.patch:-p1 \
|
|
||||||
${PATCHDIR}/0008-Brute-force-work-around-usage-of-Linux-specific-m-fl.patch:-p1 \
|
|
||||||
${PATCHDIR}/0009-Make-sure-that-config-checks-fail-if-the-warning-is-.patch:-p1 \
|
|
||||||
${PATCHDIR}/0010-Add-option-with-pkgconfigdir-to-specify-alternative-.patch:-p1 \
|
|
||||||
${PATCHDIR}/0011-Use-provided-by-port-location-of-the-XML-catalog.patch:-p1 \
|
|
||||||
${PATCHDIR}/0012-Create-shared-libraries-according-to-the-FreeBSD-spe.patch:-p1 \
|
|
||||||
${PATCHDIR}/0013-Pass-additional-msg-parameter-to-CHECK_LIB-so-it-can.patch:-p1 \
|
|
||||||
${PATCHDIR}/0014-Add-option-to-disable-CTDB-tests-failing-on-FreeBSD-.patch:-p1 \
|
|
||||||
${PATCHDIR}/0015-Add-extra-debug-class-to-trck-down-DB-locking-code.patch:-p1 \
|
|
||||||
${PATCHDIR}/0016-Make-ldb_schema_attribute_compare-a-stable-comparisi.patch:-p1 \
|
|
||||||
${PATCHDIR}/0017-Use-arc4random-when-available-to-generate-random-tal.patch:-p1 \
|
|
||||||
${PATCHDIR}/0018-Add-configuration-option-that-allows-to-choose-alter.patch:-p1 \
|
|
||||||
${PATCHDIR}/0019-From-923bc7a1afeb0b920e60e14846987ae1d2d7dca4-Mon-Se.patch:-p1 \
|
|
||||||
${PATCHDIR}/0020-FreeBSD-12-between-r336017-and-r342928-wrongfuly-ret.patch:-p1 \
|
|
||||||
${PATCHDIR}/0021-Fix-casting-warnings-in-the-nfs_quota-debug-message.patch:-p1 \
|
|
||||||
${PATCHDIR}/0022-Clean-up-UTMP-handling-code-and-add-FreeBSD-support..patch:-p1 \
|
|
||||||
${PATCHDIR}/0023-Add-cmd_get_quota-test-function-into-vfstest-to-test.patch:-p1 \
|
|
||||||
${PATCHDIR}/0024-Cherry-pick-ZFS-provisioning-code-by-iXsystems-Inc.patch:-p1 \
|
|
||||||
${PATCHDIR}/0025-From-d9b748869a8f4018ebee302aae8246bf29f60309-Mon-Se.patch:-p1 \
|
|
||||||
${PATCHDIR}/0026-vfs-add-a-compatibility-option-to-the-vfs_streams_xa.patch:-p1 \
|
|
||||||
${PATCHDIR}/0027-Add-VFS-module-vfs_freebsd-that-implements-FreeBSD-s.patch:-p1 \
|
|
||||||
${PATCHDIR}/0028-Fix-rl_completion_func_t.patch:-p1 \
|
|
||||||
${PATCHDIR}/0028-s3-lib-system-add-FreeBSD-proc_fd_pattern.patch \
|
|
||||||
${PATCHDIR}/0100-Fix-pathref-handling-for-FreeBSD-13plus_samba42x.patch:-p1 \
|
|
||||||
${PATCHDIR}/0101-FreeBSD-add-fdescfs-paths-workaround.patch:-p1 \
|
|
||||||
${PATCHDIR}/0102-FreeBSD-vfs_freebsd-fix-sys_proc_fd_path-args.patch:-p1
|
|
||||||
|
|
||||||
SAMBA4_BASENAME= samba
|
|
||||||
SAMBA4_PORTNAME= ${SAMBA4_BASENAME}4
|
|
||||||
SAMBA4_VERSION= 4.20.7
|
|
||||||
SAMBA4_DISTNAME= ${SAMBA4_BASENAME}-${SAMBA4_VERSION:S|.p|pre|:S|.r|rc|:S|.t|tp|:S|.a|alpha|}
|
|
||||||
|
|
||||||
WRKSRC?= ${WRKDIR}/${DISTNAME}
|
|
||||||
PLIST?= ${PKGDIR}/pkg-plist
|
|
||||||
|
|
||||||
CPE_VENDOR= samba
|
|
||||||
CPE_PRODUCT= samba
|
|
||||||
# Directories
|
|
||||||
VARDIR= ${DESTDIR}/var
|
|
||||||
SAMBA4_RUNDIR= ${VARDIR}/run/${SAMBA4_PORTNAME}
|
|
||||||
SAMBA4_LOGDIR= ${VARDIR}/log/${SAMBA4_PORTNAME}
|
|
||||||
SAMBA4_LOCKDIR= ${VARDIR}/db/${SAMBA4_PORTNAME}
|
|
||||||
SAMBA4_BINDDNSDIR= ${SAMBA4_LOCKDIR}/bind-dns
|
|
||||||
SAMBA4_PRIVATEDIR= ${SAMBA4_LOCKDIR}/private
|
|
||||||
SAMBA4_PAMDIR= ${PREFIX}/lib
|
|
||||||
SAMBA4_LIBDIR= ${PREFIX}/lib/${SAMBA4_PORTNAME}
|
|
||||||
SAMBA4_INCLUDEDIR= ${PREFIX}/include/${SAMBA4_PORTNAME}
|
|
||||||
SAMBA4_CONFDIR= ${PREFIX}/etc
|
|
||||||
SAMBA4_CONFIG= smb4.conf
|
|
||||||
SAMBA4_MODULES_CLASS= auth bind9 gensec gpext idmap ldb nss_info \
|
|
||||||
pdb perfcount process_model service vfs
|
|
||||||
|
|
||||||
CONFIGURE_ARGS= --mandir="${PREFIX}/share/man" \
|
|
||||||
--sysconfdir="${SAMBA4_CONFDIR}" \
|
|
||||||
--includedir="${SAMBA4_INCLUDEDIR}" \
|
|
||||||
--datadir="${DATADIR}" \
|
|
||||||
--libdir="${SAMBA4_LIBDIR}" \
|
|
||||||
--with-privatelibdir="${SAMBA4_LIBDIR}/private" \
|
|
||||||
--with-pammodulesdir="${SAMBA4_PAMDIR}" \
|
|
||||||
--with-modulesdir="${SAMBA4_MODULEDIR}" \
|
|
||||||
--with-pkgconfigdir="${PKGCONFIGDIR}" \
|
|
||||||
--localstatedir="${VARDIR}" \
|
|
||||||
--with-piddir="${SAMBA4_RUNDIR}" \
|
|
||||||
--with-sockets-dir="${SAMBA4_RUNDIR}" \
|
|
||||||
--with-privileged-socket-dir="${SAMBA4_RUNDIR}" \
|
|
||||||
--with-lockdir="${SAMBA4_LOCKDIR}" \
|
|
||||||
--with-statedir="${SAMBA4_LOCKDIR}" \
|
|
||||||
--with-cachedir="${SAMBA4_LOCKDIR}" \
|
|
||||||
--with-bind-dns-dir=${SAMBA4_BINDDNSDIR} \
|
|
||||||
--with-privatedir="${SAMBA4_PRIVATEDIR}" \
|
|
||||||
--with-logfilebase="${SAMBA4_LOGDIR}"
|
|
||||||
# XXX: Flags
|
|
||||||
CONFIGURE_ENV= PTHREAD_LDFLAGS="-lpthread" \
|
|
||||||
PYTHONHASHSEED=1
|
|
||||||
MAKE_ENV= PYTHONHASHSEED=1
|
|
||||||
|
|
||||||
USES= compiler:c++11-lang iconv localbase:ldflags \
|
|
||||||
perl5 pkgconfig shebangfix waf gettext-runtime
|
|
||||||
USE_PERL5= build
|
|
||||||
USE_LDCONFIG= ${SAMBA4_LIBDIR}
|
|
||||||
WAF_CMD= buildtools/bin/waf
|
|
||||||
CONFIGURE_LOG= bin/config.log
|
|
||||||
|
|
||||||
# Make sure that the right version of Python is used by the tools
|
|
||||||
# https://bugzilla.samba.org/show_bug.cgi?id=7305
|
|
||||||
SHEBANG_FILES= source3/script* source4/scripting/bin/* selftest/*
|
|
||||||
|
|
||||||
PKGCONFIGDIR?= ${PREFIX}/libdata/pkgconfig
|
|
||||||
PKGCONFIGDIR_REL?= ${PKGCONFIGDIR:S,^${PREFIX}/,,}
|
|
||||||
PLIST_SUB= PKGCONFIGDIR=${PKGCONFIGDIR_REL}
|
|
||||||
SUB_LIST= PKGCONFIGDIR=${PKGCONFIGDIR_REL}
|
|
||||||
##############################################################################
|
|
||||||
OPTIONS_SUB= yes
|
|
||||||
|
|
||||||
OPTIONS_DEFINE= AD_DC ADS CLUSTER CUPS DOCS FAM GPGME \
|
|
||||||
LDAP MANDOC PROFILE PYTHON3 QUOTAS \
|
|
||||||
SPOTLIGHT SYSLOG UTMP
|
|
||||||
#OPTIONS_DEFINE+= DEVELOPER MEMORY_DEBUG
|
|
||||||
|
|
||||||
OPTIONS_GROUP= VFS
|
|
||||||
OPTIONS_GROUP_VFS= FRUIT GLUSTERFS
|
|
||||||
|
|
||||||
OPTIONS_SINGLE= GSSAPI ZEROCONF
|
|
||||||
|
|
||||||
OPTIONS_SINGLE_GSSAPI= GSSAPI_BUILTIN GSSAPI_MIT
|
|
||||||
#GSSAPI_HEIMDAL
|
|
||||||
OPTIONS_SINGLE_ZEROCONF= ZEROCONF_NONE AVAHI MDNSRESPONDER
|
|
||||||
|
|
||||||
# Make those default options
|
|
||||||
OPTIONS_DEFAULT= AD_DC ADS DOCS FAM LDAP \
|
|
||||||
PROFILE PYTHON3 QUOTAS SYSLOG UTMP \
|
|
||||||
FRUIT GSSAPI_BUILTIN AVAHI
|
|
||||||
##############################################################################
|
|
||||||
ADS_DESC= Active Directory client(implies LDAP)
|
|
||||||
AD_DC_DESC= Active Directory Domain Controller(implies PYTHON3)
|
|
||||||
CLUSTER_DESC= Clustering support
|
|
||||||
DEVELOPER_DESC= With developer framework
|
|
||||||
FAM_DESC= File Alteration Monitor
|
|
||||||
GPGME_DESC= GpgME support
|
|
||||||
LDAP_DESC= LDAP client
|
|
||||||
LIBZFS_DESC= LibZFS
|
|
||||||
SPOTLIGHT_DESC= Spotlight server-side search support
|
|
||||||
MANDOC_DESC= Build manpages from DOCBOOK templates
|
|
||||||
MEMORY_DEBUG_DESC= Debug memory allocator
|
|
||||||
PICKY_DEVELOPER_DESC= Treat compiler warnings as errors(implies DEVELOPER)
|
|
||||||
PROFILE_DESC= Profiling data
|
|
||||||
QUOTAS_DESC= Disk quota support
|
|
||||||
UTMP_DESC= UTMP accounting
|
|
||||||
|
|
||||||
VFS_DESC= VFS modules
|
|
||||||
FRUIT_DESC= MacOSX and TimeMachine support
|
|
||||||
GLUSTERFS_DESC= GlusterFS support
|
|
||||||
|
|
||||||
GSSAPI_BUILTIN_DESC= GSSAPI support via bundled Heimdal
|
|
||||||
|
|
||||||
ZEROCONF_DESC= Zero configuration networking
|
|
||||||
ZEROCONF_NONE_DESC= Zeroconf support is absent
|
|
||||||
##############################################################################
|
|
||||||
# XXX: Unconditional dependencies which can't be switched off(if present in
|
|
||||||
# the system)
|
|
||||||
|
|
||||||
# Iconv(picked up unconditionaly)
|
|
||||||
LIB_DEPENDS= libiconv.so:converters/libiconv
|
|
||||||
# unwind
|
|
||||||
LIB_DEPENDS+= libunwind.so:devel/libunwind
|
|
||||||
# Readline(sponsored by Python)
|
|
||||||
# XXX: USES=readline pollutes CPPFLAGS, so we explicitly put dependency
|
|
||||||
LIB_DEPENDS+= libreadline.so:devel/readline
|
|
||||||
# popt
|
|
||||||
LIB_DEPENDS+= libpopt.so:devel/popt
|
|
||||||
# inotify
|
|
||||||
LIB_DEPENDS+= libinotify.so:devel/libinotify
|
|
||||||
# GNUTLS
|
|
||||||
LIB_DEPENDS+= libgnutls.so:security/gnutls
|
|
||||||
LIB_DEPENDS+= libgcrypt.so:security/libgcrypt
|
|
||||||
# NFSv4 ACL glue
|
|
||||||
LIB_DEPENDS+= libsunacl.so:sysutils/libsunacl
|
|
||||||
# Jansson
|
|
||||||
BUILD_DEPENDS+= jansson>=2.10:devel/jansson
|
|
||||||
RUN_DEPENDS+= jansson>=2.10:devel/jansson
|
|
||||||
# tasn1
|
|
||||||
BUILD_DEPENDS+= libtasn1>=3.8:security/libtasn1
|
|
||||||
RUN_DEPENDS+= libtasn1>=3.8:security/libtasn1
|
|
||||||
# External Samba dependencies
|
|
||||||
# Needed for IDL compiler
|
|
||||||
BUILD_DEPENDS+= p5-Parse-Yapp>=0:devel/p5-Parse-Yapp
|
|
||||||
|
|
||||||
# Libarchive
|
|
||||||
SAMBA4_BUNDLED_LIBS= !libarchive
|
|
||||||
BUILD_DEPENDS+= libarchive>=3.1.2:archivers/libarchive
|
|
||||||
RUN_DEPENDS+= libarchive>=3.1.2:archivers/libarchive
|
|
||||||
|
|
||||||
### Bundled libraries
|
|
||||||
SAMBA4_BUNDLED_CMOCKA?= no
|
|
||||||
SAMBA4_BUNDLED_TALLOC?= no
|
|
||||||
SAMBA4_BUNDLED_TEVENT?= no
|
|
||||||
SAMBA4_BUNDLED_TDB?= no
|
|
||||||
SAMBA4_BUNDLED_LDB?= no
|
|
||||||
# cmocka
|
|
||||||
.if defined(SAMBA4_BUNDLED_CMOCKA) && ${SAMBA4_BUNDLED_CMOCKA} == yes
|
|
||||||
SAMBA4_BUNDLED_LIBS+= cmocka
|
|
||||||
CONFLICTS_INSTALL+= cmocka-1.*
|
|
||||||
PLIST_SUB+= SAMBA4_BUNDLED_CMOCKA=""
|
|
||||||
SUB_LIST+= SAMBA4_BUNDLED_CMOCKA=""
|
|
||||||
.else
|
|
||||||
SAMBA4_BUNDLED_LIBS+= !cmocka
|
|
||||||
BUILD_DEPENDS+= cmocka>=1.1.3:sysutils/cmocka
|
|
||||||
TEST_DEPENDS+= cmocka>=1.1.3:sysutils/cmocka
|
|
||||||
PLIST_SUB+= SAMBA4_BUNDLED_CMOCKA="@comment "
|
|
||||||
SUB_LIST+= SAMBA4_BUNDLED_CMOCKA="@comment "
|
|
||||||
.endif
|
|
||||||
# talloc
|
|
||||||
.if defined(SAMBA4_BUNDLED_TALLOC) && ${SAMBA4_BUNDLED_TALLOC} == yes
|
|
||||||
SAMBA4_BUNDLED_LIBS+= talloc
|
|
||||||
PLIST_SUB+= SAMBA4_BUNDLED_TALLOC=""
|
|
||||||
SUB_LIST+= SAMBA4_BUNDLED_TALLOC=""
|
|
||||||
.else
|
|
||||||
SAMBA4_BUNDLED_LIBS+= !talloc
|
|
||||||
BUILD_DEPENDS+= talloc>=2.4.2:devel/talloc242
|
|
||||||
RUN_DEPENDS+= talloc>=2.4.2:devel/talloc242
|
|
||||||
PLIST_SUB+= SAMBA4_BUNDLED_TALLOC="@comment "
|
|
||||||
SUB_LIST+= SAMBA4_BUNDLED_TALLOC="@comment "
|
|
||||||
.endif
|
|
||||||
# tevent
|
|
||||||
.if defined(SAMBA4_BUNDLED_TEVENT) && ${SAMBA4_BUNDLED_TEVENT} == yes
|
|
||||||
SAMBA4_BUNDLED_LIBS+= tevent
|
|
||||||
CONFLICTS_INSTALL+= tevent-* tevent1-*
|
|
||||||
PLIST_SUB+= SAMBA4_BUNDLED_TEVENT=""
|
|
||||||
SUB_LIST+= SAMBA4_BUNDLED_TEVENT=""
|
|
||||||
.else
|
|
||||||
SAMBA4_BUNDLED_LIBS+= !tevent
|
|
||||||
BUILD_DEPENDS+= tevent>=0.16.1:devel/tevent016
|
|
||||||
RUN_DEPENDS+= tevent>=0.16.1:devel/tevent016
|
|
||||||
PLIST_SUB+= SAMBA4_BUNDLED_TEVENT="@comment "
|
|
||||||
SUB_LIST+= SAMBA4_BUNDLED_TEVENT="@comment "
|
|
||||||
.endif
|
|
||||||
# tdb
|
|
||||||
.if defined(SAMBA4_BUNDLED_TDB) && ${SAMBA4_BUNDLED_TDB} == yes
|
|
||||||
SAMBA4_BUNDLED_LIBS+= tdb
|
|
||||||
CONFLICTS_INSTALL+= tdb-* tdb1-*
|
|
||||||
PLIST_SUB+= SAMBA4_BUNDLED_TDB=""
|
|
||||||
SUB_LIST+= SAMBA4_BUNDLED_TDB=""
|
|
||||||
.else
|
|
||||||
SAMBA4_BUNDLED_LIBS+= !tdb
|
|
||||||
BUILD_DEPENDS+= tdb>=1.4.10:databases/tdb1410
|
|
||||||
RUN_DEPENDS+= tdb>=1.4.10:databases/tdb1410
|
|
||||||
PLIST_SUB+= SAMBA4_BUNDLED_TDB="@comment "
|
|
||||||
SUB_LIST+= SAMBA4_BUNDLED_TDB="@comment "
|
|
||||||
.endif
|
|
||||||
# ldb
|
|
||||||
.if defined(SAMBA4_BUNDLED_LDB) && ${SAMBA4_BUNDLED_LDB} == yes
|
|
||||||
SAMBA4_BUNDLED_LDB= yes
|
|
||||||
SAMBA4_BUNDLED_LIBS+= ldb
|
|
||||||
PLIST_SUB+= SAMBA4_BUNDLED_LDB=""
|
|
||||||
SUB_LIST+= SAMBA4_BUNDLED_LDB=""
|
|
||||||
SAMBA4_MODULEDIR= ${SAMBA4_LIBDIR}/modules
|
|
||||||
.else
|
|
||||||
SAMBA4_BUNDLED_LIBS+= !ldb
|
|
||||||
BUILD_DEPENDS+= ldb29>=2.9.1:databases/ldb29
|
|
||||||
RUN_DEPENDS+= ldb29>=2.9.1:databases/ldb29
|
|
||||||
PLIST_SUB+= SAMBA4_BUNDLED_LDB="@comment "
|
|
||||||
SUB_LIST+= SAMBA4_BUNDLED_LDB="@comment "
|
|
||||||
SAMBA4_MODULEDIR= ${PREFIX}/lib/shared-modules
|
|
||||||
.endif
|
|
||||||
|
|
||||||
.if (defined(SAMBA4_BUNDLED_TALLOC) && ${SAMBA4_BUNDLED_TALLOC} == yes) \
|
|
||||||
|| (defined(SAMBA4_BUNDLED_TDB) && ${SAMBA4_BUNDLED_TDB} == yes) \
|
|
||||||
|| (defined(SAMBA4_BUNDLED_LDB) && ${SAMBA4_BUNDLED_LDB} == yes) \
|
|
||||||
|| (defined(SAMBA4_BUNDLED_TEVENT) && ${SAMBA4_BUNDLED_TEVENT} == yes)
|
|
||||||
SAMBA4_BUNDLED_LIBS+= replace
|
|
||||||
.endif
|
|
||||||
# Don't use external libcom_err
|
|
||||||
SAMBA4_BUNDLED_LIBS+= com_err
|
|
||||||
# Set the test environment variables
|
|
||||||
TEST_USES= python
|
|
||||||
TEST_ENV= PYTHON="${PYTHON_CMD}" \
|
|
||||||
SHA1SUM=/sbin/sha1 \
|
|
||||||
SHA256SUM=/sbin/sha256 \
|
|
||||||
MD5SUM=/sbin/md5 \
|
|
||||||
PYTHONDONTWRITEBYTECODE=1
|
|
||||||
|
|
||||||
TEST_DEPENDS= bash:shells/bash \
|
|
||||||
tshark:net/wireshark@nox11
|
|
||||||
# External Python modules
|
|
||||||
TEST_BUILD_DEPENDS= ${PYTHON_PKGNAMEPREFIX}iso8601>=0.1.11:devel/py-iso8601@${PY_FLAVOR}
|
|
||||||
TEST_RUN_DEPENDS= ${PYTHON_PKGNAMEPREFIX}iso8601>=0.1.11:devel/py-iso8601@${PY_FLAVOR}
|
|
||||||
##############################################################################
|
|
||||||
CONFIGURE_ARGS+= \
|
|
||||||
--with-pam \
|
|
||||||
--with-iconv \
|
|
||||||
--with-winbind \
|
|
||||||
--with-regedit \
|
|
||||||
--disable-rpath \
|
|
||||||
--without-lttng \
|
|
||||||
--without-gettext \
|
|
||||||
--enable-pthreadpool \
|
|
||||||
--without-fake-kaserver \
|
|
||||||
--without-systemd \
|
|
||||||
--with-libarchive \
|
|
||||||
--with-acl-support \
|
|
||||||
--with-sendfile-support \
|
|
||||||
--disable-ctdb-tests
|
|
||||||
# ${ICONV_CONFIGURE_BASE}
|
|
||||||
##############################################################################
|
|
||||||
FRUIT_PREVENTS= ZEROCONF_NONE
|
|
||||||
FRUIT_PREVENTS_MSG= MacOSX support requires Zeroconf(AVAHI or MDNSRESPONDER)
|
|
||||||
FRUIT_VARS= SAMBA4_MODULES+=vfs_fruit
|
|
||||||
FRUIT_PLIST_FILES= share/man/man8/vfs_fruit.8.gz
|
|
||||||
|
|
||||||
GLUSTERFS_CONFIGURE_ENABLE= glusterfs
|
|
||||||
GLUSTERFS_LIB_DEPENDS= libglusterfs.so:net/glusterfs
|
|
||||||
GLUSTERFS_VARS= SAMBA4_MODULES+=vfs_glusterfs
|
|
||||||
GLUSTERFS_PLIST_FILES= share/man/man8/vfs_glusterfs.8.gz
|
|
||||||
|
|
||||||
ZEROCONF_NONE_MAKE_ENV= ZEROCONF=none
|
|
||||||
##############################################################################
|
|
||||||
AVAHI_CONFIGURE_ENABLE= avahi
|
|
||||||
AVAHI_LIB_DEPENDS= libavahi-client.so:net/avahi-app
|
|
||||||
AVAHI_VARS= SAMBA4_SERVICES+=avahi_daemon
|
|
||||||
|
|
||||||
MDNSRESPONDER_CONFIGURE_ENABLE= dnssd
|
|
||||||
MDNSRESPONDER_LIB_DEPENDS= libdns_sd.so:net/mDNSResponder
|
|
||||||
MDNSRESPONDER_VARS= SAMBA4_SERVICES+=mdnsd
|
|
||||||
##############################################################################
|
|
||||||
MEMORY_DEBUG_IMPLIES= DEBUG
|
|
||||||
MEMORY_DEBUG_CONFIGURE_ENV= ADDITIONAL_CFLAGS="-DENABLE_JEMALLOC `pkg-config --cflags jemalloc`" ADDITIONAL_LDFLAGS="`pkg-config --libs jemalloc`"
|
|
||||||
MEMORY_DEBUG_LIB_DEPENDS= libjemalloc.so.2:devel/jemalloc
|
|
||||||
# https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=194046
|
|
||||||
GDB_CMD?= ${LOCALBASE}/bin/gdb
|
|
||||||
# https://bugzilla.samba.org/show_bug.cgi?id=8969
|
|
||||||
PICKY_DEVELOPER_IMPLIES= DEVELOPER
|
|
||||||
PICKY_DEVELOPER_CONFIGURE_ON= --picky-developer
|
|
||||||
|
|
||||||
DEVELOPER_CONFIGURE_ON= --enable-developer --enable-selftest --abi-check-disable
|
|
||||||
DEVELOPER_CONFIGURE_ENV= WAF_CMD_FORMAT=string
|
|
||||||
DEVELOPER_BUILD_DEPENDS= ${SAMBA4_LMDB_DEPENDS} \
|
|
||||||
${GDB_CMD}:devel/gdb
|
|
||||||
DEVELOPER_RUN_DEPENDS= ${SAMBA4_LMDB_DEPENDS}
|
|
||||||
DEVELOPER_TEST_DEPENDS= ${GDB_CMD}:devel/gdb
|
|
||||||
DEVELOPER_VARS_OFF= GDB_CMD=true
|
|
||||||
##############################################################################
|
|
||||||
AD_DC_IMPLIES= PYTHON3
|
|
||||||
AD_DC_CONFIGURE_OFF= --without-ad-dc
|
|
||||||
AD_DC_BUILD_DEPENDS= ${SAMBA4_LMDB_DEPENDS}
|
|
||||||
AD_DC_RUN_DEPENDS= ${SAMBA4_LMDB_DEPENDS}
|
|
||||||
AD_DC_VARS= PLIST+=${PKGDIR}/pkg-plist.ad_dc
|
|
||||||
# samba-tool requires those for *upgrade
|
|
||||||
AD_DC_BUILD_DEPENDS+= ${PYTHON_PKGNAMEPREFIX}markdown>=3.3.7:textproc/py-markdown@${PY_FLAVOR} \
|
|
||||||
${PYTHON_PKGNAMEPREFIX}dnspython>=2.2.1:dns/py-dnspython@${PY_FLAVOR}
|
|
||||||
AD_DC_RUN_DEPENDS+= ${PYTHON_PKGNAMEPREFIX}markdown>=3.3.7:textproc/py-markdown@${PY_FLAVOR} \
|
|
||||||
${PYTHON_PKGNAMEPREFIX}dnspython>=2.2.1:dns/py-dnspython@${PY_FLAVOR}
|
|
||||||
|
|
||||||
ADS_IMPLIES= LDAP
|
|
||||||
ADS_CONFIGURE_WITH= ads
|
|
||||||
|
|
||||||
CLUSTER_CONFIGURE_WITH= cluster-support
|
|
||||||
CLUSTER_VARS= PLIST+=${PKGDIR}/pkg-plist.cluster
|
|
||||||
|
|
||||||
CUPS_CONFIGURE_ENABLE= cups iprint
|
|
||||||
CUPS_LIB_DEPENDS= libcups.so:print/cups
|
|
||||||
# https://bugzilla.samba.org/show_bug.cgi?id=9545
|
|
||||||
FAM_USES= fam
|
|
||||||
FAM_CONFIGURE_WITH= fam
|
|
||||||
|
|
||||||
GPGME_CONFIGURE_WITH= gpgme
|
|
||||||
GPGME_LIB_DEPENDS= libgpgme.so:security/gpgme
|
|
||||||
GPGME_RUN_DEPENDS= ${PYTHON_PKGNAMEPREFIX}gpgme>=1.14.0:security/py-gpgme@${PY_FLAVOR}
|
|
||||||
|
|
||||||
GSSAPI_BUILTIN_USES= bison
|
|
||||||
GSSAPI_BUILTIN_BUILD_DEPENDS= p5-JSON>=4.0:converters/p5-JSON
|
|
||||||
|
|
||||||
GSSAPI_MIT_CONFIGURE_ON= --with-system-mitkrb5 ${GSSAPIBASEDIR} \
|
|
||||||
--with-system-mitkdc=${GSSAPIBASEDIR}/sbin/krb5kdc \
|
|
||||||
--with-experimental-mit-ad-dc
|
|
||||||
GSSAPI_MIT_USES= gssapi:mit
|
|
||||||
|
|
||||||
GSSAPI_HEIMDAL_CONFIGURE_ON= --with-system-heimdalkrb5 ${GSSAPIBASEDIR}
|
|
||||||
GSSAPI_HEIMDAL_USES= gssapi:heimdal
|
|
||||||
GSSAPI_HEIMDAL_PREVENTS= AD_DC
|
|
||||||
GSSAPI_HEIMDAL_PREVENTS_MSG= GSSAPI_HEIMDAL and AD_DC enable conflicting options
|
|
||||||
|
|
||||||
LDAP_CONFIGURE_WITH= ldap
|
|
||||||
LDAP_CONFIGURE_ON= --with-openldap=${LOCALBASE}
|
|
||||||
LDAP_USES= ldap
|
|
||||||
LDAP_VARS= SAMBA4_MODULES+=idmap_ldap
|
|
||||||
|
|
||||||
LIBZFS_CONFIGURE_WITH= libzfs
|
|
||||||
LIBZFS_VARS= SAMBA4_MODULES+=vfs_zfs_space
|
|
||||||
|
|
||||||
MANDOC_BUILD_DEPENDS= ${LOCALBASE}/share/xsl/docbook/manpages/docbook.xsl:textproc/docbook-xsl \
|
|
||||||
xsltproc:textproc/libxslt
|
|
||||||
MANDOC_CONFIGURE_ENV_OFF= XSLTPROC="true"
|
|
||||||
|
|
||||||
PROFILE_CONFIGURE_WITH= profiling-data
|
|
||||||
|
|
||||||
QUOTAS_CONFIGURE_WITH= quotas
|
|
||||||
|
|
||||||
SPOTLIGHT_CONFIGURE_ENABLE= spotlight
|
|
||||||
SPOTLIGHT_BUILD_DEPENDS= tracker>=1.4.1:sysutils/tracker
|
|
||||||
SPOTLIGHT_RUN_DEPENDS= tracker>=1.4.1:sysutils/tracker
|
|
||||||
# ICU
|
|
||||||
SPOTLIGHT_LIB_DEPENDS= libicuuc.so:devel/icu
|
|
||||||
SPOTLIGHT_USES= bison gnome
|
|
||||||
SPOTLIGHT_USE= gnome=glib20
|
|
||||||
|
|
||||||
SYSLOG_CONFIGURE_WITH= syslog
|
|
||||||
|
|
||||||
UTMP_CONFIGURE_WITH= utmp
|
|
||||||
|
|
||||||
##############################################################################
|
|
||||||
.include <bsd.port.options.mk>
|
|
||||||
##############################################################################
|
|
||||||
.if !${PORT_OPTIONS:MADS} && ${PORT_OPTIONS:MAD_DC}
|
|
||||||
IGNORE=To disable ADS option you also need to disable AD_DC option
|
|
||||||
.endif
|
|
||||||
|
|
||||||
.if !defined(WANT_EXP_MODULES) || empty(WANT_EXP_MODULES)
|
|
||||||
WANT_EXP_MODULES= vfs_cacheprime
|
|
||||||
.endif
|
|
||||||
|
|
||||||
.if ${WANT_EXP_MODULES:Mvfs_snapper}
|
|
||||||
# snapper needs dbus
|
|
||||||
LIB_DEPENDS+= libdbus-1.so:devel/dbus
|
|
||||||
LIB_DEPENDS+= libdbus-glib-1.so:devel/dbus-glib
|
|
||||||
.endif
|
|
||||||
|
|
||||||
SAMBA4_MODULES+= krb5_async_dns_krb5_locator krb5_winbind_krb5_locator idmap_nss idmap_autorid \
|
|
||||||
idmap_rid idmap_hash idmap_tdb idmap_tdb2 idmap_script \
|
|
||||||
nss-info_hash
|
|
||||||
# List of extra modules taken from RHEL build
|
|
||||||
# https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=197320
|
|
||||||
.if ${PORT_OPTIONS:MADS}
|
|
||||||
SAMBA4_MODULES+= idmap_ad idmap_rfc2307 nss-info_template \
|
|
||||||
nss-info_rfc2307 nss-info_sfu nss-info_sfu20
|
|
||||||
.endif
|
|
||||||
# This kind of special for this distribution
|
|
||||||
SAMBA4_MODULES+= vfs_freebsd
|
|
||||||
|
|
||||||
SAMBA4_MODULES+= vfs_acl_tdb vfs_acl_xattr vfs_aio_fork vfs_aio_pthread \
|
|
||||||
vfs_audit vfs_cap vfs_catia vfs_commit vfs_crossrename \
|
|
||||||
vfs_default_quota vfs_dirsort vfs_expand_msdfs \
|
|
||||||
vfs_extd_audit vfs_fake_perms vfs_full_audit \
|
|
||||||
vfs_linux_xfs_sgid vfs_media_harmony vfs_offline \
|
|
||||||
vfs_preopen vfs_readahead vfs_readonly vfs_recycle \
|
|
||||||
vfs_shadow_copy vfs_shadow_copy2 vfs_shell_snap \
|
|
||||||
vfs_streams_depot vfs_streams_xattr vfs_syncops \
|
|
||||||
vfs_time_audit vfs_unityed_media vfs_virusfilter \
|
|
||||||
vfs_widelinks vfs_worm vfs_xattr_tdb vfs_zfsacl
|
|
||||||
|
|
||||||
.if ${PORT_OPTIONS:MDEVELOPER}
|
|
||||||
SAMBA4_MODULES+= auth_skel pdb_test gpext_security gpext_registry \
|
|
||||||
gpext_scripts perfcount_test vfs_fake_dfq \
|
|
||||||
vfs_skel_opaque vfs_skel_transparent \
|
|
||||||
vfs_shadow_copy_test vfs_fake_acls \
|
|
||||||
vfs_nfs4acl_xattr vfs_error_inject vfs_delay_inject
|
|
||||||
.endif
|
|
||||||
# Python bindings
|
|
||||||
.if ! ${PORT_OPTIONS:MPYTHON3} || defined(NO_PYTHON)
|
|
||||||
USES+= python:build,test
|
|
||||||
CONFIGURE_ARGS+= --disable-python
|
|
||||||
.else
|
|
||||||
USES+= python
|
|
||||||
PLIST+= ${PKGDIR}/pkg-plist.python
|
|
||||||
# Don't cache Python modules
|
|
||||||
CONFIGURE_ARGS+= --nopycache
|
|
||||||
MAKE_ENV+= PYTHONDONTWRITEBYTECODE=1
|
|
||||||
|
|
||||||
. if defined(SAMBA4_BUNDLED_TALLOC) && ${SAMBA4_BUNDLED_TALLOC} == yes
|
|
||||||
SAMBA4_BUNDLED_LIBS+= pytalloc-util
|
|
||||||
. else
|
|
||||||
SAMBA4_BUNDLED_LIBS+= !pytalloc-util
|
|
||||||
. endif
|
|
||||||
|
|
||||||
. if defined(SAMBA4_BUNDLED_TEVENT) && ${SAMBA4_BUNDLED_TEVENT} == yes
|
|
||||||
SAMBA4_BUNDLED_LIBS+= pytevent
|
|
||||||
. else
|
|
||||||
SAMBA4_BUNDLED_LIBS+= !pytevent
|
|
||||||
. endif
|
|
||||||
|
|
||||||
. if defined(SAMBA4_BUNDLED_TDB) && ${SAMBA4_BUNDLED_TDB} == yes
|
|
||||||
SAMBA4_BUNDLED_LIBS+= pytdb
|
|
||||||
. else
|
|
||||||
SAMBA4_BUNDLED_LIBS+= !pytdb
|
|
||||||
. endif
|
|
||||||
|
|
||||||
. if defined(SAMBA4_BUNDLED_LDB) && ${SAMBA4_BUNDLED_LDB} == yes
|
|
||||||
SAMBA4_BUNDLED_LIBS+= pyldb pyldb-util
|
|
||||||
. else
|
|
||||||
SAMBA4_BUNDLED_LIBS+= !pyldb !pyldb-util
|
|
||||||
. endif
|
|
||||||
.endif
|
|
||||||
|
|
||||||
.if defined(WANT_EXP_MODULES) && !empty(WANT_EXP_MODULES)
|
|
||||||
SAMBA4_MODULES+= ${WANT_EXP_MODULES}
|
|
||||||
.endif
|
|
||||||
|
|
||||||
.if defined(SAMBA4_BUNDLED_LIBS) && !empty(SAMBA4_BUNDLED_LIBS)
|
|
||||||
CONFIGURE_ARGS+= --bundled-libraries="${SAMBA4_BUNDLED_LIBS:Q:C|(\\\\ )+|,|g:S|\\||g}"
|
|
||||||
.endif
|
|
||||||
|
|
||||||
.if defined(SAMBA4_MODULES) && !empty(SAMBA4_MODULES)
|
|
||||||
CONFIGURE_ARGS+= --with-shared-modules="${SAMBA4_MODULES:C|-|_|:Q:C|(\\\\ )+|,|g:S|\\||g}"
|
|
||||||
.endif
|
|
||||||
# XXX: Hack for nss-info_* -> nss_info/* modules
|
|
||||||
# Add selected modules to the plist
|
|
||||||
.for module in ${SAMBA4_MODULES}
|
|
||||||
PLIST_FILES+= ${SAMBA4_MODULEDIR}/${module:C|_|/|:C|-|_|}.so
|
|
||||||
.endfor
|
|
||||||
|
|
||||||
.for module_class in ${SAMBA4_MODULES_CLASS}
|
|
||||||
PLIST_DIRS+= ${SAMBA4_MODULEDIR}/${module_class}
|
|
||||||
.endfor
|
|
||||||
PLIST_DIRS+= ${SAMBA4_MODULEDIR}
|
|
||||||
|
|
||||||
.if defined(WITH_DEBUG)
|
|
||||||
CONFIGURE_ARGS+= --verbose --enable-debug
|
|
||||||
MAKE_ARGS+= --verbose
|
|
||||||
DEBUG_FLAGS?= -g -ggdb3 -O0
|
|
||||||
.endif
|
|
||||||
|
|
||||||
##############################################################################
|
|
||||||
.include <bsd.port.pre.mk>
|
|
||||||
##############################################################################
|
|
||||||
# Only for 64-bit architectures
|
|
||||||
.if ${ARCH} != armv6 && ${ARCH} != armv7 && ${ARCH} != i386 && ${ARCH} != mips && ${ARCH} != powerpc && ${ARCH} != powerpcspe
|
|
||||||
. if defined(SAMBA4_BUNDLED_LDB) && ${SAMBA4_BUNDLED_LDB} == yes && (${PORT_OPTIONS:MAD_DC} || ${PORT_OPTIONS:MDEVELOPER})
|
|
||||||
# LMDB
|
|
||||||
SAMBA4_LMDB_DEPENDS= lmdb>=0.9.16:databases/lmdb
|
|
||||||
PLIST_FILES+= ${SAMBA4_LIBDIR}/private/libldb-mdb-int-samba4.so \
|
|
||||||
${SAMBA4_MODULEDIR}/ldb/mdb.so
|
|
||||||
. endif
|
|
||||||
.endif
|
|
||||||
|
|
||||||
.if ${PORT_OPTIONS:MGSSAPI_MIT}
|
|
||||||
PLIST_FILES+= ${SAMBA4_MODULEDIR}/krb5/winbind_krb5_localauth.so \
|
|
||||||
share/man/man8/winbind_krb5_localauth.8.gz
|
|
||||||
. if ${PORT_OPTIONS:MAD_DC}
|
|
||||||
PLIST_FILES+= ${SAMBA4_LIBDIR}/krb5/plugins/kdb/samba.so
|
|
||||||
. endif
|
|
||||||
.endif
|
|
||||||
# for libexecinfo: (so that __builtin_frame_address() finds the top of the stack)
|
|
||||||
CFLAGS_amd64+= -fno-omit-frame-pointer
|
|
||||||
# No fancy color error messages
|
|
||||||
CFLAGS+= ${CFLAGS_${CHOSEN_COMPILER_TYPE}}
|
|
||||||
CFLAGS_clang= -fno-color-diagnostics
|
|
||||||
CONFIGURE_ENV+= NOCOLOR=yes WAF_LOG_FORMAT='%(c1)s%(zone)s%(c2)s %(message)s'
|
|
||||||
MAKE_ENV+= NOCOLOR=yes WAF_LOG_FORMAT='%(c1)s%(zone)s%(c2)s %(message)s'
|
|
||||||
# Allow rpcgen to find proper CPP
|
|
||||||
MAKE_ENV+= RPCGEN_CPP="${CPP}"
|
|
||||||
#.if ${readline_ARGS} == port
|
|
||||||
#CFLAGS+= -D_FUNCTION_DEF
|
|
||||||
#.endif
|
|
||||||
# Some symbols in samba's linker version scripts are not defined, but since the
|
|
||||||
# scripts are generated dynamically, suppress errors with lld >= 17 due to these
|
|
||||||
# undefined symbols.
|
|
||||||
LDFLAGS+= -Wl,--undefined-version
|
|
||||||
|
|
||||||
SAMBA4_SUB= SAMBA4_LOGDIR="${SAMBA4_LOGDIR}" \
|
|
||||||
SAMBA4_RUNDIR="${SAMBA4_RUNDIR}" \
|
|
||||||
SAMBA4_LOCKDIR="${SAMBA4_LOCKDIR}" \
|
|
||||||
SAMBA4_LIBDIR="${SAMBA4_LIBDIR}" \
|
|
||||||
SAMBA4_MODULEDIR="${SAMBA4_MODULEDIR}" \
|
|
||||||
SAMBA4_BINDDNSDIR="${SAMBA4_BINDDNSDIR}" \
|
|
||||||
SAMBA4_PRIVATEDIR="${SAMBA4_PRIVATEDIR}" \
|
|
||||||
SAMBA4_CONFDIR="${SAMBA4_CONFDIR}" \
|
|
||||||
SAMBA4_CONFIG="${SAMBA4_CONFIG}" \
|
|
||||||
SAMBA4_SERVICES="${SAMBA4_SERVICES}"
|
|
||||||
|
|
||||||
PLIST_SUB+= ${SAMBA4_SUB}
|
|
||||||
SUB_LIST+= ${SAMBA4_SUB}
|
|
||||||
|
|
||||||
USE_RC_SUBR= samba_server
|
|
||||||
SUB_FILES= pkg-message README.FreeBSD
|
|
||||||
|
|
||||||
PORTDOCS= README.FreeBSD
|
|
||||||
|
|
||||||
post-extract:
|
|
||||||
@${RM} -r ${WRKSRC}/pidl/lib/Parse/Yapp
|
|
||||||
|
|
||||||
post-patch:
|
|
||||||
@${REINPLACE_CMD} -e 's|$${PKGCONFIGDIR}|${PKGCONFIGDIR}|g' \
|
|
||||||
${PATCH_WRKSRC}/buildtools/wafsamba/pkgconfig.py
|
|
||||||
@${REINPLACE_CMD} -e 's|%%LOCALBASE%%|${LOCALBASE}|g' \
|
|
||||||
${PATCH_WRKSRC}/buildtools/wafsamba/wafsamba.py
|
|
||||||
@${REINPLACE_CMD} -e 's|%%GDB_CMD%%|${GDB_CMD}|g' \
|
|
||||||
${PATCH_WRKSRC}/buildtools/scripts/abi_gen.sh
|
|
||||||
@${REINPLACE_CMD} -e 's|%%SAMBA4_CONFIG%%|${SAMBA4_CONFIG}|g' \
|
|
||||||
${PATCH_WRKSRC}/dynconfig/wscript
|
|
||||||
|
|
||||||
# Use threading (or multiprocessing) but not thread (renamed in python 3+).
|
|
||||||
pre-configure:
|
|
||||||
.if (!${PORT_OPTIONS:MPYTHON3} || defined(NO_PYTHON)) && ${PORT_OPTIONS:MAD_DC}
|
|
||||||
@${ECHO_CMD}; \
|
|
||||||
${ECHO_MSG} "===> AD_DC option requires PYTHON3 to be set"; \
|
|
||||||
${ECHO_CMD}; \
|
|
||||||
${FALSE}
|
|
||||||
.endif
|
|
||||||
|
|
||||||
pre-build-MANDOC-off:
|
|
||||||
${MKDIR} ${BUILD_WRKSRC}/bin/default/docs-xml/
|
|
||||||
${CP} -rp ${BUILD_WRKSRC}/docs/manpages ${BUILD_WRKSRC}/bin/default/docs-xml/
|
|
||||||
.for man in libcli/nbt/man/nmblookup4.1 \
|
|
||||||
librpc/tools/ndrdump.1 \
|
|
||||||
source4/lib/registry/man/regdiff.1 \
|
|
||||||
source4/lib/registry/man/regpatch.1 \
|
|
||||||
source4/lib/registry/man/regshell.1 \
|
|
||||||
source4/lib/registry/man/regtree.1 \
|
|
||||||
source4/scripting/man/samba-gpupdate.8 \
|
|
||||||
source4/torture/man/gentest.1 \
|
|
||||||
source4/torture/man/locktest.1 \
|
|
||||||
source4/torture/man/masktest.1 \
|
|
||||||
source4/torture/man/smbtorture.1 \
|
|
||||||
source4/utils/man/ntlm_auth4.1 \
|
|
||||||
source4/utils/oLschema2ldif/oLschema2ldif.1 \
|
|
||||||
lib/tdb/man/tdbdump.8 \
|
|
||||||
lib/tdb/man/tdbbackup.8 \
|
|
||||||
lib/tdb/man/tdbtool.8 \
|
|
||||||
lib/talloc/man/talloc.3 \
|
|
||||||
lib/tdb/man/tdbrestore.8 \
|
|
||||||
lib/ldb/man/ldb.3 \
|
|
||||||
lib/ldb/man/ldbadd.1 \
|
|
||||||
lib/ldb/man/ldbdel.1 \
|
|
||||||
lib/ldb/man/ldbedit.1 \
|
|
||||||
lib/ldb/man/ldbmodify.1 \
|
|
||||||
lib/ldb/man/ldbrename.1 \
|
|
||||||
lib/ldb/man/ldbsearch.1 \
|
|
||||||
docs-xml/manpages/vfs_freebsd.8
|
|
||||||
${MKDIR} `dirname ${BUILD_WRKSRC}/bin/default/${man}`
|
|
||||||
${INSTALL_MAN} ${FILESDIR}/man/`basename ${man}` ${BUILD_WRKSRC}/bin/default/${man}
|
|
||||||
.endfor
|
|
||||||
.if ${PORT_OPTIONS:MCLUSTER}
|
|
||||||
${MKDIR} ${BUILD_WRKSRC}/bin/default/ctdb/
|
|
||||||
. for man in ctdb_diagnostics.1 ctdb.1 ctdbd_wrapper.1 ctdbd.1 ltdbtool.1 onnode.1 ping_pong.1 \
|
|
||||||
ctdb.conf.5 ctdb.sysconfig.5 ctdb-script.options.5 \
|
|
||||||
ctdb.7 ctdb-statistics.7 ctdb-tunables.7
|
|
||||||
${INSTALL_MAN} ${FILESDIR}/man/${man} ${BUILD_WRKSRC}/bin/default/ctdb/
|
|
||||||
. endfor
|
|
||||||
.endif
|
|
||||||
|
|
||||||
post-install-rm-junk:
|
|
||||||
${RM} -r ${STAGEDIR}${PYTHON_SITELIBDIR}/samba/third_party
|
|
||||||
${FIND} ${STAGEDIR}${PYTHON_SITELIBDIR} -name __pycache__ \
|
|
||||||
-type d -print0 | ${XARGS} -0 -n 1 -t ${RM} -r
|
|
||||||
${FIND} ${STAGEDIR} -type f -empty -delete
|
|
||||||
|
|
||||||
post-install-fix-manpages:
|
|
||||||
.for f in vfs_aio_linux.8 vfs_btrfs.8 vfs_ceph.8 vfs_gpfs.8
|
|
||||||
${RM} ${STAGEDIR}${PREFIX}/share/man/man8/${f}
|
|
||||||
.endfor
|
|
||||||
.if defined(SAMBA4_BUNDLED_LDB) && ${SAMBA4_BUNDLED_LDB} == yes
|
|
||||||
. for f in ldbadd.1 ldbdel.1 ldbedit.1 ldbmodify.1 ldbrename.1 ldbsearch.1
|
|
||||||
${MV} ${STAGEDIR}${PREFIX}/share/man/man1/${f} ${STAGEDIR}${PREFIX}/share/man/man1/samba-${f}
|
|
||||||
. endfor
|
|
||||||
.endif
|
|
||||||
|
|
||||||
.if defined(SAMBA4_BUNDLED_TALLOC) && ${SAMBA4_BUNDLED_TALLOC} == yes
|
|
||||||
. for f in talloc.3
|
|
||||||
${MV} ${STAGEDIR}${PREFIX}/share/man/man3/${f} ${STAGEDIR}${PREFIX}/share/man/man3/samba-${f}
|
|
||||||
. endfor
|
|
||||||
.endif
|
|
||||||
|
|
||||||
.if defined(SAMBA4_BUNDLED_TDB) && ${SAMBA4_BUNDLED_TDB} == yes
|
|
||||||
. for f in tdbbackup.8 tdbdump.8 tdbrestore.8 tdbtool.8
|
|
||||||
${MV} ${STAGEDIR}${PREFIX}/share/man/man8/${f} ${STAGEDIR}${PREFIX}/share/man/man8/samba-${f}
|
|
||||||
. endfor
|
|
||||||
.endif
|
|
||||||
|
|
||||||
post-install: post-install-rm-junk post-install-fix-manpages
|
|
||||||
${LN} -sf smb.conf.5.gz ${STAGEDIR}${PREFIX}/share/man/man5/smb4.conf.5.gz
|
|
||||||
# Run post-install script
|
|
||||||
.for dir in ${SAMBA4_LOGDIR} ${SAMBA4_RUNDIR} ${SAMBA4_LOCKDIR} ${SAMBA4_MODULEDIR}
|
|
||||||
${INSTALL} -d -m 0755 "${STAGEDIR}${dir}"
|
|
||||||
.endfor
|
|
||||||
${INSTALL} -d -m 0750 "${STAGEDIR}${SAMBA4_BINDDNSDIR}"
|
|
||||||
${INSTALL} -d -m 0750 "${STAGEDIR}${SAMBA4_PRIVATEDIR}"
|
|
||||||
.for module_class in ${SAMBA4_MODULES_CLASS}
|
|
||||||
${INSTALL} -d -m 0755 "${STAGEDIR}${SAMBA4_MODULEDIR}/${module_class}"
|
|
||||||
.endfor
|
|
||||||
.if !defined(WITH_DEBUG)
|
|
||||||
-${FIND} ${STAGEDIR}${PREFIX}/bin ${STAGEDIR}${PREFIX}/sbin ${STAGEDIR}${PREFIX}/libexec \
|
|
||||||
-type f -print0 | ${XARGS} -0 -n 1 -t ${STRIP_CMD}
|
|
||||||
-${FIND} ${STAGEDIR}${PREFIX}/lib -name '*.so*' \
|
|
||||||
-type f -print0 | ${XARGS} -0 -n 1 -t ${STRIP_CMD}
|
|
||||||
.endif
|
|
||||||
|
|
||||||
post-install-FRUIT-off:
|
|
||||||
${RM} ${STAGEDIR}${SAMBA4_MODULEDIR}/vfs/fruit.so
|
|
||||||
${RM} ${STAGEDIR}${PREFIX}/share/man/man8/vfs_fruit.8
|
|
||||||
|
|
||||||
post-install-DOCS-on:
|
|
||||||
${MKDIR} ${STAGEDIR}${DOCSDIR}
|
|
||||||
.for doc in ${PORTDOCS}
|
|
||||||
${INSTALL_DATA} ${WRKDIR}/${doc} ${STAGEDIR}${DOCSDIR}
|
|
||||||
.endfor
|
|
||||||
|
|
||||||
post-install-CLUSTER-on:
|
|
||||||
${LN} -nfs ../../../../share/ctdb/events/legacy/00.ctdb.script ${STAGEDIR}${PREFIX}/etc/ctdb/events/legacy/00.ctdb.script
|
|
||||||
${LN} -nfs ../../../../share/ctdb/events/legacy/10.interface.script ${STAGEDIR}${PREFIX}/etc/ctdb/events/legacy/10.interface.script
|
|
||||||
${LN} -nfs ../../../../share/ctdb/events/legacy/05.system.script ${STAGEDIR}${PREFIX}/etc/ctdb/events/legacy/05.system.script
|
|
||||||
${LN} -nfs ../../../../share/ctdb/events/legacy/01.reclock.script ${STAGEDIR}${PREFIX}/etc/ctdb/events/legacy/01.reclock.script
|
|
||||||
|
|
||||||
.include <bsd.port.post.mk>
|
|
||||||
@ -1,3 +0,0 @@
|
|||||||
TIMESTAMP = 1737565689
|
|
||||||
SHA256 (samba-4.20.7.tar.gz) = 5afe8b66e612ab1c7e57c6146adfe98ec3ea9d40dee2962a2076a3d6d6973b78
|
|
||||||
SIZE (samba-4.20.7.tar.gz) = 42523056
|
|
||||||
@ -1,292 +0,0 @@
|
|||||||
From 05e3cc236406680a55e19b204202b63cdaf48ea1 Mon Sep 17 00:00:00 2001
|
|
||||||
From: "Timur I. Bakeyev" <timur@FreeBSD.org>
|
|
||||||
Date: Mon, 1 Aug 2022 04:15:43 +0200
|
|
||||||
Subject: [PATCH 01/28] Compact and simplify modules build and config
|
|
||||||
generation for Bind 9.x AD DLZ.
|
|
||||||
|
|
||||||
Signed-off-by: Timur I. Bakeyev <timur@FreeBSD.org>
|
|
||||||
---
|
|
||||||
python/samba/provision/sambadns.py | 68 ++++++++++++------------------
|
|
||||||
source4/dns_server/dlz_minimal.h | 44 +++++++++----------
|
|
||||||
source4/dns_server/wscript_build | 62 +++------------------------
|
|
||||||
source4/setup/named.conf.dlz | 25 +----------
|
|
||||||
source4/torture/dns/wscript_build | 2 +-
|
|
||||||
5 files changed, 55 insertions(+), 146 deletions(-)
|
|
||||||
|
|
||||||
diff --git a/python/samba/provision/sambadns.py b/python/samba/provision/sambadns.py
|
|
||||||
index 404b346a885..8e5a8ba5f25 100644
|
|
||||||
--- a/python/samba/provision/sambadns.py
|
|
||||||
+++ b/python/samba/provision/sambadns.py
|
|
||||||
@@ -21,6 +21,7 @@
|
|
||||||
"""DNS-related provisioning"""
|
|
||||||
|
|
||||||
import os
|
|
||||||
+import re
|
|
||||||
import uuid
|
|
||||||
import shutil
|
|
||||||
import time
|
|
||||||
@@ -1010,52 +1011,37 @@ def create_named_conf(paths, realm, dnsdomain, dns_backend, logger):
|
|
||||||
stderr=subprocess.STDOUT,
|
|
||||||
cwd='.').communicate()[0]
|
|
||||||
bind_info = get_string(bind_info)
|
|
||||||
- bind9_8 = '#'
|
|
||||||
- bind9_9 = '#'
|
|
||||||
- bind9_10 = '#'
|
|
||||||
- bind9_11 = '#'
|
|
||||||
- bind9_12 = '#'
|
|
||||||
- bind9_14 = '#'
|
|
||||||
- bind9_16 = '#'
|
|
||||||
- bind9_18 = '#'
|
|
||||||
- if bind_info.upper().find('BIND 9.8') != -1:
|
|
||||||
- bind9_8 = ''
|
|
||||||
- elif bind_info.upper().find('BIND 9.9') != -1:
|
|
||||||
- bind9_9 = ''
|
|
||||||
- elif bind_info.upper().find('BIND 9.10') != -1:
|
|
||||||
- bind9_10 = ''
|
|
||||||
- elif bind_info.upper().find('BIND 9.11') != -1:
|
|
||||||
- bind9_11 = ''
|
|
||||||
- elif bind_info.upper().find('BIND 9.12') != -1:
|
|
||||||
- bind9_12 = ''
|
|
||||||
- elif bind_info.upper().find('BIND 9.14') != -1:
|
|
||||||
- bind9_14 = ''
|
|
||||||
- elif bind_info.upper().find('BIND 9.16') != -1:
|
|
||||||
- bind9_16 = ''
|
|
||||||
- elif bind_info.upper().find('BIND 9.18') != -1:
|
|
||||||
- bind9_18 = ''
|
|
||||||
- elif bind_info.upper().find('BIND 9.7') != -1:
|
|
||||||
- raise ProvisioningError("DLZ option incompatible with BIND 9.7.")
|
|
||||||
- elif bind_info.upper().find('BIND_9.13') != -1:
|
|
||||||
- raise ProvisioningError("Only stable/esv releases of BIND are supported.")
|
|
||||||
- elif bind_info.upper().find('BIND_9.15') != -1:
|
|
||||||
- raise ProvisioningError("Only stable/esv releases of BIND are supported.")
|
|
||||||
- elif bind_info.upper().find('BIND_9.17') != -1:
|
|
||||||
- raise ProvisioningError("Only stable/esv releases of BIND are supported.")
|
|
||||||
+ bind9_release = re.search('BIND (9)\.(\d+)\.', bind_info, re.I)
|
|
||||||
+ if bind9_release:
|
|
||||||
+ bind9_disabled = ''
|
|
||||||
+ bind9_version = bind9_release.group(0) + "x"
|
|
||||||
+ bind9_version_major = int(bind9_release.group(1))
|
|
||||||
+ bind9_version_minor = int(bind9_release.group(2))
|
|
||||||
+ if bind9_version_minor == 7:
|
|
||||||
+ raise ProvisioningError("DLZ option incompatible with BIND 9.7.")
|
|
||||||
+ elif bind9_version_minor == 8:
|
|
||||||
+ bind9_dlz_version = "9"
|
|
||||||
+ elif bind9_version_minor in [13, 15, 17]:
|
|
||||||
+ raise ProvisioningError("Only stable/esv releases of BIND are supported.")
|
|
||||||
+ else:
|
|
||||||
+ bind9_dlz_version = "%d_%d" % (bind9_version_major, bind9_version_minor)
|
|
||||||
else:
|
|
||||||
+ bind9_disabled = '# '
|
|
||||||
+ bind9_version = "BIND z.y.x"
|
|
||||||
+ bind9_dlz_version = "z_y"
|
|
||||||
logger.warning("BIND version unknown, please modify %s manually." % paths.namedconf)
|
|
||||||
+
|
|
||||||
+ bind9_dlz = (
|
|
||||||
+ ' # For %s\n'
|
|
||||||
+ ' %sdatabase "dlopen %s/bind9/dlz_bind%s.so";'
|
|
||||||
+ ) % (
|
|
||||||
+ bind9_version, bind9_disabled, samba.param.modules_dir(), bind9_dlz_version
|
|
||||||
+ )
|
|
||||||
setup_file(setup_path("named.conf.dlz"), paths.namedconf, {
|
|
||||||
"NAMED_CONF": paths.namedconf,
|
|
||||||
"MODULESDIR": samba.param.modules_dir(),
|
|
||||||
- "BIND9_8": bind9_8,
|
|
||||||
- "BIND9_9": bind9_9,
|
|
||||||
- "BIND9_10": bind9_10,
|
|
||||||
- "BIND9_11": bind9_11,
|
|
||||||
- "BIND9_12": bind9_12,
|
|
||||||
- "BIND9_14": bind9_14,
|
|
||||||
- "BIND9_16": bind9_16,
|
|
||||||
- "BIND9_18": bind9_18
|
|
||||||
- })
|
|
||||||
+ "BIND9_DLZ": bind9_dlz
|
|
||||||
+ })
|
|
||||||
|
|
||||||
|
|
||||||
def create_named_txt(path, realm, dnsdomain, dnsname, binddns_dir,
|
|
||||||
diff --git a/source4/dns_server/dlz_minimal.h b/source4/dns_server/dlz_minimal.h
|
|
||||||
index b7e36e7f8e6..bbdb616deb2 100644
|
|
||||||
--- a/source4/dns_server/dlz_minimal.h
|
|
||||||
+++ b/source4/dns_server/dlz_minimal.h
|
|
||||||
@@ -26,31 +26,25 @@
|
|
||||||
#include <stdint.h>
|
|
||||||
#include <stdbool.h>
|
|
||||||
|
|
||||||
-#if defined (BIND_VERSION_9_8)
|
|
||||||
-# error Bind 9.8 is not supported!
|
|
||||||
-#elif defined (BIND_VERSION_9_9)
|
|
||||||
-# error Bind 9.9 is not supported!
|
|
||||||
-#elif defined (BIND_VERSION_9_10)
|
|
||||||
-# define DLZ_DLOPEN_VERSION 3
|
|
||||||
-# define DNS_CLIENTINFO_VERSION 1
|
|
||||||
-# define ISC_BOOLEAN_AS_BOOL 0
|
|
||||||
-#elif defined (BIND_VERSION_9_11)
|
|
||||||
-# define DLZ_DLOPEN_VERSION 3
|
|
||||||
-# define DNS_CLIENTINFO_VERSION 2
|
|
||||||
-# define ISC_BOOLEAN_AS_BOOL 0
|
|
||||||
-#elif defined (BIND_VERSION_9_12)
|
|
||||||
-# define DLZ_DLOPEN_VERSION 3
|
|
||||||
-# define DNS_CLIENTINFO_VERSION 2
|
|
||||||
-# define ISC_BOOLEAN_AS_BOOL 0
|
|
||||||
-#elif defined (BIND_VERSION_9_14)
|
|
||||||
-# define DLZ_DLOPEN_VERSION 3
|
|
||||||
-# define DNS_CLIENTINFO_VERSION 2
|
|
||||||
-#elif defined (BIND_VERSION_9_16)
|
|
||||||
-# define DLZ_DLOPEN_VERSION 3
|
|
||||||
-# define DNS_CLIENTINFO_VERSION 2
|
|
||||||
-#elif defined (BIND_VERSION_9_18)
|
|
||||||
-# define DLZ_DLOPEN_VERSION 3
|
|
||||||
-# define DNS_CLIENTINFO_VERSION 2
|
|
||||||
+#if defined (BIND_VERSION)
|
|
||||||
+# if BIND_VERSION == 908
|
|
||||||
+# error Bind 9.8 is not supported!
|
|
||||||
+# elif BIND_VERSION == 909
|
|
||||||
+# error Bind 9.9 is not supported!
|
|
||||||
+# elif BIND_VERSION == 910
|
|
||||||
+# define DLZ_DLOPEN_VERSION 3
|
|
||||||
+# define DNS_CLIENTINFO_VERSION 1
|
|
||||||
+# define ISC_BOOLEAN_AS_BOOL 0
|
|
||||||
+# elif BIND_VERSION == 911 || BIND_VERSION == 912
|
|
||||||
+# define DLZ_DLOPEN_VERSION 3
|
|
||||||
+# define DNS_CLIENTINFO_VERSION 2
|
|
||||||
+# define ISC_BOOLEAN_AS_BOOL 0
|
|
||||||
+# elif BIND_VERSION >= 914
|
|
||||||
+# define DLZ_DLOPEN_VERSION 3
|
|
||||||
+# define DNS_CLIENTINFO_VERSION 2
|
|
||||||
+# else
|
|
||||||
+# error Unsupported BIND version
|
|
||||||
+# endif
|
|
||||||
#else
|
|
||||||
# error Unsupported BIND version
|
|
||||||
#endif
|
|
||||||
diff --git a/source4/dns_server/wscript_build b/source4/dns_server/wscript_build
|
|
||||||
index ab0a241b937..3743753504c 100644
|
|
||||||
--- a/source4/dns_server/wscript_build
|
|
||||||
+++ b/source4/dns_server/wscript_build
|
|
||||||
@@ -20,69 +20,21 @@ bld.SAMBA_MODULE('service_dns',
|
|
||||||
)
|
|
||||||
|
|
||||||
# a bind9 dlz module giving access to the Samba DNS SAM
|
|
||||||
-bld.SAMBA_LIBRARY('dlz_bind9_10',
|
|
||||||
+for bind_version in (910, 911, 912, 914, 916, 918, 920):
|
|
||||||
+ string_version='%d_%d' % (bind_version // 100, bind_version % 100)
|
|
||||||
+ bld.SAMBA_LIBRARY('dlz_bind%s' % (string_version),
|
|
||||||
source='dlz_bind9.c',
|
|
||||||
- cflags='-DBIND_VERSION_9_10',
|
|
||||||
+ cflags='-DBIND_VERSION=%d' % bind_version,
|
|
||||||
private_library=True,
|
|
||||||
- link_name='modules/bind9/dlz_bind9_10.so',
|
|
||||||
- realname='dlz_bind9_10.so',
|
|
||||||
- install_path='${MODULESDIR}/bind9',
|
|
||||||
- deps='samba-hostconfig samdb-common gensec popt dnsserver_common',
|
|
||||||
- enabled=bld.AD_DC_BUILD_IS_ENABLED())
|
|
||||||
-
|
|
||||||
-bld.SAMBA_LIBRARY('dlz_bind9_11',
|
|
||||||
- source='dlz_bind9.c',
|
|
||||||
- cflags='-DBIND_VERSION_9_11',
|
|
||||||
- private_library=True,
|
|
||||||
- link_name='modules/bind9/dlz_bind9_11.so',
|
|
||||||
- realname='dlz_bind9_11.so',
|
|
||||||
- install_path='${MODULESDIR}/bind9',
|
|
||||||
- deps='samba-hostconfig samdb-common gensec popt dnsserver_common',
|
|
||||||
- enabled=bld.AD_DC_BUILD_IS_ENABLED())
|
|
||||||
-
|
|
||||||
-bld.SAMBA_LIBRARY('dlz_bind9_12',
|
|
||||||
- source='dlz_bind9.c',
|
|
||||||
- cflags='-DBIND_VERSION_9_12',
|
|
||||||
- private_library=True,
|
|
||||||
- link_name='modules/bind9/dlz_bind9_12.so',
|
|
||||||
- realname='dlz_bind9_12.so',
|
|
||||||
- install_path='${MODULESDIR}/bind9',
|
|
||||||
- deps='samba-hostconfig samdb-common gensec popt dnsserver_common',
|
|
||||||
- enabled=bld.AD_DC_BUILD_IS_ENABLED())
|
|
||||||
-
|
|
||||||
-bld.SAMBA_LIBRARY('dlz_bind9_14',
|
|
||||||
- source='dlz_bind9.c',
|
|
||||||
- cflags='-DBIND_VERSION_9_14',
|
|
||||||
- private_library=True,
|
|
||||||
- link_name='modules/bind9/dlz_bind9_14.so',
|
|
||||||
- realname='dlz_bind9_14.so',
|
|
||||||
- install_path='${MODULESDIR}/bind9',
|
|
||||||
- deps='samba-hostconfig samdb-common gensec popt dnsserver_common',
|
|
||||||
- enabled=bld.AD_DC_BUILD_IS_ENABLED())
|
|
||||||
-
|
|
||||||
-bld.SAMBA_LIBRARY('dlz_bind9_16',
|
|
||||||
- source='dlz_bind9.c',
|
|
||||||
- cflags='-DBIND_VERSION_9_16',
|
|
||||||
- private_library=True,
|
|
||||||
- link_name='modules/bind9/dlz_bind9_16.so',
|
|
||||||
- realname='dlz_bind9_16.so',
|
|
||||||
- install_path='${MODULESDIR}/bind9',
|
|
||||||
- deps='samba-hostconfig samdb-common gensec popt dnsserver_common',
|
|
||||||
- enabled=bld.AD_DC_BUILD_IS_ENABLED())
|
|
||||||
-
|
|
||||||
-bld.SAMBA_LIBRARY('dlz_bind9_18',
|
|
||||||
- source='dlz_bind9.c',
|
|
||||||
- cflags='-DBIND_VERSION_9_18',
|
|
||||||
- private_library=True,
|
|
||||||
- link_name='modules/bind9/dlz_bind9_18.so',
|
|
||||||
- realname='dlz_bind9_18.so',
|
|
||||||
+ link_name='modules/bind9/dlz_bind%s.so' % (string_version),
|
|
||||||
+ realname='dlz_bind%s.so' % (string_version),
|
|
||||||
install_path='${MODULESDIR}/bind9',
|
|
||||||
deps='samba-hostconfig samdb-common gensec popt dnsserver_common',
|
|
||||||
enabled=bld.AD_DC_BUILD_IS_ENABLED())
|
|
||||||
|
|
||||||
bld.SAMBA_LIBRARY('dlz_bind9_for_torture',
|
|
||||||
source='dlz_bind9.c',
|
|
||||||
- cflags='-DBIND_VERSION_9_16',
|
|
||||||
+ cflags='-DBIND_VERSION=920',
|
|
||||||
private_library=True,
|
|
||||||
deps='samba-hostconfig samdb-common gensec popt dnsserver_common',
|
|
||||||
enabled=bld.AD_DC_BUILD_IS_ENABLED())
|
|
||||||
diff --git a/source4/setup/named.conf.dlz b/source4/setup/named.conf.dlz
|
|
||||||
index cbe7d805f58..32672768af4 100644
|
|
||||||
--- a/source4/setup/named.conf.dlz
|
|
||||||
+++ b/source4/setup/named.conf.dlz
|
|
||||||
@@ -10,28 +10,5 @@
|
|
||||||
# Uncomment only single database line, depending on your BIND version
|
|
||||||
#
|
|
||||||
dlz "AD DNS Zone" {
|
|
||||||
- # For BIND 9.8.x
|
|
||||||
- ${BIND9_8} database "dlopen ${MODULESDIR}/bind9/dlz_bind9.so";
|
|
||||||
-
|
|
||||||
- # For BIND 9.9.x
|
|
||||||
- ${BIND9_9} database "dlopen ${MODULESDIR}/bind9/dlz_bind9_9.so";
|
|
||||||
-
|
|
||||||
- # For BIND 9.10.x
|
|
||||||
- ${BIND9_10} database "dlopen ${MODULESDIR}/bind9/dlz_bind9_10.so";
|
|
||||||
-
|
|
||||||
- # For BIND 9.11.x
|
|
||||||
- ${BIND9_11} database "dlopen ${MODULESDIR}/bind9/dlz_bind9_11.so";
|
|
||||||
-
|
|
||||||
- # For BIND 9.12.x
|
|
||||||
- ${BIND9_12} database "dlopen ${MODULESDIR}/bind9/dlz_bind9_12.so";
|
|
||||||
-
|
|
||||||
- # For BIND 9.14.x
|
|
||||||
- ${BIND9_14} database "dlopen ${MODULESDIR}/bind9/dlz_bind9_14.so";
|
|
||||||
-
|
|
||||||
- # For BIND 9.16.x
|
|
||||||
- ${BIND9_16} database "dlopen ${MODULESDIR}/bind9/dlz_bind9_16.so";
|
|
||||||
- #
|
|
||||||
- # For BIND 9.18.x
|
|
||||||
- ${BIND9_18} database "dlopen ${MODULESDIR}/bind9/dlz_bind9_18.so";
|
|
||||||
+${BIND9_DLZ}
|
|
||||||
};
|
|
||||||
-
|
|
||||||
diff --git a/source4/torture/dns/wscript_build b/source4/torture/dns/wscript_build
|
|
||||||
index 0b40e03e370..bf7415ff88a 100644
|
|
||||||
--- a/source4/torture/dns/wscript_build
|
|
||||||
+++ b/source4/torture/dns/wscript_build
|
|
||||||
@@ -5,7 +5,7 @@ if bld.AD_DC_BUILD_IS_ENABLED():
|
|
||||||
source='dlz_bind9.c',
|
|
||||||
subsystem='smbtorture',
|
|
||||||
init_function='torture_bind_dns_init',
|
|
||||||
- cflags='-DBIND_VERSION_9_16',
|
|
||||||
+ cflags='-DBIND_VERSION=920',
|
|
||||||
deps='torture talloc torturemain dlz_bind9_for_torture',
|
|
||||||
internal_module=True
|
|
||||||
)
|
|
||||||
--
|
|
||||||
2.37.1
|
|
||||||
|
|
||||||
@ -1,35 +0,0 @@
|
|||||||
From 639b8d650685476016a6d5b1c996a04ac54f8a6f Mon Sep 17 00:00:00 2001
|
|
||||||
From: "Timur I. Bakeyev" <timur@FreeBSD.org>
|
|
||||||
Date: Sun, 30 May 2021 04:00:08 +0200
|
|
||||||
Subject: [PATCH 02/28] Adjust abi_gen.sh script to run under FreeBSD with it's
|
|
||||||
own bintools and slightly different output of GDB.
|
|
||||||
|
|
||||||
Substitution: yes
|
|
||||||
|
|
||||||
Signed-off-by: Timur I. Bakeyev <timur@FreeBSD.org>
|
|
||||||
---
|
|
||||||
buildtools/scripts/abi_gen.sh | 3 ++-
|
|
||||||
1 file changed, 2 insertions(+), 1 deletion(-)
|
|
||||||
|
|
||||||
diff --git a/buildtools/scripts/abi_gen.sh b/buildtools/scripts/abi_gen.sh
|
|
||||||
index ddb0a7cc36f..d2750705ff9 100755
|
|
||||||
--- a/buildtools/scripts/abi_gen.sh
|
|
||||||
+++ b/buildtools/scripts/abi_gen.sh
|
|
||||||
@@ -9,6 +9,7 @@ GDBSCRIPT="gdb_syms.$$"
|
|
||||||
cat <<EOF
|
|
||||||
set height 0
|
|
||||||
set width 0
|
|
||||||
+set print sevenbit-strings on
|
|
||||||
EOF
|
|
||||||
|
|
||||||
# On older linker versions _init|_fini symbols are not hidden.
|
|
||||||
@@ -22,5 +23,5 @@ done
|
|
||||||
) > $GDBSCRIPT
|
|
||||||
|
|
||||||
# forcing the terminal avoids a problem on Fedora12
|
|
||||||
-TERM=none gdb -n -batch -x $GDBSCRIPT "$SHAREDLIB" < /dev/null
|
|
||||||
+TERM=none %%GDB_CMD%% -n -batch -x $GDBSCRIPT "$SHAREDLIB" < /dev/null
|
|
||||||
rm -f $GDBSCRIPT
|
|
||||||
--
|
|
||||||
2.37.1
|
|
||||||
|
|
||||||
@ -1,32 +0,0 @@
|
|||||||
From 382c3edc95a1747e0a6edd05c76adc0ec21a66c7 Mon Sep 17 00:00:00 2001
|
|
||||||
From: "Timur I. Bakeyev" <timur@FreeBSD.org>
|
|
||||||
Date: Sun, 30 May 2021 03:50:17 +0200
|
|
||||||
Subject: [PATCH 03/28] Mask CLang prototype warnings in kadm5/admin.h
|
|
||||||
|
|
||||||
Signed-off-by: Timur I. Bakeyev <timur@FreeBSD.org>
|
|
||||||
---
|
|
||||||
source4/kdc/kdc-service-mit.c | 6 +++++-
|
|
||||||
1 file changed, 5 insertions(+), 1 deletion(-)
|
|
||||||
|
|
||||||
diff --git a/source4/kdc/kdc-service-mit.c b/source4/kdc/kdc-service-mit.c
|
|
||||||
index 22663b6ecc8..5bef125206a 100644
|
|
||||||
--- a/source4/kdc/kdc-service-mit.c
|
|
||||||
+++ b/source4/kdc/kdc-service-mit.c
|
|
||||||
@@ -36,9 +36,13 @@
|
|
||||||
#include "kdc/samba_kdc.h"
|
|
||||||
#include "kdc/kdc-server.h"
|
|
||||||
#include "kdc/kpasswd-service.h"
|
|
||||||
-#include <kadm5/admin.h>
|
|
||||||
#include <kdb.h>
|
|
||||||
|
|
||||||
+#pragma clang diagnostic push
|
|
||||||
+#pragma clang diagnostic ignored "-Wstrict-prototypes"
|
|
||||||
+#include <kadm5/admin.h>
|
|
||||||
+#pragma clang diagnostic pop
|
|
||||||
+
|
|
||||||
#include "source4/kdc/mit_kdc_irpc.h"
|
|
||||||
|
|
||||||
/* PROTOTYPES */
|
|
||||||
--
|
|
||||||
2.37.1
|
|
||||||
|
|
||||||
@ -1,38 +0,0 @@
|
|||||||
From 0eb28116ceefee7bdafabac18a1763f13cb71883 Mon Sep 17 00:00:00 2001
|
|
||||||
From: "Timur I. Bakeyev" <timur@FreeBSD.org>
|
|
||||||
Date: Sun, 30 May 2021 03:42:31 +0200
|
|
||||||
Subject: [PATCH 04/28] On FreeBSD `date(1)` has different semantics than on
|
|
||||||
Linux. Generate call parameter accordingly.
|
|
||||||
|
|
||||||
FreeBSD: `date [[[[[cc]yy]mm]dd]HH]MM[.ss]`
|
|
||||||
Linux: `date [mmddHHMM[[cc]yy][.ss]]`
|
|
||||||
|
|
||||||
Signed-off-by: Timur I. Bakeyev <timur@FreeBSD.org>
|
|
||||||
---
|
|
||||||
source3/utils/net_time.c | 7 ++++++-
|
|
||||||
1 file changed, 6 insertions(+), 1 deletion(-)
|
|
||||||
|
|
||||||
diff --git a/source3/utils/net_time.c b/source3/utils/net_time.c
|
|
||||||
index d102f84614f..f679000a979 100644
|
|
||||||
--- a/source3/utils/net_time.c
|
|
||||||
+++ b/source3/utils/net_time.c
|
|
||||||
@@ -82,10 +82,15 @@ static const char *systime(time_t t)
|
|
||||||
if (!tm) {
|
|
||||||
return "unknown";
|
|
||||||
}
|
|
||||||
-
|
|
||||||
+#if defined(FREEBSD)
|
|
||||||
+ return talloc_asprintf(talloc_tos(), "%04d%02d%02d%02d%02d.%02d",
|
|
||||||
+ tm->tm_year + 1900, tm->tm_mon+1, tm->tm_mday,
|
|
||||||
+ tm->tm_hour, tm->tm_min, tm->tm_sec);
|
|
||||||
+#else
|
|
||||||
return talloc_asprintf(talloc_tos(), "%02d%02d%02d%02d%04d.%02d",
|
|
||||||
tm->tm_mon+1, tm->tm_mday, tm->tm_hour,
|
|
||||||
tm->tm_min, tm->tm_year + 1900, tm->tm_sec);
|
|
||||||
+#endif
|
|
||||||
}
|
|
||||||
|
|
||||||
int net_time_usage(struct net_context *c, int argc, const char **argv)
|
|
||||||
--
|
|
||||||
2.37.1
|
|
||||||
|
|
||||||
@ -1,26 +0,0 @@
|
|||||||
From 3cc67018c560d32b98523618d16902c1a670ed40 Mon Sep 17 00:00:00 2001
|
|
||||||
From: "Timur I. Bakeyev" <timur@FreeBSD.org>
|
|
||||||
Date: Sun, 30 May 2021 03:33:51 +0200
|
|
||||||
Subject: [PATCH 05/28] Include jemalloc/jemalloc.h if ENABLE_JEMALLOC is set.
|
|
||||||
|
|
||||||
Signed-off-by: Timur I. Bakeyev <timur@FreeBSD.org>
|
|
||||||
---
|
|
||||||
source3/include/includes.h | 2 ++
|
|
||||||
1 file changed, 2 insertions(+)
|
|
||||||
|
|
||||||
diff --git a/source3/include/includes.h b/source3/include/includes.h
|
|
||||||
index 510a0b96539..94a076de11e 100644
|
|
||||||
--- a/source3/include/includes.h
|
|
||||||
+++ b/source3/include/includes.h
|
|
||||||
@@ -326,6 +326,8 @@ typedef char fstring[FSTRING_LEN];
|
|
||||||
* the *bottom* of include files so as not to conflict. */
|
|
||||||
#ifdef ENABLE_DMALLOC
|
|
||||||
# include <dmalloc.h>
|
|
||||||
+#elif ENABLE_JEMALLOC
|
|
||||||
+# include <jemalloc/jemalloc.h>
|
|
||||||
#endif
|
|
||||||
|
|
||||||
|
|
||||||
--
|
|
||||||
2.37.1
|
|
||||||
|
|
||||||
@ -1,32 +0,0 @@
|
|||||||
From 406621efcd26d48b5e8f1e5df4082c8bf2cc8bab Mon Sep 17 00:00:00 2001
|
|
||||||
From: "Timur I. Bakeyev" <timur@FreeBSD.org>
|
|
||||||
Date: Sun, 30 May 2021 03:32:21 +0200
|
|
||||||
Subject: [PATCH 06/28] Install nss_* modules into PAMMODULESDIR path.
|
|
||||||
|
|
||||||
Signed-off-by: Timur I. Bakeyev <timur@FreeBSD.org>
|
|
||||||
---
|
|
||||||
nsswitch/wscript_build | 2 ++
|
|
||||||
1 file changed, 2 insertions(+)
|
|
||||||
|
|
||||||
diff --git a/nsswitch/wscript_build b/nsswitch/wscript_build
|
|
||||||
index 3247b6c2b7c..df2fc3b97ea 100644
|
|
||||||
--- a/nsswitch/wscript_build
|
|
||||||
+++ b/nsswitch/wscript_build
|
|
||||||
@@ -54,12 +54,14 @@ elif (host_os.rfind('freebsd') > -1):
|
|
||||||
source='winbind_nss_linux.c winbind_nss_freebsd.c',
|
|
||||||
deps='wbclient',
|
|
||||||
realname='nss_winbind.so.1',
|
|
||||||
+ install_path='${PAMMODULESDIR}',
|
|
||||||
vnum='1')
|
|
||||||
|
|
||||||
bld.SAMBA3_PLUGIN('nss_wins',
|
|
||||||
source='wins.c wins_freebsd.c',
|
|
||||||
deps='''wbclient''',
|
|
||||||
realname='nss_wins.so.1',
|
|
||||||
+ install_path='${PAMMODULESDIR}',
|
|
||||||
vnum='1')
|
|
||||||
|
|
||||||
elif (host_os.rfind('netbsd') > -1):
|
|
||||||
--
|
|
||||||
2.37.1
|
|
||||||
|
|
||||||
@ -1,105 +0,0 @@
|
|||||||
From 75f20f8e144a926873b619e1c0918896689d39a0 Mon Sep 17 00:00:00 2001
|
|
||||||
From: "Timur I. Bakeyev" <timur@FreeBSD.org>
|
|
||||||
Date: Sun, 30 May 2021 03:28:09 +0200
|
|
||||||
Subject: [PATCH 07/28] Use macro value as a default backlog size for the
|
|
||||||
`listen()` syscall.
|
|
||||||
|
|
||||||
Set that macro to -1 on FreeBSD, specifying maximum kernel configured
|
|
||||||
allowed backlog size.
|
|
||||||
|
|
||||||
Signed-off-by: Timur I. Bakeyev <timur@FreeBSD.org>
|
|
||||||
---
|
|
||||||
lib/tevent/echo_server.c | 2 +-
|
|
||||||
source3/include/local.h | 11 +++++++++++
|
|
||||||
source3/libsmb/unexpected.c | 2 +-
|
|
||||||
source3/utils/smbfilter.c | 2 +-
|
|
||||||
source3/winbindd/winbindd.c | 4 ++--
|
|
||||||
5 files changed, 16 insertions(+), 5 deletions(-)
|
|
||||||
|
|
||||||
diff --git a/lib/tevent/echo_server.c b/lib/tevent/echo_server.c
|
|
||||||
index f93d8bcdee7..49354dbf0e5 100644
|
|
||||||
--- a/lib/tevent/echo_server.c
|
|
||||||
+++ b/lib/tevent/echo_server.c
|
|
||||||
@@ -633,7 +633,7 @@ int main(int argc, const char **argv)
|
|
||||||
exit(1);
|
|
||||||
}
|
|
||||||
|
|
||||||
- ret = listen(listen_sock, 5);
|
|
||||||
+ ret = listen(listen_sock, DEFAULT_LISTEN_BACKLOG);
|
|
||||||
if (ret == -1) {
|
|
||||||
perror("listen() failed");
|
|
||||||
exit(1);
|
|
||||||
diff --git a/source3/include/local.h b/source3/include/local.h
|
|
||||||
index 297e5572fdb..d85aab09f9f 100644
|
|
||||||
--- a/source3/include/local.h
|
|
||||||
+++ b/source3/include/local.h
|
|
||||||
@@ -163,7 +163,18 @@
|
|
||||||
#define WINBIND_SERVER_MUTEX_WAIT_TIME (( ((NUM_CLI_AUTH_CONNECT_RETRIES) * ((CLI_AUTH_TIMEOUT)/1000)) + 5)*2)
|
|
||||||
|
|
||||||
/* size of listen() backlog in smbd */
|
|
||||||
+#if defined (FREEBSD)
|
|
||||||
+#define SMBD_LISTEN_BACKLOG -1
|
|
||||||
+#else
|
|
||||||
#define SMBD_LISTEN_BACKLOG 50
|
|
||||||
+#endif
|
|
||||||
+
|
|
||||||
+/* size of listen() default backlog */
|
|
||||||
+#if defined (FREEBSD)
|
|
||||||
+#define DEFAULT_LISTEN_BACKLOG -1
|
|
||||||
+#else
|
|
||||||
+#define DEFAULT_LISTEN_BACKLOG 5
|
|
||||||
+#endif
|
|
||||||
|
|
||||||
/* Number of microseconds to wait before a sharing violation. */
|
|
||||||
#define SHARING_VIOLATION_USEC_WAIT 950000
|
|
||||||
diff --git a/source3/libsmb/unexpected.c b/source3/libsmb/unexpected.c
|
|
||||||
index ced46969b88..317d6b1e0e2 100644
|
|
||||||
--- a/source3/libsmb/unexpected.c
|
|
||||||
+++ b/source3/libsmb/unexpected.c
|
|
||||||
@@ -95,7 +95,7 @@ NTSTATUS nb_packet_server_create(TALLOC_CTX *mem_ctx,
|
|
||||||
status = map_nt_error_from_unix(errno);
|
|
||||||
goto fail;
|
|
||||||
}
|
|
||||||
- rc = listen(result->listen_sock, 5);
|
|
||||||
+ rc = listen(result->listen_sock, DEFAULT_LISTEN_BACKLOG);
|
|
||||||
if (rc < 0) {
|
|
||||||
status = map_nt_error_from_unix(errno);
|
|
||||||
goto fail;
|
|
||||||
diff --git a/source3/utils/smbfilter.c b/source3/utils/smbfilter.c
|
|
||||||
index 3fbd63975c9..b2d90f993fc 100644
|
|
||||||
--- a/source3/utils/smbfilter.c
|
|
||||||
+++ b/source3/utils/smbfilter.c
|
|
||||||
@@ -291,7 +291,7 @@ static void start_filter(char *desthost)
|
|
||||||
exit(1);
|
|
||||||
}
|
|
||||||
|
|
||||||
- if (listen(s, 5) == -1) {
|
|
||||||
+ if (listen(s, DEFAULT_LISTEN_BACKLOG) == -1) {
|
|
||||||
d_printf("listen failed\n");
|
|
||||||
}
|
|
||||||
|
|
||||||
diff --git a/source3/winbindd/winbindd.c b/source3/winbindd/winbindd.c
|
|
||||||
index 0f9c6449a5a..c2df0c92372 100644
|
|
||||||
--- a/source3/winbindd/winbindd.c
|
|
||||||
+++ b/source3/winbindd/winbindd.c
|
|
||||||
@@ -1312,7 +1312,7 @@ static bool winbindd_setup_listeners(void)
|
|
||||||
if (pub_state->fd == -1) {
|
|
||||||
goto failed;
|
|
||||||
}
|
|
||||||
- rc = listen(pub_state->fd, 5);
|
|
||||||
+ rc = listen(pub_state->fd, DEFAULT_LISTEN_BACKLOG);
|
|
||||||
if (rc < 0) {
|
|
||||||
goto failed;
|
|
||||||
}
|
|
||||||
@@ -1344,7 +1344,7 @@ static bool winbindd_setup_listeners(void)
|
|
||||||
if (priv_state->fd == -1) {
|
|
||||||
goto failed;
|
|
||||||
}
|
|
||||||
- rc = listen(priv_state->fd, 5);
|
|
||||||
+ rc = listen(priv_state->fd, DEFAULT_LISTEN_BACKLOG);
|
|
||||||
if (rc < 0) {
|
|
||||||
goto failed;
|
|
||||||
}
|
|
||||||
--
|
|
||||||
2.37.1
|
|
||||||
|
|
||||||
@ -1,111 +0,0 @@
|
|||||||
From 29d0b3479f61f33356d6cc82099085b5c412f949 Mon Sep 17 00:00:00 2001
|
|
||||||
From: "Timur I. Bakeyev" <timur@FreeBSD.org>
|
|
||||||
Date: Sun, 30 May 2021 03:24:48 +0200
|
|
||||||
Subject: [PATCH 08/28] Brute force work around usage of Linux-specific `%m`
|
|
||||||
flag in `sscanf()`.
|
|
||||||
|
|
||||||
Signed-off-by: Timur I. Bakeyev <timur@FreeBSD.org>
|
|
||||||
---
|
|
||||||
libcli/http/http.c | 36 ++++++++++++++++++++++++++-----
|
|
||||||
source4/libcli/ldap/ldap_client.c | 12 +++++++++++
|
|
||||||
2 files changed, 43 insertions(+), 5 deletions(-)
|
|
||||||
|
|
||||||
diff --git a/libcli/http/http.c b/libcli/http/http.c
|
|
||||||
index d20fc25f9e2..a28caca0045 100644
|
|
||||||
--- a/libcli/http/http.c
|
|
||||||
+++ b/libcli/http/http.c
|
|
||||||
@@ -142,7 +142,19 @@ static enum http_read_status http_parse_headers(struct http_read_response_state
|
|
||||||
return HTTP_ALL_DATA_READ;
|
|
||||||
}
|
|
||||||
|
|
||||||
+#ifdef FREEBSD
|
|
||||||
+ int s0, s1, s2, s3; s0 = s1 = s2 = s3 = 0;
|
|
||||||
+ n = sscanf(line, "%n%*[^:]%n: %n%*[^\r\n]%n\r\n", &s0, &s1, &s2, &s3);
|
|
||||||
+
|
|
||||||
+ if(n >= 0) {
|
|
||||||
+ key = calloc(sizeof(char), s1-s0+1);
|
|
||||||
+ value = calloc(sizeof(char), s3-s2+1);
|
|
||||||
+
|
|
||||||
+ n = sscanf(line, "%[^:]: %[^\r\n]\r\n", key, value);
|
|
||||||
+ }
|
|
||||||
+#else
|
|
||||||
n = sscanf(line, "%m[^:]: %m[^\r\n]\r\n", &key, &value);
|
|
||||||
+#endif
|
|
||||||
if (n != 2) {
|
|
||||||
DEBUG(0, ("%s: Error parsing header '%s'\n", __func__, line));
|
|
||||||
status = HTTP_DATA_CORRUPTED;
|
|
||||||
@@ -168,7 +180,7 @@ error:
|
|
||||||
static bool http_parse_response_line(struct http_read_response_state *state)
|
|
||||||
{
|
|
||||||
bool status = true;
|
|
||||||
- char *protocol;
|
|
||||||
+ char *protocol = NULL;
|
|
||||||
char *msg = NULL;
|
|
||||||
char major;
|
|
||||||
char minor;
|
|
||||||
@@ -188,12 +200,22 @@ static bool http_parse_response_line(struct http_read_response_state *state)
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
+#ifdef FREEBSD
|
|
||||||
+ int s0, s1, s2, s3; s0 = s1 = s2 = s3 = 0;
|
|
||||||
+ n = sscanf(line, "%n%*[^/]%n/%c.%c %d %n%*[^\r\n]%n\r\n",
|
|
||||||
+ &s0, &s1, &major, &minor, &code, &s2, &s3);
|
|
||||||
+
|
|
||||||
+ if(n == 3) {
|
|
||||||
+ protocol = calloc(sizeof(char), s1-s0+1);
|
|
||||||
+ msg = calloc(sizeof(char), s3-s2+1);
|
|
||||||
+
|
|
||||||
+ n = sscanf(line, "%[^/]/%c.%c %d %[^\r\n]\r\n",
|
|
||||||
+ protocol, &major, &minor, &code, msg);
|
|
||||||
+ }
|
|
||||||
+#else
|
|
||||||
n = sscanf(line, "%m[^/]/%c.%c %d %m[^\r\n]\r\n",
|
|
||||||
&protocol, &major, &minor, &code, &msg);
|
|
||||||
-
|
|
||||||
- DEBUG(11, ("%s: Header parsed(%i): protocol->%s, major->%c, minor->%c, "
|
|
||||||
- "code->%d, message->%s\n", __func__, n, protocol, major, minor,
|
|
||||||
- code, msg));
|
|
||||||
+#endif
|
|
||||||
|
|
||||||
if (n != 5) {
|
|
||||||
DEBUG(0, ("%s: Error parsing header\n", __func__));
|
|
||||||
@@ -201,6 +223,10 @@ static bool http_parse_response_line(struct http_read_response_state *state)
|
|
||||||
goto error;
|
|
||||||
}
|
|
||||||
|
|
||||||
+ DEBUG(11, ("%s: Header parsed(%i): protocol->%s, major->%c, minor->%c, "
|
|
||||||
+ "code->%d, message->%s\n", __func__, n, protocol, major, minor,
|
|
||||||
+ code, msg));
|
|
||||||
+
|
|
||||||
if (major != '1') {
|
|
||||||
DEBUG(0, ("%s: Bad HTTP major number '%c'\n", __func__, major));
|
|
||||||
status = false;
|
|
||||||
diff --git a/source4/libcli/ldap/ldap_client.c b/source4/libcli/ldap/ldap_client.c
|
|
||||||
index 8614ccdfd54..2630d3c8859 100644
|
|
||||||
--- a/source4/libcli/ldap/ldap_client.c
|
|
||||||
+++ b/source4/libcli/ldap/ldap_client.c
|
|
||||||
@@ -402,8 +402,20 @@ static int ldap_parse_basic_url(
|
|
||||||
*pport = port;
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
+#ifdef FREEBSD
|
|
||||||
+ int s0, s1; s0 = s1 = 0;
|
|
||||||
+ ret = sscanf(url, "%n%*[^:/]%n:%d", &s0, &s1, &port);
|
|
||||||
|
|
||||||
+ if(ret >= 0) {
|
|
||||||
+ host = calloc(sizeof(char), s1 - s0 + 1);
|
|
||||||
+ if (host == NULL) {
|
|
||||||
+ return ENOMEM;
|
|
||||||
+ }
|
|
||||||
+ ret = sscanf(url, "%[^:/]:%d", host, &port);
|
|
||||||
+ }
|
|
||||||
+#else
|
|
||||||
ret = sscanf(url, "%m[^:/]:%d", &host, &port);
|
|
||||||
+#endif
|
|
||||||
if (ret < 1) {
|
|
||||||
return EINVAL;
|
|
||||||
}
|
|
||||||
--
|
|
||||||
2.37.1
|
|
||||||
|
|
||||||
@ -1,39 +0,0 @@
|
|||||||
From 3189d57e9c6cf8d5d25566f2760cfa4f822d7a2c Mon Sep 17 00:00:00 2001
|
|
||||||
From: "Timur I. Bakeyev" <timur@FreeBSD.org>
|
|
||||||
Date: Sun, 30 May 2021 03:21:19 +0200
|
|
||||||
Subject: [PATCH 09/28] Make sure that config checks fail if the warning is
|
|
||||||
raised, by adding -Werror flag to the CFLAGS(WERROR_CFLAGS)
|
|
||||||
|
|
||||||
Signed-off-by: Timur I. Bakeyev <timur@FreeBSD.org>
|
|
||||||
---
|
|
||||||
buildtools/wafsamba/samba_autoconf.py | 2 +-
|
|
||||||
lib/replace/wscript | 2 +-
|
|
||||||
2 files changed, 2 insertions(+), 2 deletions(-)
|
|
||||||
|
|
||||||
diff --git a/buildtools/wafsamba/samba_autoconf.py b/buildtools/wafsamba/samba_autoconf.py
|
|
||||||
index 78927d85193..cf87c8bb9ff 100644
|
|
||||||
--- a/buildtools/wafsamba/samba_autoconf.py
|
|
||||||
+++ b/buildtools/wafsamba/samba_autoconf.py
|
|
||||||
@@ -987,5 +987,5 @@ def SAMBA_CHECK_UNDEFINED_SYMBOL_FLAGS(conf):
|
|
||||||
conf.env.undefined_ldflags = conf.ADD_LDFLAGS('-Wl,-no-undefined', testflags=True)
|
|
||||||
|
|
||||||
if (conf.env.undefined_ignore_ldflags == [] and
|
|
||||||
- conf.CHECK_LDFLAGS(['-undefined', 'dynamic_lookup'])):
|
|
||||||
+ conf.CHECK_LDFLAGS(['-undefined', 'dynamic_lookup'] + conf.env.WERROR_CFLAGS)):
|
|
||||||
conf.env.undefined_ignore_ldflags = ['-undefined', 'dynamic_lookup']
|
|
||||||
diff --git a/lib/replace/wscript b/lib/replace/wscript
|
|
||||||
index 0db93d8caf1..1f9806f1dd7 100644
|
|
||||||
--- a/lib/replace/wscript
|
|
||||||
+++ b/lib/replace/wscript
|
|
||||||
@@ -122,7 +122,7 @@ def configure(conf):
|
|
||||||
conf.CHECK_HEADERS('sys/atomic.h stdatomic.h')
|
|
||||||
conf.CHECK_HEADERS('libgen.h')
|
|
||||||
|
|
||||||
- if conf.CHECK_CFLAGS('-Wno-format-truncation'):
|
|
||||||
+ if conf.CHECK_CFLAGS(['-Wno-format-truncation'] + conf.env.WERROR_CFLAGS):
|
|
||||||
conf.define('HAVE_WNO_FORMAT_TRUNCATION', '1')
|
|
||||||
|
|
||||||
if conf.CHECK_CFLAGS('-Wno-unused-function'):
|
|
||||||
--
|
|
||||||
2.37.1
|
|
||||||
|
|
||||||
@ -1,54 +0,0 @@
|
|||||||
From 5b0d17a5b7849f40f59fb0daedd62e8f5a1b0fba Mon Sep 17 00:00:00 2001
|
|
||||||
From: "Timur I. Bakeyev" <timur@FreeBSD.org>
|
|
||||||
Date: Sun, 30 May 2021 03:16:37 +0200
|
|
||||||
Subject: [PATCH 10/28] Add option --with-pkgconfigdir, to specify alternative
|
|
||||||
location.
|
|
||||||
|
|
||||||
Override name of the config file.
|
|
||||||
|
|
||||||
Remove code that doesn't allow direct install into /usr
|
|
||||||
|
|
||||||
Substitution: yes
|
|
||||||
|
|
||||||
Signed-off-by: Timur I. Bakeyev <timur@FreeBSD.org>
|
|
||||||
---
|
|
||||||
dynconfig/wscript | 9 ++++-----
|
|
||||||
1 file changed, 4 insertions(+), 5 deletions(-)
|
|
||||||
|
|
||||||
diff --git a/dynconfig/wscript b/dynconfig/wscript
|
|
||||||
index c62afa25399..29cacf1b92c 100644
|
|
||||||
--- a/dynconfig/wscript
|
|
||||||
+++ b/dynconfig/wscript
|
|
||||||
@@ -151,6 +151,8 @@ dynconfig = {
|
|
||||||
'PKGCONFIGDIR' : {
|
|
||||||
'STD-PATH': '${LIBDIR}/pkgconfig',
|
|
||||||
'FHS-PATH': '${LIBDIR}/pkgconfig',
|
|
||||||
+ 'OPTION': '--with-pkgconfigdir',
|
|
||||||
+ 'HELPTEXT': 'Where to put .pc files',
|
|
||||||
},
|
|
||||||
'CODEPAGEDIR' : {
|
|
||||||
'STD-PATH': '${DATADIR}/codepages',
|
|
||||||
@@ -257,8 +259,8 @@ dynconfig = {
|
|
||||||
'DELAY': True,
|
|
||||||
},
|
|
||||||
'CONFIGFILE' : {
|
|
||||||
- 'STD-PATH': '${CONFIGDIR}/smb.conf',
|
|
||||||
- 'FHS-PATH': '${CONFIGDIR}/smb.conf',
|
|
||||||
+ 'STD-PATH': '${CONFIGDIR}/%%SAMBA4_CONFIG%%',
|
|
||||||
+ 'FHS-PATH': '${CONFIGDIR}/%%SAMBA4_CONFIG%%',
|
|
||||||
'DELAY': True,
|
|
||||||
},
|
|
||||||
'LMHOSTSFILE' : {
|
|
||||||
@@ -317,9 +319,6 @@ def configure(conf):
|
|
||||||
flavor = 'FHS-PATH'
|
|
||||||
else:
|
|
||||||
flavor = 'STD-PATH'
|
|
||||||
- if conf.env.PREFIX == '/usr' or conf.env.PREFIX == '/usr/local':
|
|
||||||
- Logs.error("Don't install directly under /usr or /usr/local without using the FHS option (--enable-fhs)")
|
|
||||||
- raise Errors.WafError("ERROR: invalid --prefix=%s value" % (conf.env.PREFIX))
|
|
||||||
|
|
||||||
explicit_set ={}
|
|
||||||
|
|
||||||
--
|
|
||||||
2.37.1
|
|
||||||
|
|
||||||
@ -1,28 +0,0 @@
|
|||||||
From 6c68907dcd9abd82cc95c842380a8e817b8f0e7f Mon Sep 17 00:00:00 2001
|
|
||||||
From: "Timur I. Bakeyev" <timur@FreeBSD.org>
|
|
||||||
Date: Sun, 30 May 2021 02:54:28 +0200
|
|
||||||
Subject: [PATCH 11/28] Use provided by port location of the XML catalog.
|
|
||||||
|
|
||||||
Substitution: yes
|
|
||||||
|
|
||||||
Signed-off-by: Timur I. Bakeyev <timur@FreeBSD.org>
|
|
||||||
---
|
|
||||||
buildtools/wafsamba/wafsamba.py | 2 +-
|
|
||||||
1 file changed, 1 insertion(+), 1 deletion(-)
|
|
||||||
|
|
||||||
diff --git a/buildtools/wafsamba/wafsamba.py b/buildtools/wafsamba/wafsamba.py
|
|
||||||
index 7885ee720be..c42a021bc01 100644
|
|
||||||
--- a/buildtools/wafsamba/wafsamba.py
|
|
||||||
+++ b/buildtools/wafsamba/wafsamba.py
|
|
||||||
@@ -1174,7 +1174,7 @@ def SAMBAMANPAGES(bld, manpages, extra_source=None):
|
|
||||||
bld.env.SAMBA_EXPAND_XSL = bld.srcnode.abspath() + '/docs-xml/xslt/expand-sambadoc.xsl'
|
|
||||||
bld.env.SAMBA_MAN_XSL = bld.srcnode.abspath() + '/docs-xml/xslt/man.xsl'
|
|
||||||
bld.env.SAMBA_CATALOG = bld.bldnode.abspath() + '/docs-xml/build/catalog.xml'
|
|
||||||
- bld.env.SAMBA_CATALOGS = os.getenv('XML_CATALOG_FILES', 'file:///etc/xml/catalog file:///usr/local/share/xml/catalog') + ' file://' + bld.env.SAMBA_CATALOG
|
|
||||||
+ bld.env.SAMBA_CATALOGS = os.getenv('XML_CATALOG_FILES', 'file:///etc/xml/catalog file://%%LOCALBASE%%/share/xml/catalog') + ' file://' + bld.env.SAMBA_CATALOG
|
|
||||||
|
|
||||||
for m in manpages.split():
|
|
||||||
source = [m + '.xml']
|
|
||||||
--
|
|
||||||
2.37.1
|
|
||||||
|
|
||||||
@ -1,29 +0,0 @@
|
|||||||
From 9731cc810b50b6694ff931135df398a6772200ae Mon Sep 17 00:00:00 2001
|
|
||||||
From: "Timur I. Bakeyev" <timur@FreeBSD.org>
|
|
||||||
Date: Sun, 30 May 2021 02:51:47 +0200
|
|
||||||
Subject: [PATCH 12/28] Create shared libraries according to the
|
|
||||||
FreeBSD-specific naming schema, where only major.minor versions are used.
|
|
||||||
|
|
||||||
https://docs.freebsd.org/en/books/developers-handbook/policies/#policies-shlib
|
|
||||||
|
|
||||||
Signed-off-by: Timur I. Bakeyev <timur@FreeBSD.org>
|
|
||||||
---
|
|
||||||
buildtools/wafsamba/samba_install.py | 2 +-
|
|
||||||
1 file changed, 1 insertion(+), 1 deletion(-)
|
|
||||||
|
|
||||||
diff --git a/buildtools/wafsamba/samba_install.py b/buildtools/wafsamba/samba_install.py
|
|
||||||
index 2957e16c3da..82abbf893e2 100644
|
|
||||||
--- a/buildtools/wafsamba/samba_install.py
|
|
||||||
+++ b/buildtools/wafsamba/samba_install.py
|
|
||||||
@@ -115,7 +115,7 @@ def install_library(self):
|
|
||||||
inst_name = bld.make_libname(t.target)
|
|
||||||
elif self.vnum:
|
|
||||||
vnum_base = self.vnum.split('.')[0]
|
|
||||||
- install_name = bld.make_libname(target_name, version=self.vnum)
|
|
||||||
+ install_name = bld.make_libname(target_name, version=vnum_base)
|
|
||||||
install_link = bld.make_libname(target_name, version=vnum_base)
|
|
||||||
inst_name = bld.make_libname(t.target)
|
|
||||||
if not self.private_library or not t.env.SONAME_ST:
|
|
||||||
--
|
|
||||||
2.37.1
|
|
||||||
|
|
||||||
@ -1,70 +0,0 @@
|
|||||||
From 6be12b41eb0f71cfc25b5df6659dd176bd681621 Mon Sep 17 00:00:00 2001
|
|
||||||
From: "Timur I. Bakeyev" <timur@FreeBSD.org>
|
|
||||||
Date: Thu, 8 Sep 2022 00:25:05 +0200
|
|
||||||
Subject: [PATCH 13/28] Pass additional msg parameter to CHECK_LIB(), so it can
|
|
||||||
be transited to the conf.check(), which allows us to specify `match`
|
|
||||||
parameter to opt.add_option().
|
|
||||||
|
|
||||||
Signed-off-by: Timur I. Bakeyev <timur@FreeBSD.org>
|
|
||||||
---
|
|
||||||
buildtools/wafsamba/samba_autoconf.py | 9 ++++++---
|
|
||||||
buildtools/wafsamba/wscript | 9 +++++++--
|
|
||||||
2 files changed, 13 insertions(+), 5 deletions(-)
|
|
||||||
|
|
||||||
diff --git a/buildtools/wafsamba/samba_autoconf.py b/buildtools/wafsamba/samba_autoconf.py
|
|
||||||
index cf87c8bb9ff..f6c72d99125 100644
|
|
||||||
--- a/buildtools/wafsamba/samba_autoconf.py
|
|
||||||
+++ b/buildtools/wafsamba/samba_autoconf.py
|
|
||||||
@@ -593,7 +593,7 @@ def library_flags(self, libs):
|
|
||||||
|
|
||||||
|
|
||||||
@conf
|
|
||||||
-def CHECK_LIB(conf, libs, mandatory=False, empty_decl=True, set_target=True, shlib=False):
|
|
||||||
+def CHECK_LIB(conf, libs, mandatory=False, empty_decl=True, set_target=True, shlib=False, msg=None):
|
|
||||||
'''check if a set of libraries exist as system libraries
|
|
||||||
|
|
||||||
returns the sublist of libs that do exist as a syslib or []
|
|
||||||
@@ -613,11 +613,14 @@ int foo()
|
|
||||||
ret.append(lib)
|
|
||||||
continue
|
|
||||||
|
|
||||||
+ if msg is None:
|
|
||||||
+ msg = 'Checking for library %s' % lib
|
|
||||||
+
|
|
||||||
(ccflags, ldflags, cpppath) = library_flags(conf, lib)
|
|
||||||
if shlib:
|
|
||||||
- res = conf.check(features='c cshlib', fragment=fragment, lib=lib, uselib_store=lib, cflags=ccflags, ldflags=ldflags, uselib=lib.upper(), mandatory=False)
|
|
||||||
+ res = conf.check(features='c cshlib', fragment=fragment, lib=lib, uselib_store=lib, cflags=ccflags, ldflags=ldflags, uselib=lib.upper(), mandatory=False, msg=msg)
|
|
||||||
else:
|
|
||||||
- res = conf.check(lib=lib, uselib_store=lib, cflags=ccflags, ldflags=ldflags, uselib=lib.upper(), mandatory=False)
|
|
||||||
+ res = conf.check(lib=lib, uselib_store=lib, cflags=ccflags, ldflags=ldflags, uselib=lib.upper(), mandatory=False, msg=msg)
|
|
||||||
|
|
||||||
if not res:
|
|
||||||
if mandatory:
|
|
||||||
diff --git a/buildtools/wafsamba/wscript b/buildtools/wafsamba/wscript
|
|
||||||
index a4d6f3e5c49..c047e1e8b5a 100644
|
|
||||||
--- a/buildtools/wafsamba/wscript
|
|
||||||
+++ b/buildtools/wafsamba/wscript
|
|
||||||
@@ -133,12 +133,17 @@ Currently the only tested value is 'smbtorture,smbd/smbd' for Samba'''),
|
|
||||||
help=("private library directory [PREFIX/lib/%s]" % Context.g_module.APPNAME),
|
|
||||||
action="store", dest='PRIVATELIBDIR', default=None)
|
|
||||||
|
|
||||||
+ opt.add_option('--with-openldap',
|
|
||||||
+ help='additional directory to search for OpenLDAP libs',
|
|
||||||
+ action='store', dest='ldap_open', default=None,
|
|
||||||
+ match = ['Checking for library lber', 'Checking for library ldap'])
|
|
||||||
+
|
|
||||||
opt.add_option('--with-libiconv',
|
|
||||||
help='additional directory to search for libiconv',
|
|
||||||
- action='store', dest='iconv_open', default='/usr/local',
|
|
||||||
+ action='store', dest='iconv_open', default=None,
|
|
||||||
match = ['Checking for library iconv', 'Checking for iconv_open', 'Checking for header iconv.h'])
|
|
||||||
opt.add_option('--without-gettext',
|
|
||||||
- help=("Disable use of gettext"),
|
|
||||||
+ help=("disable use of gettext"),
|
|
||||||
action="store_true", dest='disable_gettext', default=False)
|
|
||||||
|
|
||||||
gr = opt.option_group('developer options')
|
|
||||||
--
|
|
||||||
2.37.1
|
|
||||||
|
|
||||||
@ -1,77 +0,0 @@
|
|||||||
From 2f16c17b683655fe318a1e6d45aaad3857d1a512 Mon Sep 17 00:00:00 2001
|
|
||||||
From: "Timur I. Bakeyev" <timur@FreeBSD.org>
|
|
||||||
Date: Mon, 31 May 2021 00:35:36 +0200
|
|
||||||
Subject: [PATCH 14/28] Add option to disable CTDB tests - failing on FreeBSD
|
|
||||||
right now in too many places.
|
|
||||||
|
|
||||||
Signed-off-by: Timur I. Bakeyev <timur@FreeBSD.org>
|
|
||||||
---
|
|
||||||
ctdb/wscript | 24 ++++++++++++++++++------
|
|
||||||
1 file changed, 18 insertions(+), 6 deletions(-)
|
|
||||||
|
|
||||||
diff --git a/ctdb/wscript b/ctdb/wscript
|
|
||||||
index a9fef9241aa..c89c6decdd7 100644
|
|
||||||
--- a/ctdb/wscript
|
|
||||||
+++ b/ctdb/wscript
|
|
||||||
@@ -106,6 +106,9 @@ def options(opt):
|
|
||||||
opt.add_option('--enable-ceph-reclock',
|
|
||||||
help=("Enable Ceph CTDB recovery lock helper (default=no)"),
|
|
||||||
action="store_true", dest='ctdb_ceph_reclock', default=False)
|
|
||||||
+ opt.add_option('--disable-ctdb-tests',
|
|
||||||
+ help=("Disable CTDB tests (default=no)"),
|
|
||||||
+ action="store_true", dest='ctdb_no_tests', default=False)
|
|
||||||
|
|
||||||
opt.add_option('--with-logdir',
|
|
||||||
help=("Path to log directory"),
|
|
||||||
@@ -278,7 +281,7 @@ def configure(conf):
|
|
||||||
|
|
||||||
if Options.options.ctdb_ceph_reclock:
|
|
||||||
if (conf.CHECK_HEADERS('rados/librados.h', False, False, 'rados') and
|
|
||||||
- conf.CHECK_LIB('rados', shlib=True)):
|
|
||||||
+ conf.CHECK_LIB('rados', shlib=True)):
|
|
||||||
Logs.info('Building with Ceph librados recovery lock support')
|
|
||||||
conf.define('HAVE_LIBRADOS', 1)
|
|
||||||
else:
|
|
||||||
@@ -317,8 +320,14 @@ def configure(conf):
|
|
||||||
conf.env.CTDB_VARDIR,
|
|
||||||
conf.env.CTDB_RUNDIR))
|
|
||||||
|
|
||||||
- conf.env.CTDB_TEST_DATADIR = os.path.join(conf.env.CTDB_DATADIR, 'tests')
|
|
||||||
- conf.env.CTDB_TEST_LIBEXECDIR = os.path.join(conf.env.LIBEXECDIR, 'ctdb/tests')
|
|
||||||
+ if Options.options.ctdb_no_tests:
|
|
||||||
+ conf.env.ctdb_tests = False
|
|
||||||
+ else:
|
|
||||||
+ conf.env.ctdb_tests = True
|
|
||||||
+
|
|
||||||
+ if conf.env.ctdb_tests:
|
|
||||||
+ conf.env.CTDB_TEST_DATADIR = os.path.join(conf.env.CTDB_DATADIR, 'tests')
|
|
||||||
+ conf.env.CTDB_TEST_LIBEXECDIR = os.path.join(conf.env.LIBEXECDIR, 'ctdb/tests')
|
|
||||||
|
|
||||||
# Allow unified compilation and separate compilation of utilities
|
|
||||||
# to find includes
|
|
||||||
@@ -706,9 +715,9 @@ def build(bld):
|
|
||||||
if bld.env.HAVE_LIBRADOS:
|
|
||||||
bld.SAMBA_BINARY('ctdb_mutex_ceph_rados_helper',
|
|
||||||
source='utils/ceph/ctdb_mutex_ceph_rados_helper.c',
|
|
||||||
- deps='talloc tevent rados',
|
|
||||||
- includes='include',
|
|
||||||
- install_path='${CTDB_HELPER_BINDIR}')
|
|
||||||
+ deps='talloc tevent rados',
|
|
||||||
+ includes='include',
|
|
||||||
+ install_path='${CTDB_HELPER_BINDIR}')
|
|
||||||
|
|
||||||
sed_expr1 = 's|/usr/local/var/lib/ctdb|%s|g' % (bld.env.CTDB_VARDIR)
|
|
||||||
sed_expr2 = 's|/usr/local/etc/ctdb|%s|g' % (bld.env.CTDB_ETCDIR)
|
|
||||||
@@ -885,6 +894,9 @@ def build(bld):
|
|
||||||
for d in ['volatile', 'persistent', 'state']:
|
|
||||||
bld.INSTALL_DIR(os.path.join(bld.env.CTDB_VARDIR, d))
|
|
||||||
|
|
||||||
+ if not bld.env.ctdb_tests:
|
|
||||||
+ return
|
|
||||||
+
|
|
||||||
#
|
|
||||||
# Test-only below this point
|
|
||||||
#
|
|
||||||
--
|
|
||||||
2.37.1
|
|
||||||
|
|
||||||
@ -1,132 +0,0 @@
|
|||||||
From 08e648c899e5023f337d2fa56e4e758f62f31ec4 Mon Sep 17 00:00:00 2001
|
|
||||||
From: "Timur I. Bakeyev" <timur@FreeBSD.org>
|
|
||||||
Date: Mon, 31 May 2021 00:38:38 +0200
|
|
||||||
Subject: [PATCH 15/28] Add extra debug class to trck down DB locking code.
|
|
||||||
|
|
||||||
Signed-off-by: Timur I. Bakeyev <timur@FreeBSD.org>
|
|
||||||
---
|
|
||||||
lib/dbwrap/dbwrap.c | 3 +++
|
|
||||||
lib/dbwrap/dbwrap_local_open.c | 3 +++
|
|
||||||
lib/dbwrap/dbwrap_rbt.c | 3 +++
|
|
||||||
lib/dbwrap/dbwrap_tdb.c | 3 +++
|
|
||||||
lib/dbwrap/dbwrap_util.c | 3 +++
|
|
||||||
source3/lib/dbwrap/dbwrap_ctdb.c | 3 +++
|
|
||||||
source3/lib/dbwrap/dbwrap_open.c | 3 +++
|
|
||||||
source3/lib/dbwrap/dbwrap_watch.c | 3 +++
|
|
||||||
8 files changed, 24 insertions(+)
|
|
||||||
|
|
||||||
diff --git a/lib/dbwrap/dbwrap.c b/lib/dbwrap/dbwrap.c
|
|
||||||
index 7555efaa3ab..51f58fea851 100644
|
|
||||||
--- a/lib/dbwrap/dbwrap.c
|
|
||||||
+++ b/lib/dbwrap/dbwrap.c
|
|
||||||
@@ -28,6 +28,9 @@
|
|
||||||
#include "lib/util/util_tdb.h"
|
|
||||||
#include "lib/util/tevent_ntstatus.h"
|
|
||||||
|
|
||||||
+#undef DBGC_CLASS
|
|
||||||
+#define DBGC_CLASS DBGC_LOCKING
|
|
||||||
+
|
|
||||||
/*
|
|
||||||
* Fall back using fetch if no genuine exists operation is provided
|
|
||||||
*/
|
|
||||||
diff --git a/lib/dbwrap/dbwrap_local_open.c b/lib/dbwrap/dbwrap_local_open.c
|
|
||||||
index 20c5fa0e1d2..b834bbd0e41 100644
|
|
||||||
--- a/lib/dbwrap/dbwrap_local_open.c
|
|
||||||
+++ b/lib/dbwrap/dbwrap_local_open.c
|
|
||||||
@@ -23,6 +23,9 @@
|
|
||||||
#include "dbwrap/dbwrap_tdb.h"
|
|
||||||
#include "tdb.h"
|
|
||||||
|
|
||||||
+#undef DBGC_CLASS
|
|
||||||
+#define DBGC_CLASS DBGC_LOCKING
|
|
||||||
+
|
|
||||||
struct db_context *dbwrap_local_open(TALLOC_CTX *mem_ctx,
|
|
||||||
const char *name,
|
|
||||||
int hash_size, int tdb_flags,
|
|
||||||
diff --git a/lib/dbwrap/dbwrap_rbt.c b/lib/dbwrap/dbwrap_rbt.c
|
|
||||||
index db456dfffba..483558a6dc7 100644
|
|
||||||
--- a/lib/dbwrap/dbwrap_rbt.c
|
|
||||||
+++ b/lib/dbwrap/dbwrap_rbt.c
|
|
||||||
@@ -24,6 +24,9 @@
|
|
||||||
#include "../lib/util/rbtree.h"
|
|
||||||
#include "../lib/util/dlinklist.h"
|
|
||||||
|
|
||||||
+#undef DBGC_CLASS
|
|
||||||
+#define DBGC_CLASS DBGC_LOCKING
|
|
||||||
+
|
|
||||||
#define DBWRAP_RBT_ALIGN(_size_) (((_size_)+15)&~15)
|
|
||||||
|
|
||||||
struct db_rbt_ctx {
|
|
||||||
diff --git a/lib/dbwrap/dbwrap_tdb.c b/lib/dbwrap/dbwrap_tdb.c
|
|
||||||
index 6cd95fa25ad..4a75cd80256 100644
|
|
||||||
--- a/lib/dbwrap/dbwrap_tdb.c
|
|
||||||
+++ b/lib/dbwrap/dbwrap_tdb.c
|
|
||||||
@@ -29,6 +29,9 @@
|
|
||||||
#include "lib/param/param.h"
|
|
||||||
#include "libcli/util/error.h"
|
|
||||||
|
|
||||||
+#undef DBGC_CLASS
|
|
||||||
+#define DBGC_CLASS DBGC_LOCKING
|
|
||||||
+
|
|
||||||
struct db_tdb_ctx {
|
|
||||||
struct tdb_wrap *wtdb;
|
|
||||||
|
|
||||||
diff --git a/lib/dbwrap/dbwrap_util.c b/lib/dbwrap/dbwrap_util.c
|
|
||||||
index df6dea40097..465814f0952 100644
|
|
||||||
--- a/lib/dbwrap/dbwrap_util.c
|
|
||||||
+++ b/lib/dbwrap/dbwrap_util.c
|
|
||||||
@@ -26,6 +26,9 @@
|
|
||||||
#include "dbwrap.h"
|
|
||||||
#include "lib/util/util_tdb.h"
|
|
||||||
|
|
||||||
+#undef DBGC_CLASS
|
|
||||||
+#define DBGC_CLASS DBGC_LOCKING
|
|
||||||
+
|
|
||||||
struct dbwrap_fetch_int32_state {
|
|
||||||
NTSTATUS status;
|
|
||||||
int32_t result;
|
|
||||||
diff --git a/source3/lib/dbwrap/dbwrap_ctdb.c b/source3/lib/dbwrap/dbwrap_ctdb.c
|
|
||||||
index 0907089164a..9fc771d1217 100644
|
|
||||||
--- a/source3/lib/dbwrap/dbwrap_ctdb.c
|
|
||||||
+++ b/source3/lib/dbwrap/dbwrap_ctdb.c
|
|
||||||
@@ -38,6 +38,9 @@
|
|
||||||
#include "lib/cluster_support.h"
|
|
||||||
#include "lib/util/tevent_ntstatus.h"
|
|
||||||
|
|
||||||
+#undef DBGC_CLASS
|
|
||||||
+#define DBGC_CLASS DBGC_LOCKING
|
|
||||||
+
|
|
||||||
struct db_ctdb_transaction_handle {
|
|
||||||
struct db_ctdb_ctx *ctx;
|
|
||||||
/*
|
|
||||||
diff --git a/source3/lib/dbwrap/dbwrap_open.c b/source3/lib/dbwrap/dbwrap_open.c
|
|
||||||
index 52c8a94aeff..caefb579058 100644
|
|
||||||
--- a/source3/lib/dbwrap/dbwrap_open.c
|
|
||||||
+++ b/source3/lib/dbwrap/dbwrap_open.c
|
|
||||||
@@ -31,6 +31,9 @@
|
|
||||||
#include "ctdbd_conn.h"
|
|
||||||
#include "global_contexts.h"
|
|
||||||
|
|
||||||
+#undef DBGC_CLASS
|
|
||||||
+#define DBGC_CLASS DBGC_LOCKING
|
|
||||||
+
|
|
||||||
bool db_is_local(const char *name)
|
|
||||||
{
|
|
||||||
const char *sockname = lp_ctdbd_socket();
|
|
||||||
diff --git a/source3/lib/dbwrap/dbwrap_watch.c b/source3/lib/dbwrap/dbwrap_watch.c
|
|
||||||
index 17a52de37cc..77f7b178229 100644
|
|
||||||
--- a/source3/lib/dbwrap/dbwrap_watch.c
|
|
||||||
+++ b/source3/lib/dbwrap/dbwrap_watch.c
|
|
||||||
@@ -28,6 +28,9 @@
|
|
||||||
#include "server_id_watch.h"
|
|
||||||
#include "lib/dbwrap/dbwrap_private.h"
|
|
||||||
|
|
||||||
+#undef DBGC_CLASS
|
|
||||||
+#define DBGC_CLASS DBGC_LOCKING
|
|
||||||
+
|
|
||||||
struct dbwrap_watcher {
|
|
||||||
/*
|
|
||||||
* Process watching this record
|
|
||||||
--
|
|
||||||
2.37.1
|
|
||||||
|
|
||||||
@ -1,29 +0,0 @@
|
|||||||
From 2b3ee747cdf83b80d07aaf1b261956bc9894ff36 Mon Sep 17 00:00:00 2001
|
|
||||||
From: "Timur I. Bakeyev" <timur@FreeBSD.org>
|
|
||||||
Date: Thu, 8 Sep 2022 00:06:37 +0200
|
|
||||||
Subject: [PATCH 16/28] Make ldb_schema_attribute_compare() a stable
|
|
||||||
comparision function.
|
|
||||||
|
|
||||||
Signed-off-by: Timur I. Bakeyev <timur@FreeBSD.org>
|
|
||||||
---
|
|
||||||
lib/ldb/ldb_key_value/ldb_kv_cache.c | 4 +++-
|
|
||||||
1 file changed, 3 insertions(+), 1 deletion(-)
|
|
||||||
|
|
||||||
diff --git a/lib/ldb/ldb_key_value/ldb_kv_cache.c b/lib/ldb/ldb_key_value/ldb_kv_cache.c
|
|
||||||
index 4a3c9f29020..cb200aeb9ba 100644
|
|
||||||
--- a/lib/ldb/ldb_key_value/ldb_kv_cache.c
|
|
||||||
+++ b/lib/ldb/ldb_key_value/ldb_kv_cache.c
|
|
||||||
@@ -92,7 +92,9 @@ static int ldb_schema_attribute_compare(const void *p1, const void *p2)
|
|
||||||
{
|
|
||||||
const struct ldb_schema_attribute *sa1 = (const struct ldb_schema_attribute *)p1;
|
|
||||||
const struct ldb_schema_attribute *sa2 = (const struct ldb_schema_attribute *)p2;
|
|
||||||
- return ldb_attr_cmp(sa1->name, sa2->name);
|
|
||||||
+ int res = ldb_attr_cmp(sa1->name, sa2->name);
|
|
||||||
+
|
|
||||||
+ return (res) ? res : (sa1->flags > sa2->flags) ? 1 : (sa1->flags < sa2->flags) ? -1 : 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
/*
|
|
||||||
--
|
|
||||||
2.37.1
|
|
||||||
|
|
||||||
@ -1,49 +0,0 @@
|
|||||||
From 42c9490dd346ee2f4369cbed4c37cb43f06e5d19 Mon Sep 17 00:00:00 2001
|
|
||||||
From: "Timur I. Bakeyev" <timur@FreeBSD.org>
|
|
||||||
Date: Wed, 7 Sep 2022 23:52:43 +0200
|
|
||||||
Subject: [PATCH 17/28] Use arc4random() when available to generate random
|
|
||||||
talloc slab signature.
|
|
||||||
|
|
||||||
Signed-off-by: Timur I. Bakeyev <timur@FreeBSD.org>
|
|
||||||
---
|
|
||||||
lib/talloc/talloc.c | 4 ++++
|
|
||||||
lib/talloc/wscript | 1 +
|
|
||||||
2 files changed, 5 insertions(+)
|
|
||||||
|
|
||||||
diff --git a/lib/talloc/talloc.c b/lib/talloc/talloc.c
|
|
||||||
index 29da190880a..79c76fd9e35 100644
|
|
||||||
--- a/lib/talloc/talloc.c
|
|
||||||
+++ b/lib/talloc/talloc.c
|
|
||||||
@@ -397,6 +397,9 @@ void talloc_lib_init(void) CONSTRUCTOR;
|
|
||||||
void talloc_lib_init(void)
|
|
||||||
{
|
|
||||||
uint32_t random_value;
|
|
||||||
+#if defined(HAVE_ARC4RANDOM)
|
|
||||||
+ random_value = arc4random();
|
|
||||||
+#else
|
|
||||||
#if defined(HAVE_GETAUXVAL) && defined(AT_RANDOM)
|
|
||||||
uint8_t *p;
|
|
||||||
/*
|
|
||||||
@@ -430,6 +433,7 @@ void talloc_lib_init(void)
|
|
||||||
*/
|
|
||||||
random_value = ((uintptr_t)talloc_lib_init & 0xFFFFFFFF);
|
|
||||||
}
|
|
||||||
+#endif /* HAVE_ARC4RANDOM */
|
|
||||||
talloc_magic = random_value & ~TALLOC_FLAG_MASK;
|
|
||||||
}
|
|
||||||
#else
|
|
||||||
diff --git a/lib/talloc/wscript b/lib/talloc/wscript
|
|
||||||
index f0c266a7878..c75ec0505df 100644
|
|
||||||
--- a/lib/talloc/wscript
|
|
||||||
+++ b/lib/talloc/wscript
|
|
||||||
@@ -52,6 +52,7 @@ def configure(conf):
|
|
||||||
|
|
||||||
conf.CHECK_HEADERS('sys/auxv.h')
|
|
||||||
conf.CHECK_FUNCS('getauxval')
|
|
||||||
+ conf.CHECK_FUNCS('arc4random')
|
|
||||||
|
|
||||||
conf.SAMBA_CONFIG_H()
|
|
||||||
|
|
||||||
--
|
|
||||||
2.37.1
|
|
||||||
|
|
||||||
@ -1,65 +0,0 @@
|
|||||||
From b81d399aa6d9e2bdbb9db0efa8109c41aad4d025 Mon Sep 17 00:00:00 2001
|
|
||||||
From: "Timur I. Bakeyev" <timur@FreeBSD.org>
|
|
||||||
Date: Mon, 31 May 2021 02:49:20 +0200
|
|
||||||
Subject: [PATCH 18/28] Add configuration option that allows to choose
|
|
||||||
alternative mDNS implementation dns_sd library.
|
|
||||||
|
|
||||||
Signed-off-by: Timur I. Bakeyev <timur@FreeBSD.org>
|
|
||||||
---
|
|
||||||
source3/wscript | 12 ++++++++++++
|
|
||||||
source3/wscript_build | 2 ++
|
|
||||||
2 files changed, 14 insertions(+)
|
|
||||||
|
|
||||||
diff --git a/source3/wscript b/source3/wscript
|
|
||||||
index 2121b8b6510..6209472c6c8 100644
|
|
||||||
--- a/source3/wscript
|
|
||||||
+++ b/source3/wscript
|
|
||||||
@@ -70,6 +70,7 @@ def options(opt):
|
|
||||||
opt.samba_add_onoff_option('sendfile-support', default=None)
|
|
||||||
opt.samba_add_onoff_option('utmp')
|
|
||||||
opt.samba_add_onoff_option('avahi', with_name="enable", without_name="disable")
|
|
||||||
+ opt.samba_add_onoff_option('dnssd', with_name="enable", without_name="disable")
|
|
||||||
opt.samba_add_onoff_option('iconv')
|
|
||||||
opt.samba_add_onoff_option('acl-support')
|
|
||||||
opt.samba_add_onoff_option('syslog')
|
|
||||||
@@ -855,6 +856,17 @@ msg.msg_accrightslen = sizeof(fd);
|
|
||||||
conf.SET_TARGET_TYPE('avahi-common', 'EMPTY')
|
|
||||||
conf.SET_TARGET_TYPE('avahi-client', 'EMPTY')
|
|
||||||
|
|
||||||
+ if Options.options.with_dnssd:
|
|
||||||
+ conf.env.with_dnssd = True
|
|
||||||
+ if not conf.CHECK_HEADERS('dns_sd.h'):
|
|
||||||
+ conf.env.with_dnssd = False
|
|
||||||
+ if not conf.CHECK_FUNCS_IN('DNSServiceRegister', 'dns_sd'):
|
|
||||||
+ conf.env.with_dnssd = False
|
|
||||||
+ if conf.env.with_dnssd:
|
|
||||||
+ conf.DEFINE('WITH_DNSSD_SUPPORT', 1)
|
|
||||||
+ else:
|
|
||||||
+ conf.SET_TARGET_TYPE('dns_sd', 'EMPTY')
|
|
||||||
+
|
|
||||||
if Options.options.with_iconv:
|
|
||||||
conf.env.with_iconv = True
|
|
||||||
if not conf.CHECK_FUNCS_IN('iconv_open', 'iconv', headers='iconv.h'):
|
|
||||||
diff --git a/source3/wscript_build b/source3/wscript_build
|
|
||||||
index 5cf965dc45d..edd7985e648 100644
|
|
||||||
--- a/source3/wscript_build
|
|
||||||
+++ b/source3/wscript_build
|
|
||||||
@@ -709,6 +709,7 @@ bld.SAMBA3_LIBRARY('smbd_base',
|
|
||||||
samba3core
|
|
||||||
param_service
|
|
||||||
AVAHI
|
|
||||||
+ dns_sd
|
|
||||||
PROFILE
|
|
||||||
LOCKING
|
|
||||||
LIBADS_SERVER
|
|
||||||
@@ -1128,6 +1129,7 @@ bld.SAMBA3_BINARY('client/smbclient',
|
|
||||||
msrpc3
|
|
||||||
RPC_NDR_SRVSVC
|
|
||||||
cli_smb_common
|
|
||||||
+ dns_sd
|
|
||||||
archive
|
|
||||||
''')
|
|
||||||
|
|
||||||
--
|
|
||||||
2.37.1
|
|
||||||
|
|
||||||
@ -1,544 +0,0 @@
|
|||||||
From 5aabf82dfaf325bf682db85d80476224e7005a41 Mon Sep 17 00:00:00 2001
|
|
||||||
From: "Timur I. Bakeyev" <timur@FreeBSD.org>
|
|
||||||
Date: Mon, 31 May 2021 00:46:16 +0200
|
|
||||||
Subject: [PATCH 19/28] From 923bc7a1afeb0b920e60e14846987ae1d2d7dca4 Mon Sep
|
|
||||||
17 00:00:00 2001 From: John Hixson <john@ixsystems.com> Date: Thu, 7 Dec 2017
|
|
||||||
09:36:32 -0500 Subject: [PATCH] Freenas/master mdns fixes (#22)
|
|
||||||
|
|
||||||
* mDNS fixes for Samba (work in progress).
|
|
||||||
* Fix mDNS - Can advertise on individual interfaces
|
|
||||||
* Fix mDNS browsing in smbclient
|
|
||||||
|
|
||||||
Signed-off-by: Timur I. Bakeyev <timur@iXsystems.com>
|
|
||||||
Signed-off-by: Timur I. Bakeyev <timur@FreeBSD.org>
|
|
||||||
---
|
|
||||||
source3/client/dnsbrowse.c | 19 +-
|
|
||||||
source3/smbd/dnsregister.c | 354 ++++++++++++++++++++++++++++++-------
|
|
||||||
2 files changed, 299 insertions(+), 74 deletions(-)
|
|
||||||
|
|
||||||
diff --git a/source3/client/dnsbrowse.c b/source3/client/dnsbrowse.c
|
|
||||||
index be6eb881cf1..83aef966d2a 100644
|
|
||||||
--- a/source3/client/dnsbrowse.c
|
|
||||||
+++ b/source3/client/dnsbrowse.c
|
|
||||||
@@ -39,6 +39,7 @@ struct mdns_smbsrv_result
|
|
||||||
struct mdns_browse_state
|
|
||||||
{
|
|
||||||
struct mdns_smbsrv_result *listhead; /* Browse result list head */
|
|
||||||
+ TALLOC_CTX * ctx;
|
|
||||||
int browseDone;
|
|
||||||
|
|
||||||
};
|
|
||||||
@@ -64,7 +65,7 @@ static void do_smb_resolve(struct mdns_smbsrv_result *browsesrv)
|
|
||||||
struct timeval tv;
|
|
||||||
DNSServiceErrorType err;
|
|
||||||
|
|
||||||
- TALLOC_CTX * ctx = talloc_tos();
|
|
||||||
+ TALLOC_CTX * ctx = talloc_new(NULL);
|
|
||||||
|
|
||||||
err = DNSServiceResolve(&mdns_conn_sdref, 0 /* flags */,
|
|
||||||
browsesrv->ifIndex,
|
|
||||||
@@ -91,7 +92,7 @@ static void do_smb_resolve(struct mdns_smbsrv_result *browsesrv)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
- TALLOC_FREE(fdset);
|
|
||||||
+ TALLOC_FREE(ctx);
|
|
||||||
DNSServiceRefDeallocate(mdns_conn_sdref);
|
|
||||||
}
|
|
||||||
|
|
||||||
@@ -124,18 +125,19 @@ do_smb_browse_reply(DNSServiceRef sdRef, DNSServiceFlags flags,
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
- bresult = talloc_array(talloc_tos(), struct mdns_smbsrv_result, 1);
|
|
||||||
+ bresult = talloc_array(bstatep->ctx, struct mdns_smbsrv_result, 1);
|
|
||||||
if (bresult == NULL) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
+ bresult->nextResult = NULL;
|
|
||||||
if (bstatep->listhead != NULL) {
|
|
||||||
bresult->nextResult = bstatep->listhead;
|
|
||||||
}
|
|
||||||
|
|
||||||
- bresult->serviceName = talloc_strdup(talloc_tos(), serviceName);
|
|
||||||
- bresult->regType = talloc_strdup(talloc_tos(), regtype);
|
|
||||||
- bresult->domain = talloc_strdup(talloc_tos(), replyDomain);
|
|
||||||
+ bresult->serviceName = talloc_strdup(bstatep->ctx, serviceName);
|
|
||||||
+ bresult->regType = talloc_strdup(bstatep->ctx, regtype);
|
|
||||||
+ bresult->domain = talloc_strdup(bstatep->ctx, replyDomain);
|
|
||||||
bresult->ifIndex = interfaceIndex;
|
|
||||||
bstatep->listhead = bresult;
|
|
||||||
}
|
|
||||||
@@ -151,10 +153,13 @@ int do_smb_browse(void)
|
|
||||||
DNSServiceRef mdns_conn_sdref = NULL;
|
|
||||||
DNSServiceErrorType err;
|
|
||||||
|
|
||||||
- TALLOC_CTX * ctx = talloc_stackframe();
|
|
||||||
+ TALLOC_CTX * ctx = talloc_new(NULL);
|
|
||||||
|
|
||||||
ZERO_STRUCT(bstate);
|
|
||||||
|
|
||||||
+ bstate.ctx = ctx;
|
|
||||||
+ bstate.listhead = NULL;
|
|
||||||
+
|
|
||||||
err = DNSServiceBrowse(&mdns_conn_sdref, 0, 0, "_smb._tcp", "",
|
|
||||||
do_smb_browse_reply, &bstate);
|
|
||||||
|
|
||||||
diff --git a/source3/smbd/dnsregister.c b/source3/smbd/dnsregister.c
|
|
||||||
index df189001a09..389a4278f64 100644
|
|
||||||
--- a/source3/smbd/dnsregister.c
|
|
||||||
+++ b/source3/smbd/dnsregister.c
|
|
||||||
@@ -29,6 +29,29 @@
|
|
||||||
* browse for advertised SMB services.
|
|
||||||
*/
|
|
||||||
|
|
||||||
+/*
|
|
||||||
+ * Time Machine Errata:
|
|
||||||
+ * sys=adVF=0x100 -- this is required when ._adisk._tcp is present on device. When it is
|
|
||||||
+ * set, the MacOS client will send a NetShareEnumAll IOCTL and shares will be visible.
|
|
||||||
+ * Otherwise, Finder will only see the Time Machine share. In the absence of ._adisk._tcp
|
|
||||||
+ * MacOS will _always_ send NetShareEnumAll IOCTL.
|
|
||||||
+ *
|
|
||||||
+ * waMa=0 -- MacOS server uses waMa=0, while embedded devices have it set to their Mac Address.
|
|
||||||
+ * Speculation in Samba-Technical indicates that this stands for "Wireless AirDisk Mac Address".
|
|
||||||
+ *
|
|
||||||
+ * adVU -- AirDisk Volume UUID. Mac OS servers generate a UUID. Time machine over SMB works without one
|
|
||||||
+ * set. Netatalk generates a UUID and stores it persistently in afp_voluuid.conf. This can be
|
|
||||||
+ * set by adding the share parameter "fruit:volume_uuid = "
|
|
||||||
+ *
|
|
||||||
+ * dk(n)=adVF=
|
|
||||||
+ * 0xa1, 0x81 - AFP support
|
|
||||||
+ * 0xa2, 0x82 - SMB support
|
|
||||||
+ * 0xa3, 0x83 - AFP and SMB support
|
|
||||||
+ *
|
|
||||||
+ * adVN -- AirDisk Volume Name. We set this to the share name.
|
|
||||||
+ *
|
|
||||||
+ */
|
|
||||||
+
|
|
||||||
#define DNS_REG_RETRY_INTERVAL (5*60) /* in seconds */
|
|
||||||
|
|
||||||
#ifdef WITH_DNSSD_SUPPORT
|
|
||||||
@@ -36,85 +59,177 @@
|
|
||||||
#include <dns_sd.h>
|
|
||||||
|
|
||||||
struct dns_reg_state {
|
|
||||||
- struct tevent_context *event_ctx;
|
|
||||||
- uint16_t port;
|
|
||||||
- DNSServiceRef srv_ref;
|
|
||||||
- struct tevent_timer *te;
|
|
||||||
- int fd;
|
|
||||||
- struct tevent_fd *fde;
|
|
||||||
+ int count;
|
|
||||||
+ struct reg_state {
|
|
||||||
+ DNSServiceRef srv_ref;
|
|
||||||
+ TALLOC_CTX *mem_ctx;
|
|
||||||
+ struct tevent_context *event_ctx;
|
|
||||||
+ struct tevent_timer *te;
|
|
||||||
+ struct tevent_fd *fde;
|
|
||||||
+ uint16_t port;
|
|
||||||
+ int if_index;
|
|
||||||
+ int fd;
|
|
||||||
+ } *drs;
|
|
||||||
};
|
|
||||||
|
|
||||||
-static int dns_reg_state_destructor(struct dns_reg_state *dns_state)
|
|
||||||
+static void dns_register_smbd_retry(struct tevent_context *ctx,
|
|
||||||
+ struct tevent_timer *te,
|
|
||||||
+ struct timeval now,
|
|
||||||
+ void *private_data);
|
|
||||||
+static void dns_register_smbd_fde_handler(struct tevent_context *ev,
|
|
||||||
+ struct tevent_fd *fde,
|
|
||||||
+ uint16_t flags,
|
|
||||||
+ void *private_data);
|
|
||||||
+
|
|
||||||
+
|
|
||||||
+static int reg_state_destructor(struct reg_state *state)
|
|
||||||
{
|
|
||||||
- if (dns_state->srv_ref != NULL) {
|
|
||||||
+ if (state == NULL) {
|
|
||||||
+ return -1;
|
|
||||||
+ }
|
|
||||||
+
|
|
||||||
+ if (state->srv_ref != NULL) {
|
|
||||||
/* Close connection to the mDNS daemon */
|
|
||||||
- DNSServiceRefDeallocate(dns_state->srv_ref);
|
|
||||||
- dns_state->srv_ref = NULL;
|
|
||||||
+ DNSServiceRefDeallocate(state->srv_ref);
|
|
||||||
+ state->srv_ref = NULL;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* Clear event handler */
|
|
||||||
- TALLOC_FREE(dns_state->te);
|
|
||||||
- TALLOC_FREE(dns_state->fde);
|
|
||||||
- dns_state->fd = -1;
|
|
||||||
+ TALLOC_FREE(state->te);
|
|
||||||
+ TALLOC_FREE(state->fde);
|
|
||||||
+ state->fd = -1;
|
|
||||||
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
-static void dns_register_smbd_retry(struct tevent_context *ctx,
|
|
||||||
- struct tevent_timer *te,
|
|
||||||
- struct timeval now,
|
|
||||||
- void *private_data);
|
|
||||||
-static void dns_register_smbd_fde_handler(struct tevent_context *ev,
|
|
||||||
- struct tevent_fd *fde,
|
|
||||||
- uint16_t flags,
|
|
||||||
- void *private_data);
|
|
||||||
+int TXTRecordPrintf(TXTRecordRef * rec, const char * key, const char * fmt, ... )
|
|
||||||
+{
|
|
||||||
+ int ret = 0;
|
|
||||||
+ char *str;
|
|
||||||
+ va_list ap;
|
|
||||||
+ va_start( ap, fmt );
|
|
||||||
+
|
|
||||||
+ if( 0 > vasprintf(&str, fmt, ap ) ) {
|
|
||||||
+ va_end(ap);
|
|
||||||
+ return -1;
|
|
||||||
+ }
|
|
||||||
+ va_end(ap);
|
|
||||||
+
|
|
||||||
+ if( kDNSServiceErr_NoError != TXTRecordSetValue(rec, key, strlen(str), str) ) {
|
|
||||||
+ ret = -1;
|
|
||||||
+ }
|
|
||||||
+
|
|
||||||
+ free(str);
|
|
||||||
+ return ret;
|
|
||||||
+}
|
|
||||||
+
|
|
||||||
+int TXTRecordKeyPrintf(TXTRecordRef * rec, const char * key_fmt, int key_var, const char * fmt, ...)
|
|
||||||
+{
|
|
||||||
+ int ret = 0;
|
|
||||||
+ char *key = NULL, *str = NULL;
|
|
||||||
+ va_list ap;
|
|
||||||
+
|
|
||||||
+ if( 0 > asprintf(&key, key_fmt, key_var)) {
|
|
||||||
+ DEBUG(1, ("Failed in asprintf\n"));
|
|
||||||
+ return -1;
|
|
||||||
+ }
|
|
||||||
|
|
||||||
-static bool dns_register_smbd_schedule(struct dns_reg_state *dns_state,
|
|
||||||
+ va_start( ap, fmt );
|
|
||||||
+ if( 0 > vasprintf(&str, fmt, ap )) {
|
|
||||||
+ va_end(ap);
|
|
||||||
+ DEBUG(1, ("Failed in vasprintf\n"));
|
|
||||||
+ ret = -1;
|
|
||||||
+ goto exit;
|
|
||||||
+ }
|
|
||||||
+ va_end(ap);
|
|
||||||
+
|
|
||||||
+ if( kDNSServiceErr_NoError != TXTRecordSetValue(rec, key, strlen(str), str) ) {
|
|
||||||
+ DEBUG(1, ("Failed in TXTRecordSetValuen"));
|
|
||||||
+ ret = -1;
|
|
||||||
+ goto exit;
|
|
||||||
+ }
|
|
||||||
+
|
|
||||||
+ exit:
|
|
||||||
+ if (str)
|
|
||||||
+ free(str);
|
|
||||||
+ if (key)
|
|
||||||
+ free(key);
|
|
||||||
+ return ret;
|
|
||||||
+}
|
|
||||||
+
|
|
||||||
+
|
|
||||||
+static bool dns_register_smbd_schedule(struct reg_state *state,
|
|
||||||
struct timeval tval)
|
|
||||||
{
|
|
||||||
- dns_reg_state_destructor(dns_state);
|
|
||||||
+ reg_state_destructor(state);
|
|
||||||
|
|
||||||
- dns_state->te = tevent_add_timer(dns_state->event_ctx,
|
|
||||||
- dns_state,
|
|
||||||
+ state->te = tevent_add_timer(state->event_ctx,
|
|
||||||
+ state->mem_ctx,
|
|
||||||
tval,
|
|
||||||
dns_register_smbd_retry,
|
|
||||||
- dns_state);
|
|
||||||
- if (!dns_state->te) {
|
|
||||||
+ state);
|
|
||||||
+ if (!state->te) {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
+static void dns_register_smbd_callback(DNSServiceRef service,
|
|
||||||
+ DNSServiceFlags flags,
|
|
||||||
+ DNSServiceErrorType errorCode,
|
|
||||||
+ const char *name,
|
|
||||||
+ const char *type,
|
|
||||||
+ const char *domain,
|
|
||||||
+ void *context)
|
|
||||||
+{
|
|
||||||
+ if (errorCode != kDNSServiceErr_NoError) {
|
|
||||||
+ DEBUG(6, ("error=%d\n", errorCode));
|
|
||||||
+ } else {
|
|
||||||
+ DEBUG(6, ("%-15s %s.%s%s\n", "REGISTER", name, type, domain));
|
|
||||||
+ }
|
|
||||||
+}
|
|
||||||
+
|
|
||||||
static void dns_register_smbd_retry(struct tevent_context *ctx,
|
|
||||||
struct tevent_timer *te,
|
|
||||||
struct timeval now,
|
|
||||||
void *private_data)
|
|
||||||
{
|
|
||||||
- struct dns_reg_state *dns_state = talloc_get_type_abort(private_data,
|
|
||||||
- struct dns_reg_state);
|
|
||||||
+ struct reg_state *state = (struct reg_state *)private_data;
|
|
||||||
DNSServiceErrorType err;
|
|
||||||
+ int snum;
|
|
||||||
+ size_t dk = 0;
|
|
||||||
+ bool sys_txt_created = false;
|
|
||||||
+ TXTRecordRef txt_adisk;
|
|
||||||
+ TXTRecordRef txt_devinfo;
|
|
||||||
+ char *servname;
|
|
||||||
+ char *v_uuid;
|
|
||||||
+ int num_services = lp_numservices();
|
|
||||||
+
|
|
||||||
+ reg_state_destructor(state);
|
|
||||||
|
|
||||||
- dns_reg_state_destructor(dns_state);
|
|
||||||
+ TXTRecordCreate(&txt_adisk, 0, NULL);
|
|
||||||
|
|
||||||
- DEBUG(6, ("registering _smb._tcp service on port %d\n",
|
|
||||||
- dns_state->port));
|
|
||||||
+ DEBUG(6, ("registering _smb._tcp service on port %d index %d\n",
|
|
||||||
+ state->port, state->if_index));
|
|
||||||
|
|
||||||
/* Register service with DNS. Connects with the mDNS
|
|
||||||
* daemon running on the local system to perform DNS
|
|
||||||
* service registration.
|
|
||||||
*/
|
|
||||||
- err = DNSServiceRegister(&dns_state->srv_ref, 0 /* flags */,
|
|
||||||
- kDNSServiceInterfaceIndexAny,
|
|
||||||
- NULL /* service name */,
|
|
||||||
- "_smb._tcp" /* service type */,
|
|
||||||
- NULL /* domain */,
|
|
||||||
- "" /* SRV target host name */,
|
|
||||||
- htons(dns_state->port),
|
|
||||||
- 0 /* TXT record len */,
|
|
||||||
- NULL /* TXT record data */,
|
|
||||||
- NULL /* callback func */,
|
|
||||||
- NULL /* callback context */);
|
|
||||||
+ err = DNSServiceRegister(&state->srv_ref,
|
|
||||||
+ 0 /* flags */,
|
|
||||||
+ state->if_index /* interface index */,
|
|
||||||
+ NULL /* service name */,
|
|
||||||
+ "_smb._tcp" /* service type */,
|
|
||||||
+ NULL /* domain */,
|
|
||||||
+ "" /* SRV target host name */,
|
|
||||||
+ htons(state->port) /* port */,
|
|
||||||
+ 0 /* TXT record len */,
|
|
||||||
+ NULL /* TXT record data */,
|
|
||||||
+ dns_register_smbd_callback /* callback func */,
|
|
||||||
+ NULL /* callback context */);
|
|
||||||
+
|
|
||||||
|
|
||||||
if (err != kDNSServiceErr_NoError) {
|
|
||||||
/* Failed to register service. Schedule a re-try attempt.
|
|
||||||
@@ -123,24 +238,96 @@ static void dns_register_smbd_retry(struct tevent_context *ctx,
|
|
||||||
goto retry;
|
|
||||||
}
|
|
||||||
|
|
||||||
- dns_state->fd = DNSServiceRefSockFD(dns_state->srv_ref);
|
|
||||||
- if (dns_state->fd == -1) {
|
|
||||||
+ /*
|
|
||||||
+ * Check for services that are configured as Time Machine targets
|
|
||||||
+ *
|
|
||||||
+ */
|
|
||||||
+ for (snum = 0; snum < num_services; snum++) {
|
|
||||||
+ if (lp_snum_ok(snum) && lp_parm_bool(snum, "fruit", "time machine", false))
|
|
||||||
+ {
|
|
||||||
+ if (!sys_txt_created) {
|
|
||||||
+ if( 0 > TXTRecordPrintf(&txt_adisk, "sys", "adVF=0x100") ) {
|
|
||||||
+ DEBUG(1, ("Failed to create Zeroconf TXTRecord for sys") );
|
|
||||||
+ goto retry;
|
|
||||||
+ }
|
|
||||||
+ else
|
|
||||||
+ {
|
|
||||||
+ sys_txt_created = true;
|
|
||||||
+ }
|
|
||||||
+ }
|
|
||||||
+
|
|
||||||
+ v_uuid = lp_parm_const_string(snum, "fruit", "volume_uuid", NULL);
|
|
||||||
+ servname = lp_const_servicename(snum);
|
|
||||||
+ DEBUG(1, ("Registering volume %s for TimeMachine\n", servname));
|
|
||||||
+ if (v_uuid) {
|
|
||||||
+ if( 0 > TXTRecordKeyPrintf(&txt_adisk, "dk%zu", dk++, "adVN=%s,adVF=0x82,adVU=%s",
|
|
||||||
+ servname, v_uuid) ) {
|
|
||||||
+ DEBUG(1, ("Could not set Zeroconf TXTRecord for dk%zu \n", dk));
|
|
||||||
+ goto retry;
|
|
||||||
+ }
|
|
||||||
+ DEBUG(1, ("Registering TimeMachine with the following TXT parameters: "
|
|
||||||
+ "dk%zu,adVN=%s,adVF=0x82,adVU=%s\n", dk, servname, v_uuid) );
|
|
||||||
+ }
|
|
||||||
+ else {
|
|
||||||
+ if( 0 > TXTRecordKeyPrintf(&txt_adisk, "dk%zu", dk++, "adVN=%s,adVF=0x82",
|
|
||||||
+ servname) ) {
|
|
||||||
+ DEBUG(1, ("Could not set Zeroconf TXTRecord for dk%zu \n", dk));
|
|
||||||
+ goto retry;
|
|
||||||
+ }
|
|
||||||
+ DEBUG(1, ("Registering TimeMachine with the following TXT parameters: "
|
|
||||||
+ "dk%zu,adVN=%s,adVF=0x82\n", dk, servname) );
|
|
||||||
+ }
|
|
||||||
+ }
|
|
||||||
+ }
|
|
||||||
+
|
|
||||||
+ if (dk) {
|
|
||||||
+ err = DNSServiceRegister(&state->srv_ref,
|
|
||||||
+ 0 /* flags */,
|
|
||||||
+ state->if_index /* interface index */,
|
|
||||||
+ NULL /* service name */,
|
|
||||||
+ "_adisk._tcp" /* service type */,
|
|
||||||
+ NULL /* domain */,
|
|
||||||
+ "" /* SRV target host name */,
|
|
||||||
+ /*
|
|
||||||
+ * We would probably use port 0 zero, but we can't, from man DNSServiceRegister:
|
|
||||||
+ * "A value of 0 for a port is passed to register placeholder services.
|
|
||||||
+ * Place holder services are not found when browsing, but other
|
|
||||||
+ * clients cannot register with the same name as the placeholder service."
|
|
||||||
+ * We therefor use port 9 which is used by the adisk service type.
|
|
||||||
+ */
|
|
||||||
+ htons(9) /* port */,
|
|
||||||
+ TXTRecordGetLength(&txt_adisk) /* TXT record len */,
|
|
||||||
+ TXTRecordGetBytesPtr(&txt_adisk) /* TXT record data */,
|
|
||||||
+ dns_register_smbd_callback /* callback func */,
|
|
||||||
+ NULL /* callback context */);
|
|
||||||
+
|
|
||||||
+
|
|
||||||
+ if (err != kDNSServiceErr_NoError) {
|
|
||||||
+ /* Failed to register service. Schedule a re-try attempt.
|
|
||||||
+ */
|
|
||||||
+ DEBUG(1, ("unable to register with mDNS (err %d)\n", err));
|
|
||||||
+ goto retry;
|
|
||||||
+ }
|
|
||||||
+ }
|
|
||||||
+
|
|
||||||
+ state->fd = DNSServiceRefSockFD(state->srv_ref);
|
|
||||||
+ if (state->fd == -1) {
|
|
||||||
goto retry;
|
|
||||||
}
|
|
||||||
|
|
||||||
- dns_state->fde = tevent_add_fd(dns_state->event_ctx,
|
|
||||||
- dns_state,
|
|
||||||
- dns_state->fd,
|
|
||||||
- TEVENT_FD_READ,
|
|
||||||
- dns_register_smbd_fde_handler,
|
|
||||||
- dns_state);
|
|
||||||
- if (!dns_state->fde) {
|
|
||||||
+ state->fde = tevent_add_fd(state->event_ctx,
|
|
||||||
+ state->mem_ctx,
|
|
||||||
+ state->fd,
|
|
||||||
+ TEVENT_FD_READ,
|
|
||||||
+ dns_register_smbd_fde_handler,
|
|
||||||
+ state);
|
|
||||||
+ if (!state->fde) {
|
|
||||||
goto retry;
|
|
||||||
}
|
|
||||||
|
|
||||||
return;
|
|
||||||
retry:
|
|
||||||
- dns_register_smbd_schedule(dns_state,
|
|
||||||
+ dns_register_smbd_schedule(state,
|
|
||||||
timeval_current_ofs(DNS_REG_RETRY_INTERVAL, 0));
|
|
||||||
}
|
|
||||||
|
|
||||||
@@ -150,44 +337,77 @@ static void dns_register_smbd_fde_handler(struct tevent_context *ev,
|
|
||||||
uint16_t flags,
|
|
||||||
void *private_data)
|
|
||||||
{
|
|
||||||
- struct dns_reg_state *dns_state = talloc_get_type_abort(private_data,
|
|
||||||
- struct dns_reg_state);
|
|
||||||
+ struct reg_state *state = (struct reg_state *)private_data;
|
|
||||||
DNSServiceErrorType err;
|
|
||||||
|
|
||||||
- err = DNSServiceProcessResult(dns_state->srv_ref);
|
|
||||||
+ err = DNSServiceProcessResult(state->srv_ref);
|
|
||||||
if (err != kDNSServiceErr_NoError) {
|
|
||||||
- DEBUG(3, ("failed to process mDNS result (err %d), re-trying\n",
|
|
||||||
- err));
|
|
||||||
+ DEBUG(3, ("failed to process mDNS result (err %d), re-trying\n", err));
|
|
||||||
goto retry;
|
|
||||||
}
|
|
||||||
|
|
||||||
- talloc_free(dns_state);
|
|
||||||
return;
|
|
||||||
|
|
||||||
retry:
|
|
||||||
- dns_register_smbd_schedule(dns_state,
|
|
||||||
- timeval_current_ofs(DNS_REG_RETRY_INTERVAL, 0));
|
|
||||||
+ dns_register_smbd_schedule(state, timeval_zero());
|
|
||||||
}
|
|
||||||
|
|
||||||
+static int dns_reg_state_destructor(struct dns_reg_state *state)
|
|
||||||
+{
|
|
||||||
+ if (state != NULL) {
|
|
||||||
+ talloc_free(state);
|
|
||||||
+ }
|
|
||||||
+ return 0;
|
|
||||||
+}
|
|
||||||
+
|
|
||||||
+
|
|
||||||
bool smbd_setup_mdns_registration(struct tevent_context *ev,
|
|
||||||
TALLOC_CTX *mem_ctx,
|
|
||||||
uint16_t port)
|
|
||||||
{
|
|
||||||
struct dns_reg_state *dns_state;
|
|
||||||
+ bool bind_all = true;
|
|
||||||
+ int i;
|
|
||||||
|
|
||||||
dns_state = talloc_zero(mem_ctx, struct dns_reg_state);
|
|
||||||
- if (dns_state == NULL) {
|
|
||||||
+ if (dns_state == NULL)
|
|
||||||
+ return false;
|
|
||||||
+
|
|
||||||
+ if (lp_interfaces() && lp_bind_interfaces_only())
|
|
||||||
+ bind_all = false;
|
|
||||||
+
|
|
||||||
+ dns_state->count = iface_count();
|
|
||||||
+ if (dns_state->count <= 0 || bind_all == true)
|
|
||||||
+ dns_state->count = 1;
|
|
||||||
+
|
|
||||||
+ dns_state->drs = talloc_array(mem_ctx, struct reg_state, dns_state->count);
|
|
||||||
+ if (dns_state->drs == NULL) {
|
|
||||||
+ talloc_free(dns_state);
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
- dns_state->event_ctx = ev;
|
|
||||||
- dns_state->port = port;
|
|
||||||
- dns_state->fd = -1;
|
|
||||||
|
|
||||||
- talloc_set_destructor(dns_state, dns_reg_state_destructor);
|
|
||||||
+ for (i = 0; i < dns_state->count; i++) {
|
|
||||||
+ struct interface *iface = get_interface(i);
|
|
||||||
+ struct reg_state *state = &dns_state->drs[i];
|
|
||||||
+
|
|
||||||
+ state->mem_ctx = mem_ctx;
|
|
||||||
+ state->srv_ref = NULL;
|
|
||||||
+ state->event_ctx = ev;
|
|
||||||
+ state->te = NULL;
|
|
||||||
+ state->fde = NULL;
|
|
||||||
+ state->port = port;
|
|
||||||
+ state->fd = -1;
|
|
||||||
|
|
||||||
- return dns_register_smbd_schedule(dns_state, timeval_zero());
|
|
||||||
+ state->if_index = bind_all ? kDNSServiceInterfaceIndexAny : iface->if_index;
|
|
||||||
+
|
|
||||||
+ dns_register_smbd_schedule(&dns_state->drs[i], timeval_zero());
|
|
||||||
+ }
|
|
||||||
+
|
|
||||||
+ talloc_set_destructor(dns_state, dns_reg_state_destructor);
|
|
||||||
+ return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
+
|
|
||||||
#else /* WITH_DNSSD_SUPPORT */
|
|
||||||
|
|
||||||
bool smbd_setup_mdns_registration(struct tevent_context *ev,
|
|
||||||
--
|
|
||||||
2.37.1
|
|
||||||
|
|
||||||
@ -1,35 +0,0 @@
|
|||||||
From 02b599cc740490fa6f433b0c455fe458fdc1db61 Mon Sep 17 00:00:00 2001
|
|
||||||
From: "Timur I. Bakeyev" <timur@FreeBSD.org>
|
|
||||||
Date: Mon, 31 May 2021 02:45:11 +0200
|
|
||||||
Subject: [PATCH 20/28] FreeBSD 12 between r336017 and r342928 wrongfuly return
|
|
||||||
ENOENT for the not enabled qoutas on ZFS. Wrap relevant error code check with
|
|
||||||
the versioning ifdef's.
|
|
||||||
|
|
||||||
Signed-off-by: Timur I. Bakeyev <timur@FreeBSD.org>
|
|
||||||
---
|
|
||||||
source3/lib/sysquotas_4B.c | 9 ++++++++-
|
|
||||||
1 file changed, 8 insertions(+), 1 deletion(-)
|
|
||||||
|
|
||||||
diff --git a/source3/lib/sysquotas_4B.c b/source3/lib/sysquotas_4B.c
|
|
||||||
index d9beb924ad9..c41cac02e5f 100644
|
|
||||||
--- a/source3/lib/sysquotas_4B.c
|
|
||||||
+++ b/source3/lib/sysquotas_4B.c
|
|
||||||
@@ -140,7 +140,14 @@ static int sys_quotactl_4B(const char * path, int cmd,
|
|
||||||
/* ENOTSUP means quota support is not compiled in. EINVAL
|
|
||||||
* means that quotas are not configured (commonly).
|
|
||||||
*/
|
|
||||||
- if (errno != ENOTSUP && errno != EINVAL) {
|
|
||||||
+ if (errno != ENOTSUP && errno != EINVAL
|
|
||||||
+/*
|
|
||||||
+ * FreeBSD 12 between r336017 and r342928 wrongfuly return ENOENT for the not enabled qoutas on ZFS.
|
|
||||||
+ */
|
|
||||||
+#if defined(__FreeBSD__) && ((__FreeBSD_version >= 1102503 && __FreeBSD_version <= 1102506) || (__FreeBSD_version >= 1200072 && __FreeBSD_version <= 1200503) || (__FreeBSD_version >= 1300000 && __FreeBSD_version <= 1300009))
|
|
||||||
+ && errno != ENOENT
|
|
||||||
+#endif
|
|
||||||
+ ) {
|
|
||||||
DEBUG(5, ("failed to %s quota for %s ID %u on %s: %s\n",
|
|
||||||
(cmd & QCMD(Q_GETQUOTA, 0)) ? "get" : "set",
|
|
||||||
(cmd & QCMD(0, GRPQUOTA)) ? "group" : "user",
|
|
||||||
--
|
|
||||||
2.37.1
|
|
||||||
|
|
||||||
@ -1,36 +0,0 @@
|
|||||||
From 46f5b54aa5761541a16108d66764d662f37f04d2 Mon Sep 17 00:00:00 2001
|
|
||||||
From: "Timur I. Bakeyev" <timur@FreeBSD.org>
|
|
||||||
Date: Mon, 31 May 2021 02:41:48 +0200
|
|
||||||
Subject: [PATCH 21/28] Fix casting warnings in the nfs_quota debug message.
|
|
||||||
|
|
||||||
Initialize quota structure with zeros.
|
|
||||||
|
|
||||||
Signed-off-by: Timur I. Bakeyev <timur@FreeBSD.org>
|
|
||||||
---
|
|
||||||
source3/smbd/quotas.c | 3 ++-
|
|
||||||
1 file changed, 2 insertions(+), 1 deletion(-)
|
|
||||||
|
|
||||||
diff --git a/source3/smbd/quotas.c b/source3/smbd/quotas.c
|
|
||||||
index 604631f81d6..c23fa49b3b0 100644
|
|
||||||
--- a/source3/smbd/quotas.c
|
|
||||||
+++ b/source3/smbd/quotas.c
|
|
||||||
@@ -125,6 +125,7 @@ static bool nfs_quotas(char *nfspath, uid_t euser_id, uint64_t *bsize, uint64_t
|
|
||||||
if (!cutstr)
|
|
||||||
return False;
|
|
||||||
|
|
||||||
+ memset(&D, '\0', sizeof(D));
|
|
||||||
memset(cutstr, '\0', len+1);
|
|
||||||
host = strncat(cutstr,mnttype, sizeof(char) * len );
|
|
||||||
DEBUG(5,("nfs_quotas: looking for mount on \"%s\"\n", cutstr));
|
|
||||||
@@ -133,7 +134,7 @@ static bool nfs_quotas(char *nfspath, uid_t euser_id, uint64_t *bsize, uint64_t
|
|
||||||
args.gqa_pathp = testpath+1;
|
|
||||||
args.gqa_uid = uid;
|
|
||||||
|
|
||||||
- DEBUG(5,("nfs_quotas: Asking for host \"%s\" rpcprog \"%i\" rpcvers \"%i\" network \"%s\"\n", host, RQUOTAPROG, RQUOTAVERS, "udp"));
|
|
||||||
+ DEBUG(5,("nfs_quotas: Asking for host \"%s\" rpcprog \"%lu\" rpcvers \"%lu\" network \"%s\"\n", host, RQUOTAPROG, RQUOTAVERS, "udp"));
|
|
||||||
|
|
||||||
if ((clnt = clnt_create(host, RQUOTAPROG, RQUOTAVERS, "udp")) == NULL) {
|
|
||||||
ret = False;
|
|
||||||
--
|
|
||||||
2.37.1
|
|
||||||
|
|
||||||
@ -1,332 +0,0 @@
|
|||||||
From 5019ad026f106d51dc2bb4c410a05b2f63b56cd0 Mon Sep 17 00:00:00 2001
|
|
||||||
From: "Timur I. Bakeyev" <timur@FreeBSD.org>
|
|
||||||
Date: Mon, 31 May 2021 01:43:13 +0200
|
|
||||||
Subject: [PATCH 22/28] Clean up UTMP handling code and add FreeBSD support.
|
|
||||||
Some really legacy platforms may have been dropped as a result.
|
|
||||||
|
|
||||||
Signed-off-by: Timur I. Bakeyev <timur@FreeBSD.org>
|
|
||||||
---
|
|
||||||
source3/smbd/utmp.c | 152 +++++++++++-------------------------------
|
|
||||||
source3/wscript | 36 +++++----
|
|
||||||
2 files changed, 60 insertions(+), 128 deletions(-)
|
|
||||||
|
|
||||||
diff -Naurp a/source3/smbd/utmp.c b/source3/smbd/utmp.c
|
|
||||||
--- a/source3/smbd/utmp.c 2024-02-02 04:33:51.316490200 -0500
|
|
||||||
+++ b/source3/smbd/utmp.c 2024-08-05 12:50:57.691687000 -0400
|
|
||||||
@@ -257,7 +257,7 @@ static char *uw_pathname(TALLOC_CTX *ctx,
|
|
||||||
Update utmp file directly. No subroutine interface: probably a BSD system.
|
|
||||||
****************************************************************************/
|
|
||||||
|
|
||||||
-static void pututline_my(const char *uname, struct utmp *u, bool claim)
|
|
||||||
+static void pututline_my(const char *uname, STRUCT_UTMP *u, bool claim)
|
|
||||||
{
|
|
||||||
DEBUG(1,("pututline_my: not yet implemented\n"));
|
|
||||||
/* BSD implementor: may want to consider (or not) adjusting "lastlog" */
|
|
||||||
@@ -271,7 +271,7 @@ static void pututline_my(const char *uname, struct utm
|
|
||||||
Credit: Michail Vidiassov <master@iaas.msu.ru>
|
|
||||||
****************************************************************************/
|
|
||||||
|
|
||||||
-static void updwtmp_my(const char *wname, struct utmp *u, bool claim)
|
|
||||||
+static void updwtmp_my(const char *wname, STRUCT_UTMP *u, bool claim)
|
|
||||||
{
|
|
||||||
int fd;
|
|
||||||
struct stat buf;
|
|
||||||
@@ -303,7 +303,7 @@ static void updwtmp_my(const char *wname, struct utmp
|
|
||||||
if ((fd = open(wname, O_WRONLY|O_APPEND, 0)) < 0)
|
|
||||||
return;
|
|
||||||
if (fstat(fd, &buf) == 0) {
|
|
||||||
- if (write(fd, (char *)u, sizeof(struct utmp)) != sizeof(struct utmp))
|
|
||||||
+ if (write(fd, (char *)u, sizeof(STRUCT_UTMP)) != sizeof(STRUCT_UTMP))
|
|
||||||
(void) ftruncate(fd, buf.st_size);
|
|
||||||
}
|
|
||||||
(void) close(fd);
|
|
||||||
@@ -314,12 +314,12 @@ static void updwtmp_my(const char *wname, struct utmp
|
|
||||||
Update via utmp/wtmp (not utmpx/wtmpx).
|
|
||||||
****************************************************************************/
|
|
||||||
|
|
||||||
-static void utmp_nox_update(struct utmp *u, bool claim)
|
|
||||||
+static void utmp_nox_update(STRUCT_UTMP *u, bool claim)
|
|
||||||
{
|
|
||||||
char *uname = NULL;
|
|
||||||
char *wname = NULL;
|
|
||||||
#if defined(PUTUTLINE_RETURNS_UTMP)
|
|
||||||
- struct utmp *urc;
|
|
||||||
+ STRUCT_UTMP *urc;
|
|
||||||
#endif /* PUTUTLINE_RETURNS_UTMP */
|
|
||||||
|
|
||||||
uname = uw_pathname(talloc_tos(), "utmp", ut_pathname);
|
|
||||||
@@ -376,127 +376,52 @@ static void utmp_nox_update(struct utmp *u, bool claim
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
-/****************************************************************************
|
|
||||||
- Copy a string in the utmp structure.
|
|
||||||
-****************************************************************************/
|
|
||||||
|
|
||||||
-static void utmp_strcpy(char *dest, const char *src, size_t n)
|
|
||||||
-{
|
|
||||||
- size_t len = 0;
|
|
||||||
|
|
||||||
- memset(dest, '\0', n);
|
|
||||||
- if (src)
|
|
||||||
- len = strlen(src);
|
|
||||||
- if (len >= n) {
|
|
||||||
- memcpy(dest, src, n);
|
|
||||||
- } else {
|
|
||||||
- if (len)
|
|
||||||
- memcpy(dest, src, len);
|
|
||||||
- }
|
|
||||||
-}
|
|
||||||
|
|
||||||
+
|
|
||||||
/****************************************************************************
|
|
||||||
Update via utmpx/wtmpx (preferred) or via utmp/wtmp.
|
|
||||||
****************************************************************************/
|
|
||||||
|
|
||||||
-static void sys_utmp_update(struct utmp *u, const char *hostname, bool claim)
|
|
||||||
+static void sys_utmp_update(STRUCT_UTMP *u, const char *hostname, bool claim)
|
|
||||||
{
|
|
||||||
-#if !defined(HAVE_UTMPX_H)
|
|
||||||
- /* No utmpx stuff. Drop to non-x stuff */
|
|
||||||
- utmp_nox_update(u, claim);
|
|
||||||
-#elif !defined(HAVE_PUTUTXLINE)
|
|
||||||
- /* Odd. Have utmpx.h but no "pututxline()". Drop to non-x stuff */
|
|
||||||
- DEBUG(1,("utmp_update: have utmpx.h but no pututxline() function\n"));
|
|
||||||
- utmp_nox_update(u, claim);
|
|
||||||
-#elif !defined(HAVE_GETUTMPX)
|
|
||||||
- /* Odd. Have utmpx.h but no "getutmpx()". Drop to non-x stuff */
|
|
||||||
- DEBUG(1,("utmp_update: have utmpx.h but no getutmpx() function\n"));
|
|
||||||
- utmp_nox_update(u, claim);
|
|
||||||
-#elif !defined(HAVE_UPDWTMPX)
|
|
||||||
- /* Have utmpx.h but no "updwtmpx()". Drop to non-x stuff */
|
|
||||||
- DEBUG(1,("utmp_update: have utmpx.h but no updwtmpx() function\n"));
|
|
||||||
- utmp_nox_update(u, claim);
|
|
||||||
-#else
|
|
||||||
- char *uname = NULL;
|
|
||||||
- char *wname = NULL;
|
|
||||||
- struct utmpx ux, *uxrc;
|
|
||||||
+ STRUCT_UTMP *urc;
|
|
||||||
|
|
||||||
- getutmpx(u, &ux);
|
|
||||||
-
|
|
||||||
-#if defined(HAVE_UX_UT_SYSLEN)
|
|
||||||
- if (hostname)
|
|
||||||
- ux.ut_syslen = strlen(hostname) + 1; /* include end NULL */
|
|
||||||
- else
|
|
||||||
- ux.ut_syslen = 0;
|
|
||||||
-#endif
|
|
||||||
-#if defined(HAVE_UX_UT_HOST)
|
|
||||||
- utmp_strcpy(ux.ut_host, hostname, sizeof(ux.ut_host));
|
|
||||||
-#endif
|
|
||||||
-
|
|
||||||
- uname = uw_pathname(talloc_tos(), "utmpx", ux_pathname);
|
|
||||||
- wname = uw_pathname(talloc_tos(), "wtmpx", wx_pathname);
|
|
||||||
- if (uname && wname) {
|
|
||||||
- DEBUG(2,("utmp_update: uname:%s wname:%s\n", uname, wname));
|
|
||||||
+ setutxent();
|
|
||||||
+ urc = pututxline(u);
|
|
||||||
+ endutxent();
|
|
||||||
+ if (urc == NULL) {
|
|
||||||
+ DEBUG(2,("utmp_update: pututxline() failed\n"));
|
|
||||||
+ return;
|
|
||||||
}
|
|
||||||
-
|
|
||||||
- /*
|
|
||||||
- * Check for either uname or wname being empty.
|
|
||||||
- * Some systems, such as Redhat 6, have a "utmpx.h" which doesn't
|
|
||||||
- * define default filenames.
|
|
||||||
- * Also, our local installation has not provided an override.
|
|
||||||
- * Drop to non-x method. (E.g. RH6 has good defaults in "utmp.h".)
|
|
||||||
- */
|
|
||||||
- if (!uname || !wname || (strlen(uname) == 0) || (strlen(wname) == 0)) {
|
|
||||||
- utmp_nox_update(u, claim);
|
|
||||||
- } else {
|
|
||||||
- utmpxname(uname);
|
|
||||||
- setutxent();
|
|
||||||
- uxrc = pututxline(&ux);
|
|
||||||
- endutxent();
|
|
||||||
- if (uxrc == NULL) {
|
|
||||||
- DEBUG(2,("utmp_update: pututxline() failed\n"));
|
|
||||||
- return;
|
|
||||||
- }
|
|
||||||
- updwtmpx(wname, &ux);
|
|
||||||
- }
|
|
||||||
-#endif /* HAVE_UTMPX_H */
|
|
||||||
}
|
|
||||||
|
|
||||||
#if defined(HAVE_UT_UT_ID)
|
|
||||||
/****************************************************************************
|
|
||||||
Encode the unique connection number into "ut_id".
|
|
||||||
****************************************************************************/
|
|
||||||
-
|
|
||||||
-static int ut_id_encode(int i, char *fourbyte)
|
|
||||||
+static void ut_id_encode(char *buf, int id, size_t buf_size)
|
|
||||||
{
|
|
||||||
- int nbase;
|
|
||||||
- const char *ut_id_encstr = "0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ";
|
|
||||||
+ const char ut_id_encstr[] = "0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ";
|
|
||||||
|
|
||||||
-/*
|
|
||||||
- * 'ut_id_encstr' is the character set on which modulo arithmetic is done.
|
|
||||||
- * Example: digits would produce the base-10 numbers from '001'.
|
|
||||||
- */
|
|
||||||
- nbase = strlen(ut_id_encstr);
|
|
||||||
+ int nbase = sizeof(ut_id_encstr) - 1;
|
|
||||||
+ /*
|
|
||||||
+ * 'ut_id_encstr' is the character set on which modulo arithmetic is done.
|
|
||||||
+ * Example: digits would produce the base-10 numbers from '001'.
|
|
||||||
+ */
|
|
||||||
|
|
||||||
- fourbyte[0] = ut_id_encstr[i % nbase];
|
|
||||||
- i /= nbase;
|
|
||||||
- fourbyte[1] = ut_id_encstr[i % nbase];
|
|
||||||
- i /= nbase;
|
|
||||||
- fourbyte[3] = ut_id_encstr[i % nbase];
|
|
||||||
- i /= nbase;
|
|
||||||
- fourbyte[2] = ut_id_encstr[i % nbase];
|
|
||||||
- i /= nbase;
|
|
||||||
-
|
|
||||||
- /* we do not care about overflows as i is a random number */
|
|
||||||
- return 0;
|
|
||||||
+ for(int i = 0; i < buf_size; i++) {
|
|
||||||
+ buf[i] = ut_id_encstr[id % nbase];
|
|
||||||
+ id /= nbase;
|
|
||||||
+ }
|
|
||||||
}
|
|
||||||
#endif /* defined(HAVE_UT_UT_ID) */
|
|
||||||
|
|
||||||
-
|
|
||||||
/*
|
|
||||||
fill a system utmp structure given all the info we can gather
|
|
||||||
*/
|
|
||||||
-static bool sys_utmp_fill(struct utmp *u,
|
|
||||||
+static bool sys_utmp_fill(STRUCT_UTMP *u,
|
|
||||||
const char *username, const char *hostname,
|
|
||||||
const char *id_str, int id_num)
|
|
||||||
{
|
|
||||||
@@ -509,16 +434,16 @@ static bool sys_utmp_fill(struct utmp *u,
|
|
||||||
* rather than to try to detect and optimise.
|
|
||||||
*/
|
|
||||||
#if defined(HAVE_UT_UT_USER)
|
|
||||||
- utmp_strcpy(u->ut_user, username, sizeof(u->ut_user));
|
|
||||||
+ strncpy(u->ut_user, username, sizeof(u->ut_user));
|
|
||||||
#elif defined(HAVE_UT_UT_NAME)
|
|
||||||
- utmp_strcpy(u->ut_name, username, sizeof(u->ut_name));
|
|
||||||
+ strncpy(u->ut_name, username, sizeof(u->ut_name));
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/*
|
|
||||||
* ut_line:
|
|
||||||
* If size limit proves troublesome, then perhaps use "ut_id_encode()".
|
|
||||||
*/
|
|
||||||
- utmp_strcpy(u->ut_line, id_str, sizeof(u->ut_line));
|
|
||||||
+ strncpy(u->ut_line, id_str, sizeof(u->ut_line));
|
|
||||||
|
|
||||||
#if defined(HAVE_UT_UT_PID)
|
|
||||||
u->ut_pid = getpid();
|
|
||||||
@@ -535,20 +460,23 @@ static bool sys_utmp_fill(struct utmp *u,
|
|
||||||
u->ut_time = timeval.tv_sec;
|
|
||||||
#elif defined(HAVE_UT_UT_TV)
|
|
||||||
GetTimeOfDay(&timeval);
|
|
||||||
- u->ut_tv = timeval;
|
|
||||||
+ u->ut_tv.tv_sec = timeval.tv_sec;
|
|
||||||
+ u->ut_tv.tv_usec = timeval.tv_usec;
|
|
||||||
#else
|
|
||||||
#error "with-utmp must have UT_TIME or UT_TV"
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#if defined(HAVE_UT_UT_HOST)
|
|
||||||
- utmp_strcpy(u->ut_host, hostname, sizeof(u->ut_host));
|
|
||||||
+ if(hostname != NULL) {
|
|
||||||
+ strncpy(u->ut_host, hostname, sizeof(u->ut_host));
|
|
||||||
+#if defined(HAVE_UT_UT_SYSLEN)
|
|
||||||
+ u->ut_syslen = strlen(hostname) + 1; /* include trailing NULL */
|
|
||||||
#endif
|
|
||||||
+ }
|
|
||||||
+#endif
|
|
||||||
|
|
||||||
#if defined(HAVE_UT_UT_ID)
|
|
||||||
- if (ut_id_encode(id_num, u->ut_id) != 0) {
|
|
||||||
- DEBUG(1,("utmp_fill: cannot encode id %d\n", id_num));
|
|
||||||
- return False;
|
|
||||||
- }
|
|
||||||
+ ut_id_encode(u->ut_id, id_num, sizeof(u->ut_id));
|
|
||||||
#endif
|
|
||||||
|
|
||||||
return True;
|
|
||||||
@@ -561,7 +489,7 @@ void sys_utmp_yield(const char *username, const char *
|
|
||||||
void sys_utmp_yield(const char *username, const char *hostname,
|
|
||||||
const char *id_str, int id_num)
|
|
||||||
{
|
|
||||||
- struct utmp u;
|
|
||||||
+ STRUCT_UTMP u;
|
|
||||||
|
|
||||||
ZERO_STRUCT(u);
|
|
||||||
|
|
||||||
@@ -587,7 +515,7 @@ void sys_utmp_claim(const char *username, const char *
|
|
||||||
void sys_utmp_claim(const char *username, const char *hostname,
|
|
||||||
const char *id_str, int id_num)
|
|
||||||
{
|
|
||||||
- struct utmp u;
|
|
||||||
+ STRUCT_UTMP u;
|
|
||||||
|
|
||||||
ZERO_STRUCT(u);
|
|
||||||
|
|
||||||
diff -Naurp a/source3/wscript b/source3/wscript
|
|
||||||
--- a/source3/wscript 2024-08-05 12:50:16.286549000 -0400
|
|
||||||
+++ b/source3/wscript 2024-08-05 13:02:31.909769000 -0400
|
|
||||||
@@ -804,34 +804,38 @@ msg.msg_accrightslen = sizeof(fd);
|
|
||||||
|
|
||||||
if Options.options.with_utmp:
|
|
||||||
conf.env.with_utmp = True
|
|
||||||
- if not conf.CHECK_HEADERS('utmp.h'): conf.env.with_utmp = False
|
|
||||||
- conf.CHECK_FUNCS('pututline pututxline updwtmp updwtmpx getutmpx')
|
|
||||||
- conf.CHECK_STRUCTURE_MEMBER('struct utmp', 'ut_name', headers='utmp.h',
|
|
||||||
+ if not conf.CHECK_HEADERS('utmpx.h') and not conf.CHECK_HEADERS('utmp.h'):
|
|
||||||
+ conf.env.with_utmp = False
|
|
||||||
+ if conf.CONFIG_SET('HAVE_UTMPX_H'):
|
|
||||||
+ conf.DEFINE('STRUCT_UTMP', 'struct utmpx')
|
|
||||||
+ elif conf.CONFIG_SET('HAVE_UTMP_H'):
|
|
||||||
+ conf.DEFINE('STRUCT_UTMP', 'struct utmp')
|
|
||||||
+ conf.CHECK_FUNCS('pututxline getutxid getutxline updwtmpx getutmpx setutxent endutxent')
|
|
||||||
+ conf.CHECK_FUNCS('pututline getutid getutline updwtmp getutmp setutent endutent')
|
|
||||||
+ conf.CHECK_STRUCTURE_MEMBER('STRUCT_UTMP', 'ut_name', headers='utmpx.h utmp.h',
|
|
||||||
define='HAVE_UT_UT_NAME')
|
|
||||||
- conf.CHECK_STRUCTURE_MEMBER('struct utmp', 'ut_user', headers='utmp.h',
|
|
||||||
+ conf.CHECK_STRUCTURE_MEMBER('STRUCT_UTMP', 'ut_user', headers='utmpx.h utmp.h',
|
|
||||||
define='HAVE_UT_UT_USER')
|
|
||||||
- conf.CHECK_STRUCTURE_MEMBER('struct utmp', 'ut_id', headers='utmp.h',
|
|
||||||
+ conf.CHECK_STRUCTURE_MEMBER('STRUCT_UTMP', 'ut_id', headers='utmpx.h utmp.h',
|
|
||||||
define='HAVE_UT_UT_ID')
|
|
||||||
- conf.CHECK_STRUCTURE_MEMBER('struct utmp', 'ut_host', headers='utmp.h',
|
|
||||||
+ conf.CHECK_STRUCTURE_MEMBER('STRUCT_UTMP', 'ut_host', headers='utmpx.h utmp.h',
|
|
||||||
define='HAVE_UT_UT_HOST')
|
|
||||||
- conf.CHECK_STRUCTURE_MEMBER('struct utmp', 'ut_time', headers='utmp.h',
|
|
||||||
+ conf.CHECK_STRUCTURE_MEMBER('STRUCT_UTMP', 'ut_time', headers='utmpx.h utmp.h',
|
|
||||||
define='HAVE_UT_UT_TIME')
|
|
||||||
- conf.CHECK_STRUCTURE_MEMBER('struct utmp', 'ut_tv', headers='utmp.h',
|
|
||||||
+ conf.CHECK_STRUCTURE_MEMBER('STRUCT_UTMP', 'ut_tv', headers='utmpx.h utmp.h',
|
|
||||||
define='HAVE_UT_UT_TV')
|
|
||||||
- conf.CHECK_STRUCTURE_MEMBER('struct utmp', 'ut_type', headers='utmp.h',
|
|
||||||
+ conf.CHECK_STRUCTURE_MEMBER('STRUCT_UTMP', 'ut_type', headers='utmpx.h utmp.h',
|
|
||||||
define='HAVE_UT_UT_TYPE')
|
|
||||||
- conf.CHECK_STRUCTURE_MEMBER('struct utmp', 'ut_pid', headers='utmp.h',
|
|
||||||
+ conf.CHECK_STRUCTURE_MEMBER('STRUCT_UTMP', 'ut_pid', headers='utmpx.h utmp.h',
|
|
||||||
define='HAVE_UT_UT_PID')
|
|
||||||
- conf.CHECK_STRUCTURE_MEMBER('struct utmp', 'ut_exit.e_exit', headers='utmp.h',
|
|
||||||
+ conf.CHECK_STRUCTURE_MEMBER('STRUCT_UTMP', 'ut_exit.e_exit', headers='utmpx.h utmp.h',
|
|
||||||
define='HAVE_UT_UT_EXIT')
|
|
||||||
- conf.CHECK_STRUCTURE_MEMBER('struct utmpx', 'ut_syslen', headers='utmpx.h',
|
|
||||||
- define='HAVE_UX_UT_SYSLEN')
|
|
||||||
- conf.CHECK_STRUCTURE_MEMBER('struct utmpx', 'ut_host', headers='utmpx.h',
|
|
||||||
- define='HAVE_UX_UT_HOST')
|
|
||||||
+ conf.CHECK_STRUCTURE_MEMBER('STRUCT_UTMP', 'ut_syslen', headers='utmpx.h utmp.h',
|
|
||||||
+ define='HAVE_UT_UT_SYSLEN')
|
|
||||||
conf.CHECK_CODE('struct utmp utarg; struct utmp *utreturn; utreturn = pututline(&utarg);',
|
|
||||||
'PUTUTLINE_RETURNS_UTMP', headers='utmp.h',
|
|
||||||
msg="Checking whether pututline returns pointer")
|
|
||||||
- conf.CHECK_SIZEOF(['((struct utmp *)NULL)->ut_line'], headers='utmp.h',
|
|
||||||
+ conf.CHECK_SIZEOF(['((STRUCT_UTMP *)NULL)->ut_line'], headers='utmpx.h utmp.h',
|
|
||||||
define='SIZEOF_UTMP_UT_LINE', critical=False)
|
|
||||||
if not conf.CONFIG_SET('SIZEOF_UTMP_UT_LINE'):
|
|
||||||
conf.env.with_utmp = False
|
|
||||||
@ -1,121 +0,0 @@
|
|||||||
From 2e927425e04d65027db5348b3e89a69a5e447556 Mon Sep 17 00:00:00 2001
|
|
||||||
From: "Timur I. Bakeyev" <timur@FreeBSD.org>
|
|
||||||
Date: Mon, 31 May 2021 03:07:40 +0200
|
|
||||||
Subject: [PATCH 23/28] Add `cmd_get_quota()` test function into vfstest, to
|
|
||||||
test disk quota interface.
|
|
||||||
|
|
||||||
Signed-off-by: Timur I. Bakeyev <timur@FreeBSD.org>
|
|
||||||
---
|
|
||||||
source3/torture/cmd_vfs.c | 78 +++++++++++++++++++++++++++++++++++
|
|
||||||
source3/torture/wscript_build | 2 +-
|
|
||||||
2 files changed, 79 insertions(+), 1 deletion(-)
|
|
||||||
|
|
||||||
diff --git a/source3/torture/cmd_vfs.c b/source3/torture/cmd_vfs.c
|
|
||||||
index 38ce0dc4ff6..1bc4639d2a2 100644
|
|
||||||
--- a/source3/torture/cmd_vfs.c
|
|
||||||
+++ b/source3/torture/cmd_vfs.c
|
|
||||||
@@ -145,6 +145,83 @@ static NTSTATUS cmd_disk_free(struct vfs_state *vfs, TALLOC_CTX *mem_ctx, int ar
|
|
||||||
return NT_STATUS_OK;
|
|
||||||
}
|
|
||||||
|
|
||||||
+static NTSTATUS cmd_get_quota(struct vfs_state *vfs, TALLOC_CTX *mem_ctx, int argc, const char **argv)
|
|
||||||
+{
|
|
||||||
+ struct smb_filename *smb_fname = NULL;
|
|
||||||
+ uint64_t bsize, dfree, dsize;
|
|
||||||
+ enum SMB_QUOTA_TYPE qtype;
|
|
||||||
+ SMB_DISK_QUOTA D;
|
|
||||||
+ unid_t id;
|
|
||||||
+ int r;
|
|
||||||
+
|
|
||||||
+ if (argc != 4) {
|
|
||||||
+ printf("Usage: get_quota <path> [user|group] id\n");
|
|
||||||
+ return NT_STATUS_OK;
|
|
||||||
+ }
|
|
||||||
+
|
|
||||||
+ smb_fname = synthetic_smb_fname(talloc_tos(),
|
|
||||||
+ argv[1],
|
|
||||||
+ NULL,
|
|
||||||
+ NULL,
|
|
||||||
+ 0,
|
|
||||||
+ ssf_flags());
|
|
||||||
+ if (smb_fname == NULL) {
|
|
||||||
+ return NT_STATUS_NO_MEMORY;
|
|
||||||
+ }
|
|
||||||
+
|
|
||||||
+ if(strcmp(argv[2], "user") == 0) {
|
|
||||||
+ qtype = SMB_USER_FS_QUOTA_TYPE;
|
|
||||||
+ }
|
|
||||||
+ else if(strcmp(argv[2], "group") == 0) {
|
|
||||||
+ qtype = SMB_GROUP_FS_QUOTA_TYPE;
|
|
||||||
+ }
|
|
||||||
+ else {
|
|
||||||
+ printf("Usage: get_quota <path> [user|group] id\n");
|
|
||||||
+ return NT_STATUS_OK;
|
|
||||||
+ }
|
|
||||||
+
|
|
||||||
+ id.uid = atoi(argv[3]);
|
|
||||||
+
|
|
||||||
+ ZERO_STRUCT(D);
|
|
||||||
+
|
|
||||||
+ r = SMB_VFS_GET_QUOTA(vfs->conn, smb_fname, qtype, id, &D);
|
|
||||||
+
|
|
||||||
+ if (r == -1 && errno != ENOSYS) {
|
|
||||||
+ return NT_STATUS_UNSUCCESSFUL;
|
|
||||||
+ }
|
|
||||||
+
|
|
||||||
+ if (r == 0 && (D.qflags & QUOTAS_DENY_DISK) == 0) {
|
|
||||||
+ return NT_STATUS_UNSUCCESSFUL;
|
|
||||||
+ }
|
|
||||||
+
|
|
||||||
+ bsize = D.bsize;
|
|
||||||
+ /* Use softlimit to determine disk space, except when it has been exceeded */
|
|
||||||
+ if (
|
|
||||||
+ (D.softlimit && D.curblocks >= D.softlimit) ||
|
|
||||||
+ (D.hardlimit && D.curblocks >= D.hardlimit) ||
|
|
||||||
+ (D.isoftlimit && D.curinodes >= D.isoftlimit) ||
|
|
||||||
+ (D.ihardlimit && D.curinodes>=D.ihardlimit)
|
|
||||||
+ ) {
|
|
||||||
+ dfree = 0;
|
|
||||||
+ dsize = D.curblocks;
|
|
||||||
+ } else if (D.softlimit==0 && D.hardlimit==0) {
|
|
||||||
+ return NT_STATUS_UNSUCCESSFUL;
|
|
||||||
+ } else {
|
|
||||||
+ if (D.softlimit == 0) {
|
|
||||||
+ D.softlimit = D.hardlimit;
|
|
||||||
+ }
|
|
||||||
+ dfree = D.softlimit - D.curblocks;
|
|
||||||
+ dsize = D.softlimit;
|
|
||||||
+ }
|
|
||||||
+
|
|
||||||
+ printf("get_quota: bsize = %lu, dfree = %lu, dsize = %lu\n",
|
|
||||||
+ (unsigned long)bsize,
|
|
||||||
+ (unsigned long)dfree,
|
|
||||||
+ (unsigned long)dsize);
|
|
||||||
+
|
|
||||||
+ return NT_STATUS_OK;
|
|
||||||
+}
|
|
||||||
+
|
|
||||||
|
|
||||||
static NTSTATUS cmd_opendir(struct vfs_state *vfs, TALLOC_CTX *mem_ctx, int argc, const char **argv)
|
|
||||||
{
|
|
||||||
@@ -2257,6 +2334,7 @@ struct cmd_set vfs_commands[] = {
|
|
||||||
{ "connect", cmd_connect, "VFS connect()", "connect" },
|
|
||||||
{ "disconnect", cmd_disconnect, "VFS disconnect()", "disconnect" },
|
|
||||||
{ "disk_free", cmd_disk_free, "VFS disk_free()", "disk_free <path>" },
|
|
||||||
+ { "get_quota", cmd_get_quota, "VFS get_quota()", "get_quota <path> [user|group] id" },
|
|
||||||
{ "opendir", cmd_opendir, "VFS opendir()", "opendir <fname>" },
|
|
||||||
{ "readdir", cmd_readdir, "VFS readdir()", "readdir" },
|
|
||||||
{ "mkdir", cmd_mkdir, "VFS mkdir()", "mkdir <path>" },
|
|
||||||
diff --git a/source3/torture/wscript_build b/source3/torture/wscript_build
|
|
||||||
index 0c4275de795..f75c4bfe2be 100644
|
|
||||||
--- a/source3/torture/wscript_build
|
|
||||||
+++ b/source3/torture/wscript_build
|
|
||||||
@@ -124,4 +124,4 @@ bld.SAMBA3_BINARY('vfstest',
|
|
||||||
smbconf
|
|
||||||
SMBREADLINE
|
|
||||||
''',
|
|
||||||
- for_selftest=True)
|
|
||||||
+ install=True)
|
|
||||||
--
|
|
||||||
2.37.1
|
|
||||||
|
|
||||||
@ -1,367 +0,0 @@
|
|||||||
From d3024a4a2ff8015932a26a9df08e8ea5ff12a959 Mon Sep 17 00:00:00 2001
|
|
||||||
From: "Timur I. Bakeyev" <timur@FreeBSD.org>
|
|
||||||
Date: Thu, 4 Aug 2022 05:15:33 +0200
|
|
||||||
Subject: [PATCH 24/28] Cherry-pick ZFS provisioning code by iXsystems Inc.
|
|
||||||
|
|
||||||
* Check if sysvol is on filesystem with NFSv4 ACL's
|
|
||||||
(cherry picked from commit ca86f52b78a7b6e7537454a69cf93e7b96210cba)
|
|
||||||
|
|
||||||
* Only check targetdir if it is defined (I had assumed it was)
|
|
||||||
(cherry picked from commit a29050cb2978ce23e3c04a859340dc2664c77a8a)
|
|
||||||
|
|
||||||
* Kick samba a little bit into understanding NFSv4 ACL's
|
|
||||||
(cherry picked from commit 1c7542ff4904b729e311e17464ee76582760c219)
|
|
||||||
|
|
||||||
Signed-off-by: Timur I. Bakeyev <timur@FreeBSD.org>
|
|
||||||
---
|
|
||||||
python/samba/provision/__init__.py | 22 +++-
|
|
||||||
source3/lib/sysacls.c | 10 ++
|
|
||||||
source3/param/loadparm.c | 20 +++
|
|
||||||
source3/smbd/pysmbd.c | 189 ++++++++++++++++++++++++++++-
|
|
||||||
4 files changed, 235 insertions(+), 6 deletions(-)
|
|
||||||
|
|
||||||
diff --git a/python/samba/provision/__init__.py b/python/samba/provision/__init__.py
|
|
||||||
index ff9b8fac916..20e41a9ad3e 100644
|
|
||||||
--- a/python/samba/provision/__init__.py
|
|
||||||
+++ b/python/samba/provision/__init__.py
|
|
||||||
@@ -1662,19 +1662,25 @@ def setsysvolacl(samdb, netlogon, sysvol, uid, gid, domainsid, dnsdomain,
|
|
||||||
s3conf = s3param.get_context()
|
|
||||||
s3conf.load(lp.configfile)
|
|
||||||
|
|
||||||
- file = tempfile.NamedTemporaryFile(dir=os.path.abspath(sysvol))
|
|
||||||
+ sysvol_dir = os.path.abspath(sysvol)
|
|
||||||
+
|
|
||||||
+ set_simple_acl = smbd.set_simple_acl
|
|
||||||
+ if smbd.has_nfsv4_acls(sysvol_dir):
|
|
||||||
+ set_simple_acl = smbd.set_simple_nfsv4_acl
|
|
||||||
+
|
|
||||||
+ file = tempfile.NamedTemporaryFile(dir=sysvol_dir)
|
|
||||||
try:
|
|
||||||
try:
|
|
||||||
- smbd.set_simple_acl(file.name, 0o755, system_session_unix(), gid)
|
|
||||||
+ set_simple_acl(file.name, 0o755, system_session_unix(), gid)
|
|
||||||
except OSError:
|
|
||||||
- if not smbd.have_posix_acls():
|
|
||||||
+ if not smbd.have_posix_acls() and not smbd.have_nfsv4_acls():
|
|
||||||
# This clue is only strictly correct for RPM and
|
|
||||||
# Debian-like Linux systems, but hopefully other users
|
|
||||||
# will get enough clue from it.
|
|
||||||
- raise ProvisioningError("Samba was compiled without the posix ACL support that s3fs requires. "
|
|
||||||
+ raise ProvisioningError("Samba was compiled without the ACL support that s3fs requires. "
|
|
||||||
"Try installing libacl1-dev or libacl-devel, then re-run configure and make.")
|
|
||||||
|
|
||||||
- raise ProvisioningError("Your filesystem or build does not support posix ACLs, which s3fs requires. "
|
|
||||||
+ raise ProvisioningError("Your filesystem or build does not support ACLs, which s3fs requires. "
|
|
||||||
"Try the mounting the filesystem with the 'acl' option.")
|
|
||||||
try:
|
|
||||||
smbd.chown(file.name, uid, gid, system_session_unix())
|
|
||||||
@@ -1959,6 +1965,9 @@ def provision_fill(samdb, secrets_ldb, logger, names, paths,
|
|
||||||
samdb.transaction_commit()
|
|
||||||
|
|
||||||
if serverrole == "active directory domain controller":
|
|
||||||
+ if targetdir and smbd.have_nfsv4_acls() and smbd.has_nfsv4_acls(targetdir):
|
|
||||||
+ smbd.set_nfsv4_defaults()
|
|
||||||
+
|
|
||||||
# Continue setting up sysvol for GPO. This appears to require being
|
|
||||||
# outside a transaction.
|
|
||||||
if not skip_sysvolacl:
|
|
||||||
@@ -2313,6 +2322,9 @@ def provision(logger, session_info, smbconf=None,
|
|
||||||
if not os.path.isdir(paths.netlogon):
|
|
||||||
os.makedirs(paths.netlogon, 0o755)
|
|
||||||
|
|
||||||
+ if smbd.have_nfsv4_acls() and smbd.has_nfsv4_acls(paths.sysvol):
|
|
||||||
+ smbd.set_nfsv4_defaults()
|
|
||||||
+
|
|
||||||
if adminpass is None:
|
|
||||||
adminpass = samba.generate_random_password(12, 32)
|
|
||||||
adminpass_generated = True
|
|
||||||
diff --git a/source3/lib/sysacls.c b/source3/lib/sysacls.c
|
|
||||||
index 891fabea21e..d1357a47bd0 100644
|
|
||||||
--- a/source3/lib/sysacls.c
|
|
||||||
+++ b/source3/lib/sysacls.c
|
|
||||||
@@ -38,6 +38,16 @@
|
|
||||||
#include "modules/vfs_aixacl.h"
|
|
||||||
#endif
|
|
||||||
|
|
||||||
+/*
|
|
||||||
+ * NFSv4 ACL's should be understood and a first class citizen. Work
|
|
||||||
+ * needs to be done in librpc/idl/smb_acl.idl for this to occur.
|
|
||||||
+ */
|
|
||||||
+#if defined(HAVE_LIBSUNACL) && defined(FREEBSD)
|
|
||||||
+#if 0
|
|
||||||
+#include "modules/nfs4_acls.h"
|
|
||||||
+#endif
|
|
||||||
+#endif
|
|
||||||
+
|
|
||||||
#undef DBGC_CLASS
|
|
||||||
#define DBGC_CLASS DBGC_ACLS
|
|
||||||
|
|
||||||
diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c
|
|
||||||
index 21e061939e3..4e23fdaaf6d 100644
|
|
||||||
--- a/source3/param/loadparm.c
|
|
||||||
+++ b/source3/param/loadparm.c
|
|
||||||
@@ -2830,9 +2830,29 @@ static void init_locals(void)
|
|
||||||
} else {
|
|
||||||
if (lp_parm_const_string(-1, "xattr_tdb", "file", NULL)) {
|
|
||||||
lp_do_parameter(-1, "vfs objects", "dfs_samba4 acl_xattr xattr_tdb");
|
|
||||||
+ /*
|
|
||||||
+ * By default, the samba sysvol is located in the statedir. Provisioning will fail in setntacl
|
|
||||||
+ * unless we have zfacl enabled. Unfortunately, at this point the smb.conf has not been generated.
|
|
||||||
+ * This workaround is freebsd-specific.
|
|
||||||
+ */
|
|
||||||
+#if defined(_PC_ACL_EXTENDED)
|
|
||||||
+ } else if (pathconf(lp_state_directory(), _PC_ACL_EXTENDED) == 1) {
|
|
||||||
+ lp_do_parameter(-1, "vfs objects", "dfs_samba4 freebsd");
|
|
||||||
+#endif
|
|
||||||
+#if defined(_PC_ACL_NFS4)
|
|
||||||
+ } else if (pathconf(lp_state_directory(), _PC_ACL_NFS4) == 1) {
|
|
||||||
+ lp_do_parameter(-1, "vfs objects", "dfs_samba4 zfsacl");
|
|
||||||
+#endif
|
|
||||||
} else if (lp_parm_const_string(-1, "posix", "eadb", NULL)) {
|
|
||||||
lp_do_parameter(-1, "vfs objects", "dfs_samba4 acl_xattr posix_eadb");
|
|
||||||
} else {
|
|
||||||
+ /*
|
|
||||||
+ * This should only set dfs_samba4 and leave acl_xattr
|
|
||||||
+ * to be set later (or zfsacl). The only reason the decision
|
|
||||||
+ * can't be made here to load acl_xattr or zfsacl is
|
|
||||||
+ * that we don't have access to what the target
|
|
||||||
+ * directory is.
|
|
||||||
+ */
|
|
||||||
lp_do_parameter(-1, "vfs objects", "dfs_samba4 acl_xattr");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
diff --git a/source3/smbd/pysmbd.c b/source3/smbd/pysmbd.c
|
|
||||||
index 88cbf62a680..867010ea6cd 100644
|
|
||||||
--- a/source3/smbd/pysmbd.c
|
|
||||||
+++ b/source3/smbd/pysmbd.c
|
|
||||||
@@ -485,6 +485,20 @@ static SMB_ACL_T make_simple_acl(TALLOC_CTX *mem_ctx,
|
|
||||||
return acl;
|
|
||||||
}
|
|
||||||
|
|
||||||
+static SMB_ACL_T make_simple_nfsv4_acl(TALLOC_CTX *mem_ctx,
|
|
||||||
+ gid_t gid,
|
|
||||||
+ mode_t chmod_mode)
|
|
||||||
+{
|
|
||||||
+ /*
|
|
||||||
+ * This function needs to create an NFSv4 ACL. Currently, the only way
|
|
||||||
+ * to do so is to use the operating system interface, or to use the
|
|
||||||
+ * functions in source3/modules/nfs4_acls.c. These seems ugly and
|
|
||||||
+ * hacky. NFSv4 ACL's should be a first class citizen and
|
|
||||||
+ * librpc/idl/smb_acl.idl should be modified accordingly.
|
|
||||||
+ */
|
|
||||||
+ return NULL;
|
|
||||||
+}
|
|
||||||
+
|
|
||||||
/*
|
|
||||||
set a simple ACL on a file, as a test
|
|
||||||
*/
|
|
||||||
@@ -557,6 +571,84 @@ static PyObject *py_smbd_set_simple_acl(PyObject *self, PyObject *args, PyObject
|
|
||||||
Py_RETURN_NONE;
|
|
||||||
}
|
|
||||||
|
|
||||||
+
|
|
||||||
+/*
|
|
||||||
+ set a simple NFSv4 ACL on a file, as a test
|
|
||||||
+ */
|
|
||||||
+static PyObject *py_smbd_set_simple_nfsv4_acl(PyObject *self, PyObject *args, PyObject *kwargs)
|
|
||||||
+{
|
|
||||||
+ const char * const kwnames[] = {
|
|
||||||
+ "fname",
|
|
||||||
+ "mode",
|
|
||||||
+ "session_info",
|
|
||||||
+ "gid",
|
|
||||||
+ "service",
|
|
||||||
+ NULL
|
|
||||||
+ };
|
|
||||||
+ char *fname, *service = NULL;
|
|
||||||
+ PyObject *py_session = Py_None;
|
|
||||||
+ struct auth_session_info *session_info = NULL;
|
|
||||||
+ int ret;
|
|
||||||
+ int mode, gid = -1;
|
|
||||||
+ SMB_ACL_T acl;
|
|
||||||
+ TALLOC_CTX *frame;
|
|
||||||
+ connection_struct *conn;
|
|
||||||
+
|
|
||||||
+ if (!PyArg_ParseTupleAndKeywords(args, kwargs, "siO|iz",
|
|
||||||
+ discard_const_p(char *, kwnames),
|
|
||||||
+ &fname,
|
|
||||||
+ &mode,
|
|
||||||
+ &py_session,
|
|
||||||
+ &gid,
|
|
||||||
+ &service))
|
|
||||||
+ return NULL;
|
|
||||||
+
|
|
||||||
+ if (!py_check_dcerpc_type(py_session,
|
|
||||||
+ "samba.dcerpc.auth",
|
|
||||||
+ "session_info")) {
|
|
||||||
+ return NULL;
|
|
||||||
+ }
|
|
||||||
+ session_info = pytalloc_get_type(py_session,
|
|
||||||
+ struct auth_session_info);
|
|
||||||
+ if (session_info == NULL) {
|
|
||||||
+ PyErr_Format(PyExc_TypeError,
|
|
||||||
+ "Expected auth_session_info for session_info argument got %s",
|
|
||||||
+ pytalloc_get_name(py_session));
|
|
||||||
+ return NULL;
|
|
||||||
+ }
|
|
||||||
+
|
|
||||||
+ frame = talloc_stackframe();
|
|
||||||
+
|
|
||||||
+ acl = make_simple_nfsv4_acl(frame, gid, mode);
|
|
||||||
+ if (acl == NULL) {
|
|
||||||
+ TALLOC_FREE(frame);
|
|
||||||
+ Py_RETURN_NONE;
|
|
||||||
+ }
|
|
||||||
+
|
|
||||||
+ conn = get_conn_tos(service, session_info);
|
|
||||||
+ if (!conn) {
|
|
||||||
+ TALLOC_FREE(frame);
|
|
||||||
+ Py_RETURN_NONE;
|
|
||||||
+ }
|
|
||||||
+
|
|
||||||
+ /*
|
|
||||||
+ * SMB_ACL_TYPE_ACCESS -> ACL_TYPE_ACCESS -> Not valid for NFSv4 ACL
|
|
||||||
+ */
|
|
||||||
+ ret = 0;
|
|
||||||
+
|
|
||||||
+ /* ret = set_sys_acl_conn(fname, SMB_ACL_TYPE_ACCESS, acl, conn); */
|
|
||||||
+
|
|
||||||
+ if (ret != 0) {
|
|
||||||
+ TALLOC_FREE(frame);
|
|
||||||
+ errno = ret;
|
|
||||||
+ return PyErr_SetFromErrno(PyExc_OSError);
|
|
||||||
+ }
|
|
||||||
+
|
|
||||||
+ TALLOC_FREE(frame);
|
|
||||||
+
|
|
||||||
+ Py_RETURN_NONE;
|
|
||||||
+}
|
|
||||||
+
|
|
||||||
/*
|
|
||||||
chown a file
|
|
||||||
*/
|
|
||||||
@@ -744,7 +836,7 @@ static PyObject *py_smbd_unlink(PyObject *self, PyObject *args, PyObject *kwargs
|
|
||||||
}
|
|
||||||
|
|
||||||
/*
|
|
||||||
- check if we have ACL support
|
|
||||||
+ check if we have POSIX.1e ACL support
|
|
||||||
*/
|
|
||||||
static PyObject *py_smbd_have_posix_acls(PyObject *self,
|
|
||||||
PyObject *Py_UNUSED(ignored))
|
|
||||||
@@ -756,6 +848,83 @@ static PyObject *py_smbd_have_posix_acls(PyObject *self,
|
|
||||||
#endif
|
|
||||||
}
|
|
||||||
|
|
||||||
+static PyObject *py_smbd_has_posix_acls(PyObject *self, PyObject *args, PyObject *kwargs)
|
|
||||||
+{
|
|
||||||
+ const char * const kwnames[] = { "path", NULL };
|
|
||||||
+ char *path = NULL;
|
|
||||||
+ TALLOC_CTX *frame;
|
|
||||||
+ struct statfs fs;
|
|
||||||
+ int ret = false;
|
|
||||||
+
|
|
||||||
+ frame = talloc_stackframe();
|
|
||||||
+
|
|
||||||
+ if (!PyArg_ParseTupleAndKeywords(args, kwargs, "s|z",
|
|
||||||
+ discard_const_p(char *, kwnames), &path)) {
|
|
||||||
+ TALLOC_FREE(frame);
|
|
||||||
+ return NULL;
|
|
||||||
+ }
|
|
||||||
+
|
|
||||||
+ if (statfs(path, &fs) != 0) {
|
|
||||||
+ TALLOC_FREE(frame);
|
|
||||||
+ return NULL;
|
|
||||||
+ }
|
|
||||||
+
|
|
||||||
+ if (fs.f_flags & MNT_ACLS)
|
|
||||||
+ ret = true;
|
|
||||||
+
|
|
||||||
+ TALLOC_FREE(frame);
|
|
||||||
+ return PyBool_FromLong(ret);
|
|
||||||
+}
|
|
||||||
+
|
|
||||||
+/*
|
|
||||||
+ check if we have NFSv4 ACL support
|
|
||||||
+ */
|
|
||||||
+static PyObject *py_smbd_have_nfsv4_acls(PyObject *self)
|
|
||||||
+{
|
|
||||||
+#ifdef HAVE_LIBSUNACL
|
|
||||||
+ return PyBool_FromLong(true);
|
|
||||||
+#else
|
|
||||||
+ return PyBool_FromLong(false);
|
|
||||||
+#endif
|
|
||||||
+}
|
|
||||||
+
|
|
||||||
+static PyObject *py_smbd_has_nfsv4_acls(PyObject *self, PyObject *args, PyObject *kwargs)
|
|
||||||
+{
|
|
||||||
+ const char * const kwnames[] = { "path", NULL };
|
|
||||||
+ char *path = NULL;
|
|
||||||
+ TALLOC_CTX *frame;
|
|
||||||
+ struct statfs fs;
|
|
||||||
+ int ret = false;
|
|
||||||
+
|
|
||||||
+ frame = talloc_stackframe();
|
|
||||||
+
|
|
||||||
+ if (!PyArg_ParseTupleAndKeywords(args, kwargs, "s|z",
|
|
||||||
+ discard_const_p(char *, kwnames), &path)) {
|
|
||||||
+ TALLOC_FREE(frame);
|
|
||||||
+ return NULL;
|
|
||||||
+ }
|
|
||||||
+
|
|
||||||
+ if (statfs(path, &fs) != 0) {
|
|
||||||
+ TALLOC_FREE(frame);
|
|
||||||
+ return NULL;
|
|
||||||
+ }
|
|
||||||
+
|
|
||||||
+ if (fs.f_flags & MNT_NFS4ACLS)
|
|
||||||
+ ret = true;
|
|
||||||
+
|
|
||||||
+ TALLOC_FREE(frame);
|
|
||||||
+ return PyBool_FromLong(ret);
|
|
||||||
+}
|
|
||||||
+
|
|
||||||
+
|
|
||||||
+static PyObject *py_smbd_set_nfsv4_defaults(PyObject *self)
|
|
||||||
+{
|
|
||||||
+ /*
|
|
||||||
+ * It is really be done in source3/param/loadparm.c
|
|
||||||
+ */
|
|
||||||
+ Py_RETURN_NONE;
|
|
||||||
+}
|
|
||||||
+
|
|
||||||
/*
|
|
||||||
set the NT ACL on a file
|
|
||||||
*/
|
|
||||||
@@ -1242,10 +1411,28 @@ static PyMethodDef py_smbd_methods[] = {
|
|
||||||
{ "have_posix_acls",
|
|
||||||
(PyCFunction)py_smbd_have_posix_acls, METH_NOARGS,
|
|
||||||
NULL },
|
|
||||||
+ { "has_posix_acls",
|
|
||||||
+ PY_DISCARD_FUNC_SIG(PyCFunction, py_smbd_has_posix_acls),
|
|
||||||
+ METH_VARARGS|METH_KEYWORDS,
|
|
||||||
+ NULL },
|
|
||||||
+ { "have_nfsv4_acls",
|
|
||||||
+ (PyCFunction)py_smbd_have_nfsv4_acls, METH_NOARGS,
|
|
||||||
+ NULL },
|
|
||||||
+ { "has_nfsv4_acls",
|
|
||||||
+ PY_DISCARD_FUNC_SIG(PyCFunction, py_smbd_has_nfsv4_acls),
|
|
||||||
+ METH_VARARGS|METH_KEYWORDS,
|
|
||||||
+ NULL },
|
|
||||||
+ { "set_nfsv4_defaults",
|
|
||||||
+ (PyCFunction)py_smbd_set_nfsv4_defaults, METH_NOARGS,
|
|
||||||
+ NULL },
|
|
||||||
{ "set_simple_acl",
|
|
||||||
PY_DISCARD_FUNC_SIG(PyCFunction, py_smbd_set_simple_acl),
|
|
||||||
METH_VARARGS|METH_KEYWORDS,
|
|
||||||
NULL },
|
|
||||||
+ { "set_simple_nfsv4_acl",
|
|
||||||
+ PY_DISCARD_FUNC_SIG(PyCFunction, py_smbd_set_simple_nfsv4_acl),
|
|
||||||
+ METH_VARARGS|METH_KEYWORDS,
|
|
||||||
+ NULL },
|
|
||||||
{ "set_nt_acl",
|
|
||||||
PY_DISCARD_FUNC_SIG(PyCFunction, py_smbd_set_nt_acl),
|
|
||||||
METH_VARARGS|METH_KEYWORDS,
|
|
||||||
--
|
|
||||||
2.37.1
|
|
||||||
|
|
||||||
@ -1,94 +0,0 @@
|
|||||||
From 6e79023af14210a6435ab18ada8097253b8b16b6 Mon Sep 17 00:00:00 2001
|
|
||||||
From: "Timur I. Bakeyev" <timur@FreeBSD.org>
|
|
||||||
Date: Mon, 31 May 2021 01:38:49 +0200
|
|
||||||
Subject: [PATCH 25/28] From d9b748869a8f4018ebee302aae8246bf29f60309 Mon Sep
|
|
||||||
17 00:00:00 2001 From: "Timur I. Bakeyev" <timur@iXsystems.com> Date: Fri, 1
|
|
||||||
Jun 2018 01:35:08 +0800 Subject: [PATCH] vfs_fruit: allow broken
|
|
||||||
AFP_Signature where the first byte is 0
|
|
||||||
|
|
||||||
FreeBSD bug ... caused the first byte of the AFP_AfpInfo xattr to be 0
|
|
||||||
instead of 'A'. This hack allows such broken AFP_AfpInfo blobs to be
|
|
||||||
parsed by afpinfo_unpack().
|
|
||||||
|
|
||||||
FreeBSD Bug: https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=228462
|
|
||||||
|
|
||||||
Signed-off-by: Ralph Boehme <slow@samba.org>
|
|
||||||
Signed-off-by: Timur I. Bakeyev <timur@FreeBSD.org>
|
|
||||||
---
|
|
||||||
source3/lib/adouble.c | 19 +++++++++++++++----
|
|
||||||
source3/modules/vfs_fruit.c | 19 ++++++++++++++++++-
|
|
||||||
2 files changed, 33 insertions(+), 5 deletions(-)
|
|
||||||
|
|
||||||
diff -Naurp a/source3/lib/adouble.c b/source3/lib/adouble.c
|
|
||||||
--- a/source3/lib/adouble.c 2024-02-02 04:33:51.172489400 -0500
|
|
||||||
+++ b/source3/lib/adouble.c 2024-08-05 13:53:43.952688000 -0400
|
|
||||||
@@ -2821,6 +2821,8 @@ ssize_t afpinfo_pack(const AfpInfo *ai, char *buf)
|
|
||||||
return AFP_INFO_SIZE;
|
|
||||||
}
|
|
||||||
|
|
||||||
+#define BROKEN_FREEBSD_AFP_Signature 0x00465000
|
|
||||||
+
|
|
||||||
/**
|
|
||||||
* Unpack a buffer into a AfpInfo structure
|
|
||||||
*
|
|
||||||
@@ -2841,11 +2843,20 @@ AfpInfo *afpinfo_unpack(TALLOC_CTX *ctx, const void *d
|
|
||||||
sizeof(ai->afpi_FinderInfo));
|
|
||||||
|
|
||||||
if (validate) {
|
|
||||||
- if (ai->afpi_Signature != AFP_Signature
|
|
||||||
- || ai->afpi_Version != AFP_Version)
|
|
||||||
- {
|
|
||||||
- DEBUG(1, ("Bad AfpInfo signature or version\n"));
|
|
||||||
+ if (ai->afpi_Signature != AFP_Signature) {
|
|
||||||
+ DBG_WARNING("Bad AFP signature [%x]\n", ai->afpi_Signature);
|
|
||||||
+
|
|
||||||
+ if (ai->afpi_Signature != BROKEN_FREEBSD_AFP_Signature) {
|
|
||||||
+ DBG_ERR("Bad AfpInfo signature\n");
|
|
||||||
+ TALLOC_FREE(ai);
|
|
||||||
+ return NULL;
|
|
||||||
+ }
|
|
||||||
+ }
|
|
||||||
+
|
|
||||||
+ if (ai->afpi_Version != AFP_Version) {
|
|
||||||
+ DBG_ERR("Bad AfpInfo version\n");
|
|
||||||
TALLOC_FREE(ai);
|
|
||||||
+ return NULL;
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
ai->afpi_Signature = AFP_Signature;
|
|
||||||
diff -Naurp a/source3/modules/vfs_fruit.c b/source3/modules/vfs_fruit.c
|
|
||||||
--- a/source3/modules/vfs_fruit.c 2024-02-02 04:33:51.228489600 -0500
|
|
||||||
+++ b/source3/modules/vfs_fruit.c 2024-08-05 13:12:29.220129000 -0400
|
|
||||||
@@ -2305,6 +2305,7 @@ static ssize_t fruit_pread_meta_stream(vfs_handle_stru
|
|
||||||
size_t n, off_t offset)
|
|
||||||
{
|
|
||||||
struct fio *fio = fruit_get_complete_fio(handle, fsp);
|
|
||||||
+ char *p = (char *)data;
|
|
||||||
ssize_t nread;
|
|
||||||
int ret;
|
|
||||||
|
|
||||||
@@ -2313,7 +2314,23 @@ static ssize_t fruit_pread_meta_stream(vfs_handle_stru
|
|
||||||
}
|
|
||||||
|
|
||||||
nread = SMB_VFS_NEXT_PREAD(handle, fsp, data, n, offset);
|
|
||||||
- if (nread == -1 || nread == n) {
|
|
||||||
+ if (nread <= 0) {
|
|
||||||
+ /*
|
|
||||||
+ * fruit_meta_open_stream() removes O_CREAT flag
|
|
||||||
+ * from xattr open. This results in vfs_streams_xattr
|
|
||||||
+ * not generating an FSP extension for the files_struct
|
|
||||||
+ * and causes subsequent pread() of stream to return
|
|
||||||
+ * nread=0 if pread() occurs before pwrite().
|
|
||||||
+ */
|
|
||||||
+ return nread;
|
|
||||||
+ }
|
|
||||||
+
|
|
||||||
+ if (nread == n) {
|
|
||||||
+ if (offset == 0 && nread > 3 && p[0] == 0 && p[1] == 'F' && p[2] == 'P') {
|
|
||||||
+ DBG_NOTICE("Fixing AFP_Info of [%s]\n",
|
|
||||||
+ fsp_str_dbg(fsp));
|
|
||||||
+ p[0] = 'A';
|
|
||||||
+ }
|
|
||||||
return nread;
|
|
||||||
}
|
|
||||||
|
|
||||||
@ -1,335 +0,0 @@
|
|||||||
From 2d73ccb27ffcdf419d569260fcca6e9ee3b9538a Mon Sep 17 00:00:00 2001
|
|
||||||
From: "Timur I. Bakeyev" <timur@FreeBSD.org>
|
|
||||||
Date: Thu, 29 Sep 2022 03:24:26 +0200
|
|
||||||
Subject: [PATCH 26/28] vfs: add a compatibility option to the
|
|
||||||
vfs_streams_xattr
|
|
||||||
|
|
||||||
When enabled, the module does not append a trailing 0
|
|
||||||
byte to the end of the extended attribute data.
|
|
||||||
|
|
||||||
This is primarily a consideration when the administrator
|
|
||||||
wishes to expose extended attributes that have been written
|
|
||||||
by another application as alternate data streams via
|
|
||||||
Samba.
|
|
||||||
|
|
||||||
An example where this parameter may be required is when
|
|
||||||
migrating a netatalk share to Samba. See manpage for
|
|
||||||
vfs_fruit for additional considerations regarding
|
|
||||||
Netatalk and Samba compatibility.
|
|
||||||
|
|
||||||
Signed-off-by: Timur I. Bakeyev <timur@FreeBSD.org>
|
|
||||||
---
|
|
||||||
docs-xml/manpages/vfs_streams_xattr.8.xml | 25 ++++++
|
|
||||||
source3/modules/vfs_streams_xattr.c | 95 +++++++++++++++++------
|
|
||||||
2 files changed, 97 insertions(+), 23 deletions(-)
|
|
||||||
|
|
||||||
diff --git a/docs-xml/manpages/vfs_streams_xattr.8.xml b/docs-xml/manpages/vfs_streams_xattr.8.xml
|
|
||||||
index 6645928c016..0f38d510a82 100644
|
|
||||||
--- a/docs-xml/manpages/vfs_streams_xattr.8.xml
|
|
||||||
+++ b/docs-xml/manpages/vfs_streams_xattr.8.xml
|
|
||||||
@@ -71,6 +71,31 @@
|
|
||||||
</listitem>
|
|
||||||
</varlistentry>
|
|
||||||
|
|
||||||
+ <varlistentry>
|
|
||||||
+ <term>streams_xattr:xattr_compat = [yes|no]</term>
|
|
||||||
+ <listitem>
|
|
||||||
+ <para>When enabled, the module does not append a trailing 0
|
|
||||||
+ byte to the end of the extended attribute data. This parameter
|
|
||||||
+ must not be changed once data has been written to the share
|
|
||||||
+ since it may result in dropping the last byte from xattr data.
|
|
||||||
+
|
|
||||||
+ This is primarily a consideration when the administrator
|
|
||||||
+ wishes to expose extended attributes that have been written
|
|
||||||
+ by another application as alternate data streams via
|
|
||||||
+ Samba.
|
|
||||||
+
|
|
||||||
+ An example where this parameter may be required is when
|
|
||||||
+ migrating a netatalk share to Samba. See manpage for
|
|
||||||
+ vfs_fruit for additional considerations regarding
|
|
||||||
+ Netatalk and Samba compatibility.
|
|
||||||
+
|
|
||||||
+ WARNING: this parameter must not be changed on existing
|
|
||||||
+ Samba shares or new shares that export paths currently
|
|
||||||
+ or previously have been shared by Samba.
|
|
||||||
+ The default is <command>yes</command>.</para>
|
|
||||||
+ </listitem>
|
|
||||||
+ </varlistentry>
|
|
||||||
+
|
|
||||||
</variablelist>
|
|
||||||
|
|
||||||
</refsect1>
|
|
||||||
diff --git a/source3/modules/vfs_streams_xattr.c b/source3/modules/vfs_streams_xattr.c
|
|
||||||
index b69a4f342f5..070111e3ee9 100644
|
|
||||||
--- a/source3/modules/vfs_streams_xattr.c
|
|
||||||
+++ b/source3/modules/vfs_streams_xattr.c
|
|
||||||
@@ -35,6 +35,7 @@ struct streams_xattr_config {
|
|
||||||
const char *prefix;
|
|
||||||
size_t prefix_len;
|
|
||||||
bool store_stream_type;
|
|
||||||
+ int xattr_compat_bytes;
|
|
||||||
};
|
|
||||||
|
|
||||||
struct stream_io {
|
|
||||||
@@ -45,22 +46,28 @@ struct stream_io {
|
|
||||||
vfs_handle_struct *handle;
|
|
||||||
};
|
|
||||||
|
|
||||||
-static ssize_t get_xattr_size_fsp(struct files_struct *fsp,
|
|
||||||
+static ssize_t get_xattr_size_fsp(vfs_handle_struct *handle,
|
|
||||||
+ struct files_struct *fsp,
|
|
||||||
const char *xattr_name)
|
|
||||||
{
|
|
||||||
NTSTATUS status;
|
|
||||||
struct ea_struct ea;
|
|
||||||
ssize_t result;
|
|
||||||
+ struct streams_xattr_config *config = NULL;
|
|
||||||
|
|
||||||
+ SMB_VFS_HANDLE_GET_DATA(handle, config, struct streams_xattr_config,
|
|
||||||
+ return -1);
|
|
||||||
+
|
|
||||||
status = get_ea_value_fsp(talloc_tos(),
|
|
||||||
fsp,
|
|
||||||
xattr_name,
|
|
||||||
&ea);
|
|
||||||
+
|
|
||||||
if (!NT_STATUS_IS_OK(status)) {
|
|
||||||
return -1;
|
|
||||||
}
|
|
||||||
|
|
||||||
- result = ea.value.length-1;
|
|
||||||
+ result = ea.value.length - config->xattr_compat_bytes;
|
|
||||||
TALLOC_FREE(ea.value.data);
|
|
||||||
return result;
|
|
||||||
}
|
|
||||||
@@ -197,7 +204,8 @@ static int streams_xattr_fstat(vfs_handle_struct *hand
|
|
||||||
return -1;
|
|
||||||
}
|
|
||||||
|
|
||||||
- sbuf->st_ex_size = get_xattr_size_fsp(fsp->base_fsp,
|
|
||||||
+ sbuf->st_ex_size = get_xattr_size_fsp(handle,
|
|
||||||
+ fsp->base_fsp,
|
|
||||||
io->xattr_name);
|
|
||||||
if (sbuf->st_ex_size == -1) {
|
|
||||||
SET_STAT_INVALID(*sbuf);
|
|
||||||
@@ -273,7 +281,7 @@ static int streams_xattr_stat(vfs_handle_struct *handl
|
|
||||||
fsp = fsp->base_fsp;
|
|
||||||
}
|
|
||||||
|
|
||||||
- smb_fname->st.st_ex_size = get_xattr_size_fsp(fsp,
|
|
||||||
+ smb_fname->st.st_ex_size = get_xattr_size_fsp(handle, fsp,
|
|
||||||
xattr_name);
|
|
||||||
if (smb_fname->st.st_ex_size == -1) {
|
|
||||||
TALLOC_FREE(xattr_name);
|
|
||||||
@@ -308,6 +316,7 @@ static int streams_xattr_lstat(vfs_handle_struct *hand
|
|
||||||
errno = ENOENT;
|
|
||||||
return -1;
|
|
||||||
}
|
|
||||||
+
|
|
||||||
return SMB_VFS_NEXT_LSTAT(handle, smb_fname);
|
|
||||||
}
|
|
||||||
|
|
||||||
@@ -341,6 +350,12 @@ static int streams_xattr_openat(struct vfs_handle_stru
|
|
||||||
how);
|
|
||||||
}
|
|
||||||
|
|
||||||
+#ifdef O_EMPTY_PATH
|
|
||||||
+ if (how->flags & O_EMPTY_PATH) {
|
|
||||||
+ return vfs_fake_fd();
|
|
||||||
+ }
|
|
||||||
+#endif
|
|
||||||
+
|
|
||||||
if (how->resolve != 0) {
|
|
||||||
errno = ENOSYS;
|
|
||||||
return -1;
|
|
||||||
@@ -356,6 +371,8 @@ static int streams_xattr_openat(struct vfs_handle_stru
|
|
||||||
goto fail;
|
|
||||||
}
|
|
||||||
|
|
||||||
+ fsp->fsp_flags.have_proc_fds = fsp->conn->have_proc_fds;
|
|
||||||
+
|
|
||||||
status = get_ea_value_fsp(talloc_tos(),
|
|
||||||
fsp->base_fsp,
|
|
||||||
xattr_name,
|
|
||||||
@@ -394,7 +411,8 @@ static int streams_xattr_openat(struct vfs_handle_stru
|
|
||||||
*/
|
|
||||||
|
|
||||||
/*
|
|
||||||
- * Darn, xattrs need at least 1 byte
|
|
||||||
+ * If xattr_compat_bytes is set we need to
|
|
||||||
+ * provide one extra trailing byte
|
|
||||||
*/
|
|
||||||
char null = '\0';
|
|
||||||
|
|
||||||
@@ -403,7 +421,8 @@ static int streams_xattr_openat(struct vfs_handle_stru
|
|
||||||
|
|
||||||
ret = SMB_VFS_FSETXATTR(fsp->base_fsp,
|
|
||||||
xattr_name,
|
|
||||||
- &null, sizeof(null),
|
|
||||||
+ (config->xattr_compat_bytes) ? &null : NULL,
|
|
||||||
+ (config->xattr_compat_bytes) ? sizeof(null) : 0,
|
|
||||||
how->flags & O_EXCL ? XATTR_CREATE : 0);
|
|
||||||
if (ret != 0) {
|
|
||||||
goto fail;
|
|
||||||
@@ -412,13 +431,13 @@ static int streams_xattr_openat(struct vfs_handle_stru
|
|
||||||
|
|
||||||
fakefd = vfs_fake_fd();
|
|
||||||
|
|
||||||
- sio = VFS_ADD_FSP_EXTENSION(handle, fsp, struct stream_io, NULL);
|
|
||||||
- if (sio == NULL) {
|
|
||||||
- errno = ENOMEM;
|
|
||||||
- goto fail;
|
|
||||||
- }
|
|
||||||
+ sio = VFS_ADD_FSP_EXTENSION(handle, fsp, struct stream_io, NULL);
|
|
||||||
+ if (sio == NULL) {
|
|
||||||
+ errno = ENOMEM;
|
|
||||||
+ goto fail;
|
|
||||||
+ }
|
|
||||||
|
|
||||||
- sio->xattr_name = talloc_strdup(VFS_MEMCTX_FSP_EXTENSION(handle, fsp),
|
|
||||||
+ sio->xattr_name = talloc_strdup(VFS_MEMCTX_FSP_EXTENSION(handle, fsp),
|
|
||||||
xattr_name);
|
|
||||||
if (sio->xattr_name == NULL) {
|
|
||||||
errno = ENOMEM;
|
|
||||||
@@ -808,12 +827,16 @@ static bool collect_one_stream(struct ea_struct *ea, v
|
|
||||||
{
|
|
||||||
struct streaminfo_state *state =
|
|
||||||
(struct streaminfo_state *)private_data;
|
|
||||||
+ struct streams_xattr_config *config = NULL;
|
|
||||||
|
|
||||||
+ SMB_VFS_HANDLE_GET_DATA(state->handle, config, struct streams_xattr_config,
|
|
||||||
+ return false);
|
|
||||||
+
|
|
||||||
if (!add_one_stream(state->mem_ctx,
|
|
||||||
&state->num_streams, &state->streams,
|
|
||||||
- ea->name, ea->value.length-1,
|
|
||||||
+ ea->name, ea->value.length - config->xattr_compat_bytes,
|
|
||||||
smb_roundup(state->handle->conn,
|
|
||||||
- ea->value.length-1))) {
|
|
||||||
+ ea->value.length - config->xattr_compat_bytes))) {
|
|
||||||
state->status = NT_STATUS_NO_MEMORY;
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
@@ -875,6 +898,7 @@ static int streams_xattr_connect(vfs_handle_struct *ha
|
|
||||||
const char *default_prefix = SAMBA_XATTR_DOSSTREAM_PREFIX;
|
|
||||||
const char *prefix;
|
|
||||||
int rc;
|
|
||||||
+ bool xattr_compat;
|
|
||||||
|
|
||||||
rc = SMB_VFS_NEXT_CONNECT(handle, service, user);
|
|
||||||
if (rc != 0) {
|
|
||||||
@@ -905,6 +929,13 @@ static int streams_xattr_connect(vfs_handle_struct *ha
|
|
||||||
"store_stream_type",
|
|
||||||
true);
|
|
||||||
|
|
||||||
+ xattr_compat = lp_parm_bool(SNUM(handle->conn),
|
|
||||||
+ "streams_xattr",
|
|
||||||
+ "xattr_compat",
|
|
||||||
+ true);
|
|
||||||
+
|
|
||||||
+ config->xattr_compat_bytes = xattr_compat ? 0 : 1;
|
|
||||||
+
|
|
||||||
SMB_VFS_HANDLE_SET_DATA(handle, config,
|
|
||||||
NULL, struct stream_xattr_config,
|
|
||||||
return -1);
|
|
||||||
@@ -921,6 +952,7 @@ static ssize_t streams_xattr_pwrite(vfs_handle_struct
|
|
||||||
struct ea_struct ea;
|
|
||||||
NTSTATUS status;
|
|
||||||
int ret;
|
|
||||||
+ struct streams_xattr_config *config = NULL;
|
|
||||||
|
|
||||||
DEBUG(10, ("streams_xattr_pwrite called for %d bytes\n", (int)n));
|
|
||||||
|
|
||||||
@@ -932,6 +964,9 @@ static ssize_t streams_xattr_pwrite(vfs_handle_struct
|
|
||||||
return -1;
|
|
||||||
}
|
|
||||||
|
|
||||||
+ SMB_VFS_HANDLE_GET_DATA(handle, config, struct streams_xattr_config,
|
|
||||||
+ return -1);
|
|
||||||
+
|
|
||||||
if ((offset + n) >= lp_smbd_max_xattr_size(SNUM(handle->conn))) {
|
|
||||||
/*
|
|
||||||
* Requested write is beyond what can be read based on
|
|
||||||
@@ -961,11 +996,11 @@ static ssize_t streams_xattr_pwrite(vfs_handle_struct
|
|
||||||
return -1;
|
|
||||||
}
|
|
||||||
|
|
||||||
- if ((offset + n) > ea.value.length-1) {
|
|
||||||
+ if ((offset + n) > ea.value.length - config->xattr_compat_bytes) {
|
|
||||||
uint8_t *tmp;
|
|
||||||
|
|
||||||
tmp = talloc_realloc(talloc_tos(), ea.value.data, uint8_t,
|
|
||||||
- offset + n + 1);
|
|
||||||
+ offset + n + config->xattr_compat_bytes);
|
|
||||||
|
|
||||||
if (tmp == NULL) {
|
|
||||||
TALLOC_FREE(ea.value.data);
|
|
||||||
@@ -973,8 +1008,10 @@ static ssize_t streams_xattr_pwrite(vfs_handle_struct
|
|
||||||
return -1;
|
|
||||||
}
|
|
||||||
ea.value.data = tmp;
|
|
||||||
- ea.value.length = offset + n + 1;
|
|
||||||
- ea.value.data[offset+n] = 0;
|
|
||||||
+ ea.value.length = offset + n + config->xattr_compat_bytes;
|
|
||||||
+ if (config->xattr_compat_bytes) {
|
|
||||||
+ ea.value.data[offset+n] = 0;
|
|
||||||
+ }
|
|
||||||
}
|
|
||||||
|
|
||||||
memcpy(ea.value.data + offset, data, n);
|
|
||||||
@@ -1002,7 +1039,12 @@ static ssize_t streams_xattr_pread(vfs_handle_struct *
|
|
||||||
struct ea_struct ea;
|
|
||||||
NTSTATUS status;
|
|
||||||
size_t length, overlap;
|
|
||||||
+ struct smb_filename *smb_fname_base = NULL;
|
|
||||||
+ struct streams_xattr_config *config = NULL;
|
|
||||||
|
|
||||||
+ SMB_VFS_HANDLE_GET_DATA(handle, config, struct streams_xattr_config,
|
|
||||||
+ return -1);
|
|
||||||
+
|
|
||||||
DEBUG(10, ("streams_xattr_pread: offset=%d, size=%d\n",
|
|
||||||
(int)offset, (int)n));
|
|
||||||
|
|
||||||
@@ -1022,7 +1064,7 @@ static ssize_t streams_xattr_pread(vfs_handle_struct *
|
|
||||||
return -1;
|
|
||||||
}
|
|
||||||
|
|
||||||
- length = ea.value.length-1;
|
|
||||||
+ length = ea.value.length - config->xattr_compat_bytes;
|
|
||||||
|
|
||||||
DBG_DEBUG("get_ea_value_fsp returned %d bytes\n",
|
|
||||||
(int)length);
|
|
||||||
@@ -1210,6 +1252,12 @@ static int streams_xattr_ftruncate(struct vfs_handle_s
|
|
||||||
struct stream_io *sio =
|
|
||||||
(struct stream_io *)VFS_FETCH_FSP_EXTENSION(handle, fsp);
|
|
||||||
|
|
||||||
+ struct smb_filename *smb_fname_base = NULL;
|
|
||||||
+ struct streams_xattr_config *config = NULL;
|
|
||||||
+
|
|
||||||
+ SMB_VFS_HANDLE_GET_DATA(handle, config, struct streams_xattr_config,
|
|
||||||
+ return -1);
|
|
||||||
+
|
|
||||||
DEBUG(10, ("streams_xattr_ftruncate called for file %s offset %.0f\n",
|
|
||||||
fsp_str_dbg(fsp), (double)offset));
|
|
||||||
|
|
||||||
@@ -1239,14 +1287,16 @@ static int streams_xattr_ftruncate(struct vfs_handle_s
|
|
||||||
}
|
|
||||||
|
|
||||||
/* Did we expand ? */
|
|
||||||
- if (ea.value.length < offset + 1) {
|
|
||||||
+ if (ea.value.length < offset + config->xattr_compat_bytes) {
|
|
||||||
memset(&tmp[ea.value.length], '\0',
|
|
||||||
- offset + 1 - ea.value.length);
|
|
||||||
+ offset + config->xattr_compat_bytes - ea.value.length);
|
|
||||||
}
|
|
||||||
|
|
||||||
ea.value.data = tmp;
|
|
||||||
- ea.value.length = offset + 1;
|
|
||||||
- ea.value.data[offset] = 0;
|
|
||||||
+ ea.value.length = offset + config->xattr_compat_bytes;
|
|
||||||
+ if (config->xattr_compat_bytes) {
|
|
||||||
+ ea.value.data[offset] = 0;
|
|
||||||
+ }
|
|
||||||
|
|
||||||
ret = SMB_VFS_FSETXATTR(fsp->base_fsp,
|
|
||||||
sio->xattr_name,
|
|
||||||
@ -1,921 +0,0 @@
|
|||||||
From f07e384150e53b18c3ea298f9a1ea588fb89e19b Mon Sep 17 00:00:00 2001
|
|
||||||
From: "Timur I. Bakeyev" <timur@FreeBSD.org>
|
|
||||||
Date: Sat, 29 May 2021 03:58:01 +0200
|
|
||||||
Subject: [PATCH 27/28] Add VFS module vfs_freebsd that implements FreeBSD
|
|
||||||
specific wrappers to some VFS functions.
|
|
||||||
|
|
||||||
At the moment that is configurable mapping between Linux xattrs and
|
|
||||||
FreeBSD extended attributes.
|
|
||||||
|
|
||||||
Signed-off-by: Timur I. Bakeyev <timur@FreeBSD.org>
|
|
||||||
---
|
|
||||||
docs-xml/manpages/vfs_freebsd.8.xml | 169 ++++++
|
|
||||||
docs-xml/wscript_build | 1
|
|
||||||
source3/modules/vfs_freebsd.c | 699 ++++++++++++++++++++++++++
|
|
||||||
source3/modules/wscript_build | 7
|
|
||||||
4 files changed, 876 insertions(+)
|
|
||||||
|
|
||||||
diff -Naurp a/docs-xml/manpages/vfs_freebsd.8.xml b/docs-xml/manpages/vfs_freebsd.8.xml
|
|
||||||
--- a/docs-xml/manpages/vfs_freebsd.8.xml 1969-12-31 19:00:00.000000000 -0500
|
|
||||||
+++ b/docs-xml/manpages/vfs_freebsd.8.xml 2024-08-05 13:57:36.246690000 -0400
|
|
||||||
@@ -0,0 +1,169 @@
|
|
||||||
+<?xml version="1.0" encoding="iso-8859-1"?>
|
|
||||||
+<!DOCTYPE refentry PUBLIC "-//Samba-Team//DTD DocBook V4.2-Based Variant V1.0//EN" "http://www.samba.org/samba/DTD/samba-doc">
|
|
||||||
+<refentry id="vfs_freebsd.8">
|
|
||||||
+
|
|
||||||
+<refmeta>
|
|
||||||
+ <refentrytitle>vfs_freebsd</refentrytitle>
|
|
||||||
+ <manvolnum>8</manvolnum>
|
|
||||||
+ <refmiscinfo class="source">Samba</refmiscinfo>
|
|
||||||
+ <refmiscinfo class="manual">System Administration tools</refmiscinfo>
|
|
||||||
+ <refmiscinfo class="version">&doc.version;</refmiscinfo>
|
|
||||||
+</refmeta>
|
|
||||||
+
|
|
||||||
+<refnamediv>
|
|
||||||
+ <refname>vfs_freebsd</refname>
|
|
||||||
+ <refpurpose>FreeBSD-specific VFS functions</refpurpose>
|
|
||||||
+</refnamediv>
|
|
||||||
+
|
|
||||||
+<refsynopsisdiv>
|
|
||||||
+ <cmdsynopsis>
|
|
||||||
+ <command>vfs objects = freebsd</command>
|
|
||||||
+ </cmdsynopsis>
|
|
||||||
+</refsynopsisdiv>
|
|
||||||
+
|
|
||||||
+<refsect1>
|
|
||||||
+ <title>DESCRIPTION</title>
|
|
||||||
+
|
|
||||||
+ <para>This VFS module is part of the <citerefentry><refentrytitle>samba</refentrytitle>
|
|
||||||
+ <manvolnum>7</manvolnum></citerefentry> suite.</para>
|
|
||||||
+
|
|
||||||
+ <para>The <command>vfs_freebsd</command> module implements some of the FreeBSD-specific VFS functions.</para>
|
|
||||||
+
|
|
||||||
+ <para>This module is stackable.</para>
|
|
||||||
+</refsect1>
|
|
||||||
+
|
|
||||||
+
|
|
||||||
+<refsect1>
|
|
||||||
+ <title>OPTIONS</title>
|
|
||||||
+
|
|
||||||
+ <variablelist>
|
|
||||||
+
|
|
||||||
+ <varlistentry>
|
|
||||||
+ <term>freebsd:extattr mode=[legacy|compat|secure]</term>
|
|
||||||
+ <listitem>
|
|
||||||
+ <para>This parameter defines how the emulation of the Linux attr(5) extended attributes
|
|
||||||
+ is performed through the FreeBSD native extattr(9) system calls.</para>
|
|
||||||
+
|
|
||||||
+ <para>Currently the <emphasis>security</emphasis>, <emphasis>system</emphasis>,
|
|
||||||
+ <emphasis>trusted</emphasis> and <emphasis>user</emphasis> extended attribute(xattr)
|
|
||||||
+ classes are defined in Linux. Contrary FreeBSD has only <emphasis>USER</emphasis>
|
|
||||||
+ and <emphasis>SYSTEM</emphasis> extended attribute(extattr) namespaces, so mapping
|
|
||||||
+ of one set into another isn't straightforward and can be done in different ways.</para>
|
|
||||||
+
|
|
||||||
+ <para>Historically the Samba(7) built-in xattr mapping implementation simply converted
|
|
||||||
+ <emphasis>system</emphasis> and <emphasis>user</emphasis> xattr into corresponding
|
|
||||||
+ <emphasis>SYSTEM</emphasis> and <emphasis>USER</emphasis> extattr namespaces, dropping
|
|
||||||
+ the class prefix name with the separating dot and using attribute name only within the
|
|
||||||
+ mapped namespace. It also rejected any other xattr classes, like <emphasis>security</emphasis>
|
|
||||||
+ and <emphasis>trusted</emphasis> as invalid. Such behavior in particular broke AD
|
|
||||||
+ provisioning on UFS2 file systems as essential <emphasis>security.NTACL</emphasis>
|
|
||||||
+ xattr was rejected as invalid.</para>
|
|
||||||
+
|
|
||||||
+ <para>This module tries to address this problem and provide secure, where it's possible,
|
|
||||||
+ way to map Linux xattr into FreeBSD's extattr.</para>
|
|
||||||
+
|
|
||||||
+ <para>When <emphasis>mode</emphasis> is set to the <emphasis>legacy (default)</emphasis>
|
|
||||||
+ then modified version of built-in mapping is used, where <emphasis>system</emphasis> xattr
|
|
||||||
+ is mapped into SYSTEM namespace, while <emphasis>secure</emphasis>, <emphasis>trusted</emphasis>
|
|
||||||
+ and <emphasis>user</emphasis> xattr are all mapped into the USER namespace, dropping class
|
|
||||||
+ prefixes and mix them all together. This is the way how Samba FreeBSD ports were patched
|
|
||||||
+ up to the 4.9 version and that created multiple potential security issues. This mode is aimed for
|
|
||||||
+ the compatibility with the legacy installations only and should be avoided in new setups.</para>
|
|
||||||
+
|
|
||||||
+ <para>The <emphasis>compat</emphasis> mode is mostly designed for the jailed environments,
|
|
||||||
+ where it's not possible to write extattrs into the secure SYSTEM namespace, so all four
|
|
||||||
+ classes are mapped into the USER namespace. To preserve information about origin of the
|
|
||||||
+ extended attribute it is stored together with the class preffix in the <emphasis>class.attribute</emphasis>
|
|
||||||
+ format.</para>
|
|
||||||
+
|
|
||||||
+ <para>The <emphasis>secure</emphasis> mode is meant for storing extended attributes in a secure
|
|
||||||
+ manner, so that <emphasis>security</emphasis>, <emphasis>system</emphasis> and <emphasis>trusted</emphasis>
|
|
||||||
+ are stored in the SYSTEM namespace, which can be modified only by root.
|
|
||||||
+ </para>
|
|
||||||
+ </listitem>
|
|
||||||
+ </varlistentry>
|
|
||||||
+
|
|
||||||
+
|
|
||||||
+ </variablelist>
|
|
||||||
+</refsect1>
|
|
||||||
+
|
|
||||||
+<refsect1>
|
|
||||||
+ <table frame="all" rowheader="firstcol">
|
|
||||||
+ <title>Attributes mapping</title>
|
|
||||||
+ <tgroup cols='5' align='left' colsep='1' rowsep='1'>
|
|
||||||
+ <thead>
|
|
||||||
+ <row>
|
|
||||||
+ <entry> </entry>
|
|
||||||
+ <entry>built-in</entry>
|
|
||||||
+ <entry>legacy</entry>
|
|
||||||
+ <entry>compat/jail</entry>
|
|
||||||
+ <entry>secure</entry>
|
|
||||||
+ </row>
|
|
||||||
+ </thead>
|
|
||||||
+ <tbody>
|
|
||||||
+ <row>
|
|
||||||
+ <entry>user</entry>
|
|
||||||
+ <entry>USER; attribute</entry>
|
|
||||||
+ <entry>USER; attribute</entry>
|
|
||||||
+ <entry>USER; user.attribute</entry>
|
|
||||||
+ <entry>USER; user.attribute</entry>
|
|
||||||
+ </row>
|
|
||||||
+ <row>
|
|
||||||
+ <entry>system</entry>
|
|
||||||
+ <entry>SYSTEM; attribute</entry>
|
|
||||||
+ <entry>SYSTEM; attribute</entry>
|
|
||||||
+ <entry>USER; system.attribute</entry>
|
|
||||||
+ <entry>SYSTEM; system.attribute</entry>
|
|
||||||
+ </row>
|
|
||||||
+ <row>
|
|
||||||
+ <entry>trusted</entry>
|
|
||||||
+ <entry>FAIL</entry>
|
|
||||||
+ <entry>USER; attribute</entry>
|
|
||||||
+ <entry>USER; trusted.attribute</entry>
|
|
||||||
+ <entry>SYSTEM; trusted.attribute</entry>
|
|
||||||
+ </row>
|
|
||||||
+ <row>
|
|
||||||
+ <entry>security</entry>
|
|
||||||
+ <entry>FAIL</entry>
|
|
||||||
+ <entry>USER; attribute</entry>
|
|
||||||
+ <entry>USER; security.attribute</entry>
|
|
||||||
+ <entry>SYSTEM; security.attribute</entry>
|
|
||||||
+ </row>
|
|
||||||
+ </tbody>
|
|
||||||
+ </tgroup>
|
|
||||||
+ </table>
|
|
||||||
+</refsect1>
|
|
||||||
+
|
|
||||||
+<refsect1>
|
|
||||||
+ <title>EXAMPLES</title>
|
|
||||||
+
|
|
||||||
+ <para>Use secure method of setting extended attributes on the share:</para>
|
|
||||||
+
|
|
||||||
+<programlisting>
|
|
||||||
+ <smbconfsection name="[sysvol]"/>
|
|
||||||
+ <smbconfoption name="vfs objects">freebsd</smbconfoption>
|
|
||||||
+ <smbconfoption name="freebsd:extattr mode">secure</smbconfoption>
|
|
||||||
+</programlisting>
|
|
||||||
+
|
|
||||||
+</refsect1>
|
|
||||||
+
|
|
||||||
+<refsect1>
|
|
||||||
+ <title>VERSION</title>
|
|
||||||
+
|
|
||||||
+ <para>This man page is part of version &doc.version; of the Samba suite.
|
|
||||||
+ </para>
|
|
||||||
+</refsect1>
|
|
||||||
+
|
|
||||||
+<refsect1>
|
|
||||||
+ <title>AUTHOR</title>
|
|
||||||
+
|
|
||||||
+ <para>The original Samba software and related utilities
|
|
||||||
+ were created by Andrew Tridgell. Samba is now developed
|
|
||||||
+ by the Samba Team as an Open Source project similar
|
|
||||||
+ to the way the Linux kernel is developed.</para>
|
|
||||||
+
|
|
||||||
+ <para>This module was written by Timur I. Bakeyev</para>
|
|
||||||
+
|
|
||||||
+</refsect1>
|
|
||||||
+
|
|
||||||
+</refentry>
|
|
||||||
diff -Naurp a/docs-xml/wscript_build b/docs-xml/wscript_build
|
|
||||||
--- a/docs-xml/wscript_build 2024-08-02 07:54:09.597892000 -0400
|
|
||||||
+++ b/docs-xml/wscript_build 2024-08-05 13:57:36.246975000 -0400
|
|
||||||
@@ -87,6 +87,7 @@ vfs_module_manpages = ['vfs_acl_tdb',
|
|
||||||
'vfs_extd_audit',
|
|
||||||
'vfs_fake_perms',
|
|
||||||
'vfs_fileid',
|
|
||||||
+ 'vfs_freebsd',
|
|
||||||
'vfs_fruit',
|
|
||||||
'vfs_full_audit',
|
|
||||||
'vfs_glusterfs',
|
|
||||||
diff -Naurp a/source3/modules/vfs_freebsd.c b/source3/modules/vfs_freebsd.c
|
|
||||||
--- a/source3/modules/vfs_freebsd.c 1969-12-31 19:00:00.000000000 -0500
|
|
||||||
+++ b/source3/modules/vfs_freebsd.c 2024-08-05 13:57:36.247358000 -0400
|
|
||||||
@@ -0,0 +1,699 @@
|
|
||||||
+/*
|
|
||||||
+ * This module implements VFS calls specific to FreeBSD
|
|
||||||
+ *
|
|
||||||
+ * Copyright (C) Timur I. Bakeyev, 2018
|
|
||||||
+ *
|
|
||||||
+ * This program is free software; you can redistribute it and/or modify
|
|
||||||
+ * it under the terms of the GNU General Public License as published by
|
|
||||||
+ * the Free Software Foundation; either version 3 of the License, or
|
|
||||||
+ * (at your option) any later version.
|
|
||||||
+ *
|
|
||||||
+ * This program is distributed in the hope that it will be useful,
|
|
||||||
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
||||||
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
||||||
+ * GNU General Public License for more details.
|
|
||||||
+ *
|
|
||||||
+ * You should have received a copy of the GNU General Public License
|
|
||||||
+ * along with this program; if not, see <http://www.gnu.org/licenses/>.
|
|
||||||
+ */
|
|
||||||
+
|
|
||||||
+#include "includes.h"
|
|
||||||
+
|
|
||||||
+#include "lib/util/tevent_unix.h"
|
|
||||||
+#include "lib/util/tevent_ntstatus.h"
|
|
||||||
+#include "system/filesys.h"
|
|
||||||
+#include "smbd/smbd.h"
|
|
||||||
+
|
|
||||||
+#include <sys/sysctl.h>
|
|
||||||
+
|
|
||||||
+static int vfs_freebsd_debug_level = DBGC_VFS;
|
|
||||||
+
|
|
||||||
+#undef DBGC_CLASS
|
|
||||||
+#define DBGC_CLASS vfs_freebsd_debug_level
|
|
||||||
+
|
|
||||||
+#ifndef EXTATTR_MAXNAMELEN
|
|
||||||
+#define EXTATTR_MAXNAMELEN UINT8_MAX
|
|
||||||
+#endif
|
|
||||||
+
|
|
||||||
+#define EXTATTR_NAMESPACE(NS) EXTATTR_NAMESPACE_ ## NS, \
|
|
||||||
+ EXTATTR_NAMESPACE_ ## NS ## _STRING ".", \
|
|
||||||
+ .data.len = (sizeof(EXTATTR_NAMESPACE_ ## NS ## _STRING ".") - 1)
|
|
||||||
+
|
|
||||||
+#define EXTATTR_EMPTY 0x00
|
|
||||||
+#define EXTATTR_USER 0x01
|
|
||||||
+#define EXTATTR_SYSTEM 0x02
|
|
||||||
+#define EXTATTR_SECURITY 0x03
|
|
||||||
+#define EXTATTR_TRUSTED 0x04
|
|
||||||
+
|
|
||||||
+enum extattr_mode {
|
|
||||||
+ FREEBSD_EXTATTR_SECURE,
|
|
||||||
+ FREEBSD_EXTATTR_COMPAT,
|
|
||||||
+ FREEBSD_EXTATTR_LEGACY
|
|
||||||
+};
|
|
||||||
+
|
|
||||||
+struct freebsd_handle_data {
|
|
||||||
+ enum extattr_mode extattr_mode;
|
|
||||||
+};
|
|
||||||
+
|
|
||||||
+typedef struct {
|
|
||||||
+ int namespace;
|
|
||||||
+ char name[EXTATTR_MAXNAMELEN+1];
|
|
||||||
+ union {
|
|
||||||
+ uint16_t len;
|
|
||||||
+ uint16_t flags;
|
|
||||||
+ } data;
|
|
||||||
+} extattr_attr;
|
|
||||||
+
|
|
||||||
+static const struct enum_list extattr_mode_param[] = {
|
|
||||||
+ { FREEBSD_EXTATTR_SECURE, "secure" }, /* */
|
|
||||||
+ { FREEBSD_EXTATTR_COMPAT, "compat" }, /* */
|
|
||||||
+ { FREEBSD_EXTATTR_LEGACY, "legacy" }, /* */
|
|
||||||
+ { -1, NULL }
|
|
||||||
+};
|
|
||||||
+
|
|
||||||
+/* XXX: This order doesn't match namespace ids order! */
|
|
||||||
+static extattr_attr extattr[] = {
|
|
||||||
+ { EXTATTR_NAMESPACE(EMPTY) },
|
|
||||||
+ { EXTATTR_NAMESPACE(SYSTEM) },
|
|
||||||
+ { EXTATTR_NAMESPACE(USER) },
|
|
||||||
+};
|
|
||||||
+
|
|
||||||
+
|
|
||||||
+static bool freebsd_in_jail(void) {
|
|
||||||
+ int val = 0;
|
|
||||||
+ size_t val_len = sizeof(val);
|
|
||||||
+
|
|
||||||
+ if((sysctlbyname("security.jail.jailed", &val, &val_len, NULL, 0) != -1) && val == 1) {
|
|
||||||
+ return true;
|
|
||||||
+ }
|
|
||||||
+ return false;
|
|
||||||
+}
|
|
||||||
+
|
|
||||||
+
|
|
||||||
+static uint16_t freebsd_map_attrname(const char *name)
|
|
||||||
+{
|
|
||||||
+ if(name == NULL || name[0] == '\0') {
|
|
||||||
+ return EXTATTR_EMPTY;
|
|
||||||
+ }
|
|
||||||
+
|
|
||||||
+ switch(name[0]) {
|
|
||||||
+ case 'u':
|
|
||||||
+ if(strncmp(name, "user.", 5) == 0)
|
|
||||||
+ return EXTATTR_USER;
|
|
||||||
+ break;
|
|
||||||
+ case 't':
|
|
||||||
+ if(strncmp(name, "trusted.", 8) == 0)
|
|
||||||
+ return EXTATTR_TRUSTED;
|
|
||||||
+ break;
|
|
||||||
+ case 's':
|
|
||||||
+ /* name[1] could be any character, including '\0' */
|
|
||||||
+ switch(name[1]) {
|
|
||||||
+ case 'e':
|
|
||||||
+ if(strncmp(name, "security.", 9) == 0)
|
|
||||||
+ return EXTATTR_SECURITY;
|
|
||||||
+ break;
|
|
||||||
+ case 'y':
|
|
||||||
+ if(strncmp(name, "system.", 7) == 0)
|
|
||||||
+ return EXTATTR_SYSTEM;
|
|
||||||
+ break;
|
|
||||||
+ }
|
|
||||||
+ break;
|
|
||||||
+ }
|
|
||||||
+ return EXTATTR_USER;
|
|
||||||
+}
|
|
||||||
+
|
|
||||||
+
|
|
||||||
+/* security, system, trusted or user */
|
|
||||||
+static extattr_attr* freebsd_map_xattr(enum extattr_mode extattr_mode, const char *name, extattr_attr *attr)
|
|
||||||
+{
|
|
||||||
+ int attrnamespace = EXTATTR_NAMESPACE_EMPTY;
|
|
||||||
+ const char *p, *attrname = name;
|
|
||||||
+
|
|
||||||
+ if(name == NULL || name[0] == '\0') {
|
|
||||||
+ return NULL;
|
|
||||||
+ }
|
|
||||||
+
|
|
||||||
+ if(attr == NULL) {
|
|
||||||
+ return NULL;
|
|
||||||
+ }
|
|
||||||
+
|
|
||||||
+ uint16_t flags = freebsd_map_attrname(name);
|
|
||||||
+
|
|
||||||
+ switch(flags) {
|
|
||||||
+ case EXTATTR_SECURITY:
|
|
||||||
+ case EXTATTR_TRUSTED:
|
|
||||||
+ case EXTATTR_SYSTEM:
|
|
||||||
+ attrnamespace = (extattr_mode == FREEBSD_EXTATTR_SECURE) ?
|
|
||||||
+ EXTATTR_NAMESPACE_SYSTEM :
|
|
||||||
+ EXTATTR_NAMESPACE_USER;
|
|
||||||
+ break;
|
|
||||||
+ case EXTATTR_USER:
|
|
||||||
+ attrnamespace = EXTATTR_NAMESPACE_USER;
|
|
||||||
+ break;
|
|
||||||
+ default:
|
|
||||||
+ /* Default to "user" namespace if nothing else was specified */
|
|
||||||
+ attrnamespace = EXTATTR_NAMESPACE_USER;
|
|
||||||
+ flags = EXTATTR_USER;
|
|
||||||
+ break;
|
|
||||||
+ }
|
|
||||||
+
|
|
||||||
+ if (extattr_mode == FREEBSD_EXTATTR_LEGACY) {
|
|
||||||
+ switch(flags) {
|
|
||||||
+ case EXTATTR_SECURITY:
|
|
||||||
+ attrname = name + 9;
|
|
||||||
+ break;
|
|
||||||
+ case EXTATTR_TRUSTED:
|
|
||||||
+ attrname = name + 8;
|
|
||||||
+ break;
|
|
||||||
+ case EXTATTR_SYSTEM:
|
|
||||||
+ attrname = name + 7;
|
|
||||||
+ break;
|
|
||||||
+ case EXTATTR_USER:
|
|
||||||
+ attrname = name + 5;
|
|
||||||
+ break;
|
|
||||||
+ default:
|
|
||||||
+ attrname = ((p=strchr(name, '.')) != NULL) ? p + 1 : name;
|
|
||||||
+ break;
|
|
||||||
+ }
|
|
||||||
+ }
|
|
||||||
+
|
|
||||||
+ attr->namespace = attrnamespace;
|
|
||||||
+ attr->data.flags = flags;
|
|
||||||
+ strlcpy(attr->name, attrname, EXTATTR_MAXNAMELEN + 1);
|
|
||||||
+
|
|
||||||
+ return attr;
|
|
||||||
+}
|
|
||||||
+
|
|
||||||
+
|
|
||||||
+static ssize_t extattr_size(struct files_struct *fsp, extattr_attr *attr)
|
|
||||||
+{
|
|
||||||
+ ssize_t result;
|
|
||||||
+
|
|
||||||
+ SMB_ASSERT(!fsp_is_alternate_stream(fsp));
|
|
||||||
+
|
|
||||||
+ int fd = fsp_get_pathref_fd(fsp);
|
|
||||||
+
|
|
||||||
+ if (fsp->fsp_flags.is_pathref) {
|
|
||||||
+ const char *path = fsp->fsp_name->base_name;
|
|
||||||
+ if (fsp->fsp_flags.have_proc_fds) {
|
|
||||||
+ char buf[PATH_MAX];
|
|
||||||
+ path = sys_proc_fd_path(fd, buf, sizeof(buf));
|
|
||||||
+ if (path == NULL) {
|
|
||||||
+ return -1;
|
|
||||||
+ }
|
|
||||||
+ }
|
|
||||||
+ /*
|
|
||||||
+ * This is no longer a handle based call.
|
|
||||||
+ */
|
|
||||||
+ return extattr_get_file(path, attr->namespace, attr->name, NULL, 0);
|
|
||||||
+ }
|
|
||||||
+ else {
|
|
||||||
+ return extattr_get_fd(fd, attr->namespace, attr->name, NULL, 0);
|
|
||||||
+ }
|
|
||||||
+}
|
|
||||||
+
|
|
||||||
+/*
|
|
||||||
+ * The list of names is returned as an unordered array of NULL-terminated
|
|
||||||
+ * character strings (attribute names are separated by NULL characters),
|
|
||||||
+ * like this:
|
|
||||||
+ * user.name1\0system.name1\0user.name2\0
|
|
||||||
+ *
|
|
||||||
+ * Filesystems like ext2, ext3 and XFS which implement POSIX ACLs using
|
|
||||||
+ * extended attributes, might return a list like this:
|
|
||||||
+ * system.posix_acl_access\0system.posix_acl_default\0
|
|
||||||
+ */
|
|
||||||
+/*
|
|
||||||
+ * The extattr_list_file() returns a list of attributes present in the
|
|
||||||
+ * requested namespace. Each list entry consists of a single byte containing
|
|
||||||
+ * the length of the attribute name, followed by the attribute name. The
|
|
||||||
+ * attribute name is not terminated by ASCII 0 (nul).
|
|
||||||
+*/
|
|
||||||
+static ssize_t freebsd_extattr_list(struct files_struct *fsp, enum extattr_mode extattr_mode, char *list, size_t size)
|
|
||||||
+{
|
|
||||||
+ ssize_t list_size, total_size = 0;
|
|
||||||
+ char *p, *q, *list_end;
|
|
||||||
+ int len;
|
|
||||||
+ /*
|
|
||||||
+ Ignore all but user namespace when we are not root or in jail
|
|
||||||
+ See: https://bugzilla.samba.org/show_bug.cgi?id=10247
|
|
||||||
+ */
|
|
||||||
+ bool as_root = (geteuid() == 0);
|
|
||||||
+
|
|
||||||
+ int ns = (extattr_mode == FREEBSD_EXTATTR_SECURE && as_root) ? 1 : 2;
|
|
||||||
+
|
|
||||||
+ int fd = fsp_get_pathref_fd(fsp);
|
|
||||||
+
|
|
||||||
+ /* Iterate through extattr(2) namespaces */
|
|
||||||
+ for(; ns < ARRAY_SIZE(extattr); ns++) {
|
|
||||||
+ list_size = -1;
|
|
||||||
+
|
|
||||||
+ if (fsp->fsp_flags.is_pathref) {
|
|
||||||
+ const char *path = fsp->fsp_name->base_name;
|
|
||||||
+ if (fsp->fsp_flags.have_proc_fds) {
|
|
||||||
+ char buf[PATH_MAX];
|
|
||||||
+ path = sys_proc_fd_path(fd, buf, sizeof(buf));
|
|
||||||
+ if (path == NULL) {
|
|
||||||
+ return -1;
|
|
||||||
+ }
|
|
||||||
+ }
|
|
||||||
+ /*
|
|
||||||
+ * This is no longer a handle based call.
|
|
||||||
+ */
|
|
||||||
+ list_size = extattr_list_file(path, extattr[ns].namespace, list, size);
|
|
||||||
+ }
|
|
||||||
+ else {
|
|
||||||
+ list_size = extattr_list_fd(fd, extattr[ns].namespace, list, size);
|
|
||||||
+ }
|
|
||||||
+ /* Some error happend. Errno should be set by the previous call */
|
|
||||||
+ if(list_size < 0)
|
|
||||||
+ return -1;
|
|
||||||
+ /* No attributes in this namespace */
|
|
||||||
+ if(list_size == 0)
|
|
||||||
+ continue;
|
|
||||||
+ /*
|
|
||||||
+ Call with an empty buffer may be used to calculate
|
|
||||||
+ necessary buffer size.
|
|
||||||
+ */
|
|
||||||
+ if(list == NULL) {
|
|
||||||
+ /*
|
|
||||||
+ XXX: Unfortunately, we can't say, how many attributes were
|
|
||||||
+ returned, so here is the potential problem with the emulation.
|
|
||||||
+ */
|
|
||||||
+ if(extattr_mode == FREEBSD_EXTATTR_LEGACY) {
|
|
||||||
+ /*
|
|
||||||
+ Take the worse case of one char attribute names -
|
|
||||||
+ two bytes per name plus one more for sanity.
|
|
||||||
+ */
|
|
||||||
+ total_size += list_size + (list_size/2 + 1)*extattr[ns].data.len;
|
|
||||||
+ }
|
|
||||||
+ else {
|
|
||||||
+ total_size += list_size;
|
|
||||||
+ }
|
|
||||||
+ continue;
|
|
||||||
+ }
|
|
||||||
+
|
|
||||||
+ if(extattr_mode == FREEBSD_EXTATTR_LEGACY) {
|
|
||||||
+ /* Count necessary offset to fit namespace prefixes */
|
|
||||||
+ int extra_len = 0;
|
|
||||||
+ uint16_t flags;
|
|
||||||
+ list_end = list + list_size;
|
|
||||||
+ for(list_size = 0, p = q = list; p < list_end; p += len) {
|
|
||||||
+ len = p[0] + 1;
|
|
||||||
+ (void)strlcpy(q, p + 1, len);
|
|
||||||
+ flags = freebsd_map_attrname(q);
|
|
||||||
+ /* Skip secure attributes for non-root user */
|
|
||||||
+ if(extattr_mode != FREEBSD_EXTATTR_SECURE && !as_root && flags > EXTATTR_USER) {
|
|
||||||
+ continue;
|
|
||||||
+ }
|
|
||||||
+ if(flags <= EXTATTR_USER) {
|
|
||||||
+ /* Don't count trailing '\0' */
|
|
||||||
+ extra_len += extattr[ns].data.len;
|
|
||||||
+ }
|
|
||||||
+ list_size += len;
|
|
||||||
+ q += len;
|
|
||||||
+ }
|
|
||||||
+ total_size += list_size + extra_len;
|
|
||||||
+ /* Buffer is too small to fit the results */
|
|
||||||
+ if(total_size > size) {
|
|
||||||
+ errno = ERANGE;
|
|
||||||
+ return -1;
|
|
||||||
+ }
|
|
||||||
+ /* Shift results backwards, so we can prepend prefixes */
|
|
||||||
+ list_end = list + extra_len;
|
|
||||||
+ p = (char*)memmove(list_end, list, list_size);
|
|
||||||
+ /*
|
|
||||||
+ We enter the loop with `p` pointing to the shifted list and
|
|
||||||
+ `extra_len` having the total margin between `list` and `p`
|
|
||||||
+ */
|
|
||||||
+ for(list_end += list_size; p < list_end; p += len) {
|
|
||||||
+ len = strlen(p) + 1;
|
|
||||||
+ flags = freebsd_map_attrname(p);
|
|
||||||
+ if(flags <= EXTATTR_USER) {
|
|
||||||
+ /* Add namespace prefix */
|
|
||||||
+ (void)strncpy(list, extattr[ns].name, extattr[ns].data.len);
|
|
||||||
+ list += extattr[ns].data.len;
|
|
||||||
+ }
|
|
||||||
+ /* Append attribute name */
|
|
||||||
+ (void)strlcpy(list, p, len);
|
|
||||||
+ list += len;
|
|
||||||
+ }
|
|
||||||
+ }
|
|
||||||
+ else {
|
|
||||||
+ /* Convert UCSD strings into nul-terminated strings */
|
|
||||||
+ for(list_end = list + list_size; list < list_end; list += len) {
|
|
||||||
+ len = list[0] + 1;
|
|
||||||
+ (void)strlcpy(list, list + 1, len);
|
|
||||||
+ }
|
|
||||||
+ total_size += list_size;
|
|
||||||
+ }
|
|
||||||
+ }
|
|
||||||
+ return total_size;
|
|
||||||
+}
|
|
||||||
+
|
|
||||||
+/*
|
|
||||||
+static ssize_t freebsd_fgetxattr_size(struct vfs_handle_struct *handle,
|
|
||||||
+ struct files_struct *fsp,
|
|
||||||
+ const char *name)
|
|
||||||
+{
|
|
||||||
+ struct freebsd_handle_data *data;
|
|
||||||
+ extattr_attr attr;
|
|
||||||
+
|
|
||||||
+ SMB_ASSERT(!fsp_is_alternate_stream(fsp));
|
|
||||||
+
|
|
||||||
+ SMB_VFS_HANDLE_GET_DATA(handle, data,
|
|
||||||
+ struct freebsd_handle_data,
|
|
||||||
+ return -1);
|
|
||||||
+
|
|
||||||
+ if(!freebsd_map_xattr(data->extattr_mode, name, &attr)) {
|
|
||||||
+ errno = EINVAL;
|
|
||||||
+ return -1;
|
|
||||||
+ }
|
|
||||||
+
|
|
||||||
+ if(data->extattr_mode != FREEBSD_EXTATTR_SECURE && geteuid() != 0 && attr.data.flags > EXTATTR_USER) {
|
|
||||||
+ errno = ENOATTR;
|
|
||||||
+ return -1;
|
|
||||||
+ }
|
|
||||||
+
|
|
||||||
+ return extattr_size(fsp, &attr);
|
|
||||||
+}
|
|
||||||
+*/
|
|
||||||
+
|
|
||||||
+/* VFS entries */
|
|
||||||
+static ssize_t freebsd_fgetxattr(struct vfs_handle_struct *handle,
|
|
||||||
+ struct files_struct *fsp,
|
|
||||||
+ const char *name,
|
|
||||||
+ void *value,
|
|
||||||
+ size_t size)
|
|
||||||
+{
|
|
||||||
+#if defined(HAVE_XATTR_EXTATTR)
|
|
||||||
+ struct freebsd_handle_data *data;
|
|
||||||
+ extattr_attr attr;
|
|
||||||
+ ssize_t res;
|
|
||||||
+ int fd;
|
|
||||||
+
|
|
||||||
+ SMB_ASSERT(!fsp_is_alternate_stream(fsp));
|
|
||||||
+
|
|
||||||
+ SMB_VFS_HANDLE_GET_DATA(handle, data,
|
|
||||||
+ struct freebsd_handle_data,
|
|
||||||
+ return -1);
|
|
||||||
+
|
|
||||||
+ if(!freebsd_map_xattr(data->extattr_mode, name, &attr)) {
|
|
||||||
+ errno = EINVAL;
|
|
||||||
+ return -1;
|
|
||||||
+ }
|
|
||||||
+
|
|
||||||
+ /* Filter out 'secure' entries */
|
|
||||||
+ if(data->extattr_mode != FREEBSD_EXTATTR_SECURE && geteuid() != 0 && attr.data.flags > EXTATTR_USER) {
|
|
||||||
+ errno = ENOATTR;
|
|
||||||
+ return -1;
|
|
||||||
+ }
|
|
||||||
+
|
|
||||||
+ /*
|
|
||||||
+ * The BSD implementation has a nasty habit of silently truncating
|
|
||||||
+ * the returned value to the size of the buffer, so we have to check
|
|
||||||
+ * that the buffer is large enough to fit the returned value.
|
|
||||||
+ */
|
|
||||||
+ if((res=extattr_size(fsp, &attr)) < 0) {
|
|
||||||
+ return -1;
|
|
||||||
+ }
|
|
||||||
+
|
|
||||||
+ if (size == 0) {
|
|
||||||
+ return res;
|
|
||||||
+ }
|
|
||||||
+ else if (res > size) {
|
|
||||||
+ errno = ERANGE;
|
|
||||||
+ return -1;
|
|
||||||
+ }
|
|
||||||
+
|
|
||||||
+ fd = fsp_get_pathref_fd(fsp);
|
|
||||||
+
|
|
||||||
+ if (fsp->fsp_flags.is_pathref) {
|
|
||||||
+ const char *path = fsp->fsp_name->base_name;
|
|
||||||
+ if (fsp->fsp_flags.have_proc_fds) {
|
|
||||||
+ char buf[PATH_MAX];
|
|
||||||
+ path = sys_proc_fd_path(fd, buf, sizeof(buf));
|
|
||||||
+ if (path == NULL) {
|
|
||||||
+ return -1;
|
|
||||||
+ }
|
|
||||||
+ }
|
|
||||||
+ /*
|
|
||||||
+ * This is no longer a handle based call.
|
|
||||||
+ */
|
|
||||||
+ return extattr_get_file(path, attr.namespace, attr.name, value, size);
|
|
||||||
+ }
|
|
||||||
+ else {
|
|
||||||
+ return extattr_get_fd(fd, attr.namespace, attr.name, value, size);
|
|
||||||
+ }
|
|
||||||
+ return -1;
|
|
||||||
+#else
|
|
||||||
+ errno = ENOSYS;
|
|
||||||
+ return -1;
|
|
||||||
+#endif
|
|
||||||
+}
|
|
||||||
+
|
|
||||||
+
|
|
||||||
+static ssize_t freebsd_flistxattr(struct vfs_handle_struct *handle,
|
|
||||||
+ struct files_struct *fsp,
|
|
||||||
+ char *list,
|
|
||||||
+ size_t size)
|
|
||||||
+{
|
|
||||||
+#if defined(HAVE_XATTR_EXTATTR)
|
|
||||||
+ struct freebsd_handle_data *data;
|
|
||||||
+
|
|
||||||
+ SMB_ASSERT(!fsp_is_alternate_stream(fsp));
|
|
||||||
+
|
|
||||||
+ SMB_VFS_HANDLE_GET_DATA(handle, data,
|
|
||||||
+ struct freebsd_handle_data,
|
|
||||||
+ return -1);
|
|
||||||
+
|
|
||||||
+ return freebsd_extattr_list(fsp, data->extattr_mode, list, size);
|
|
||||||
+#else
|
|
||||||
+ errno = ENOSYS;
|
|
||||||
+ return -1;
|
|
||||||
+#endif
|
|
||||||
+}
|
|
||||||
+
|
|
||||||
+
|
|
||||||
+static int freebsd_fremovexattr(struct vfs_handle_struct *handle,
|
|
||||||
+ struct files_struct *fsp,
|
|
||||||
+ const char *name)
|
|
||||||
+{
|
|
||||||
+#if defined(HAVE_XATTR_EXTATTR)
|
|
||||||
+ struct freebsd_handle_data *data;
|
|
||||||
+ extattr_attr attr;
|
|
||||||
+ int fd;
|
|
||||||
+
|
|
||||||
+ SMB_ASSERT(!fsp_is_alternate_stream(fsp));
|
|
||||||
+
|
|
||||||
+ SMB_VFS_HANDLE_GET_DATA(handle, data,
|
|
||||||
+ struct freebsd_handle_data,
|
|
||||||
+ return -1);
|
|
||||||
+
|
|
||||||
+ if(!freebsd_map_xattr(data->extattr_mode, name, &attr)) {
|
|
||||||
+ errno = EINVAL;
|
|
||||||
+ return -1;
|
|
||||||
+ }
|
|
||||||
+
|
|
||||||
+ /* Filter out 'secure' entries */
|
|
||||||
+ if(data->extattr_mode != FREEBSD_EXTATTR_SECURE && geteuid() != 0 && attr.data.flags > EXTATTR_USER) {
|
|
||||||
+ errno = ENOATTR;
|
|
||||||
+ return -1;
|
|
||||||
+ }
|
|
||||||
+
|
|
||||||
+ fd = fsp_get_pathref_fd(fsp);
|
|
||||||
+
|
|
||||||
+ if (fsp->fsp_flags.is_pathref) {
|
|
||||||
+ const char *path = fsp->fsp_name->base_name;
|
|
||||||
+ if (fsp->fsp_flags.have_proc_fds) {
|
|
||||||
+ char buf[PATH_MAX];
|
|
||||||
+ path = sys_proc_fd_path(fd, buf, sizeof(buf));
|
|
||||||
+ if (path == NULL) {
|
|
||||||
+ return -1;
|
|
||||||
+ }
|
|
||||||
+ }
|
|
||||||
+ /*
|
|
||||||
+ * This is no longer a handle based call.
|
|
||||||
+ */
|
|
||||||
+ return extattr_delete_file(path, attr.namespace, attr.name);
|
|
||||||
+ }
|
|
||||||
+ else {
|
|
||||||
+ return extattr_delete_fd(fd, attr.namespace, attr.name);
|
|
||||||
+ }
|
|
||||||
+ return -1;
|
|
||||||
+#else
|
|
||||||
+ errno = ENOSYS;
|
|
||||||
+ return -1;
|
|
||||||
+#endif
|
|
||||||
+}
|
|
||||||
+
|
|
||||||
+
|
|
||||||
+static int freebsd_fsetxattr(struct vfs_handle_struct *handle,
|
|
||||||
+ struct files_struct *fsp,
|
|
||||||
+ const char *name,
|
|
||||||
+ const void *value,
|
|
||||||
+ size_t size,
|
|
||||||
+ int flags)
|
|
||||||
+{
|
|
||||||
+#if defined(HAVE_XATTR_EXTATTR)
|
|
||||||
+ struct freebsd_handle_data *data;
|
|
||||||
+ extattr_attr attr;
|
|
||||||
+ ssize_t res;
|
|
||||||
+ int fd;
|
|
||||||
+
|
|
||||||
+ SMB_ASSERT(!fsp_is_alternate_stream(fsp));
|
|
||||||
+
|
|
||||||
+ SMB_VFS_HANDLE_GET_DATA(handle, data,
|
|
||||||
+ struct freebsd_handle_data,
|
|
||||||
+ return -1);
|
|
||||||
+
|
|
||||||
+ if(!freebsd_map_xattr(data->extattr_mode, name, &attr)) {
|
|
||||||
+ errno = EINVAL;
|
|
||||||
+ return -1;
|
|
||||||
+ }
|
|
||||||
+
|
|
||||||
+ /* Filter out 'secure' entries */
|
|
||||||
+ if(data->extattr_mode != FREEBSD_EXTATTR_SECURE && geteuid() != 0 && attr.data.flags > EXTATTR_USER) {
|
|
||||||
+ errno = ENOATTR;
|
|
||||||
+ return -1;
|
|
||||||
+ }
|
|
||||||
+
|
|
||||||
+ if (flags) {
|
|
||||||
+ /* Check attribute existence */
|
|
||||||
+ res = extattr_size(fsp, &attr);
|
|
||||||
+ if (res < 0) {
|
|
||||||
+ /* REPLACE attribute, that doesn't exist */
|
|
||||||
+ if ((flags & XATTR_REPLACE) && errno == ENOATTR) {
|
|
||||||
+ errno = ENOATTR;
|
|
||||||
+ return -1;
|
|
||||||
+ }
|
|
||||||
+ /* Ignore other errors */
|
|
||||||
+ }
|
|
||||||
+ else {
|
|
||||||
+ /* CREATE attribute, that already exists */
|
|
||||||
+ if (flags & XATTR_CREATE) {
|
|
||||||
+ errno = EEXIST;
|
|
||||||
+ return -1;
|
|
||||||
+ }
|
|
||||||
+ }
|
|
||||||
+ }
|
|
||||||
+
|
|
||||||
+ fd = fsp_get_pathref_fd(fsp);
|
|
||||||
+
|
|
||||||
+ if (fsp->fsp_flags.is_pathref) {
|
|
||||||
+ const char *path = fsp->fsp_name->base_name;
|
|
||||||
+ if (fsp->fsp_flags.have_proc_fds) {
|
|
||||||
+ char buf[PATH_MAX];
|
|
||||||
+ path = sys_proc_fd_path(fd, buf, sizeof(buf));
|
|
||||||
+ if (path == NULL) {
|
|
||||||
+ return -1;
|
|
||||||
+ }
|
|
||||||
+ }
|
|
||||||
+ /*
|
|
||||||
+ * This is no longer a handle based call.
|
|
||||||
+ */
|
|
||||||
+ res = extattr_set_file(path, attr.namespace, attr.name, value, size);
|
|
||||||
+ }
|
|
||||||
+ else {
|
|
||||||
+ res = extattr_set_fd(fd, attr.namespace, attr.name, value, size);
|
|
||||||
+ }
|
|
||||||
+ return (res >= 0) ? 0 : -1;
|
|
||||||
+#else
|
|
||||||
+ errno = ENOSYS;
|
|
||||||
+ return -1;
|
|
||||||
+#endif
|
|
||||||
+}
|
|
||||||
+
|
|
||||||
+
|
|
||||||
+static int freebsd_connect(struct vfs_handle_struct *handle,
|
|
||||||
+ const char *service,
|
|
||||||
+ const char *user)
|
|
||||||
+{
|
|
||||||
+ struct freebsd_handle_data *data;
|
|
||||||
+ int enumval, saved_errno;
|
|
||||||
+
|
|
||||||
+ int ret = SMB_VFS_NEXT_CONNECT(handle, service, user);
|
|
||||||
+
|
|
||||||
+ if (ret < 0) {
|
|
||||||
+ return ret;
|
|
||||||
+ }
|
|
||||||
+
|
|
||||||
+ data = talloc_zero(handle->conn, struct freebsd_handle_data);
|
|
||||||
+ if (!data) {
|
|
||||||
+ saved_errno = errno;
|
|
||||||
+ SMB_VFS_NEXT_DISCONNECT(handle);
|
|
||||||
+ DEBUG(0, ("talloc_zero() failed\n"));
|
|
||||||
+ errno = saved_errno;
|
|
||||||
+ return -1;
|
|
||||||
+ }
|
|
||||||
+
|
|
||||||
+ enumval = lp_parm_enum(SNUM(handle->conn), "freebsd",
|
|
||||||
+ "extattr mode", extattr_mode_param, FREEBSD_EXTATTR_LEGACY);
|
|
||||||
+ if (enumval == -1) {
|
|
||||||
+ saved_errno = errno;
|
|
||||||
+ SMB_VFS_NEXT_DISCONNECT(handle);
|
|
||||||
+ DBG_DEBUG("value for freebsd: 'extattr mode' is unknown\n");
|
|
||||||
+ errno = saved_errno;
|
|
||||||
+ return -1;
|
|
||||||
+ }
|
|
||||||
+
|
|
||||||
+ if(freebsd_in_jail()) {
|
|
||||||
+ enumval = FREEBSD_EXTATTR_COMPAT;
|
|
||||||
+ DBG_WARNING("running in jail, enforcing 'compat' mode\n");
|
|
||||||
+ }
|
|
||||||
+
|
|
||||||
+ data->extattr_mode = (enum extattr_mode)enumval;
|
|
||||||
+
|
|
||||||
+ SMB_VFS_HANDLE_SET_DATA(handle, data, NULL,
|
|
||||||
+ struct freebsd_handle_data,
|
|
||||||
+ return -1);
|
|
||||||
+
|
|
||||||
+ DBG_DEBUG("connect to service[%s] with '%s' extattr mode\n",
|
|
||||||
+ service, extattr_mode_param[data->extattr_mode].name);
|
|
||||||
+
|
|
||||||
+ return 0;
|
|
||||||
+}
|
|
||||||
+
|
|
||||||
+
|
|
||||||
+static void freebsd_disconnect(vfs_handle_struct *handle)
|
|
||||||
+{
|
|
||||||
+ SMB_VFS_NEXT_DISCONNECT(handle);
|
|
||||||
+}
|
|
||||||
+
|
|
||||||
+/* VFS operations structure */
|
|
||||||
+
|
|
||||||
+struct vfs_fn_pointers freebsd_fns = {
|
|
||||||
+ /* Disk operations */
|
|
||||||
+ .connect_fn = freebsd_connect,
|
|
||||||
+ .disconnect_fn = freebsd_disconnect,
|
|
||||||
+
|
|
||||||
+ /* EA operations. */
|
|
||||||
+ .getxattrat_send_fn = vfs_not_implemented_getxattrat_send,
|
|
||||||
+ .getxattrat_recv_fn = vfs_not_implemented_getxattrat_recv,
|
|
||||||
+ .fgetxattr_fn = freebsd_fgetxattr,
|
|
||||||
+ .flistxattr_fn = freebsd_flistxattr,
|
|
||||||
+ .fremovexattr_fn = freebsd_fremovexattr,
|
|
||||||
+ .fsetxattr_fn = freebsd_fsetxattr,
|
|
||||||
+};
|
|
||||||
+
|
|
||||||
+static_decl_vfs;
|
|
||||||
+NTSTATUS vfs_freebsd_init(TALLOC_CTX *ctx)
|
|
||||||
+{
|
|
||||||
+ NTSTATUS ret;
|
|
||||||
+
|
|
||||||
+ ret = smb_register_vfs(SMB_VFS_INTERFACE_VERSION, "freebsd",
|
|
||||||
+ &freebsd_fns);
|
|
||||||
+
|
|
||||||
+ if (!NT_STATUS_IS_OK(ret)) {
|
|
||||||
+ return ret;
|
|
||||||
+ }
|
|
||||||
+
|
|
||||||
+ vfs_freebsd_debug_level = debug_add_class("freebsd");
|
|
||||||
+ if (vfs_freebsd_debug_level == -1) {
|
|
||||||
+ vfs_freebsd_debug_level = DBGC_VFS;
|
|
||||||
+ DEBUG(0, ("vfs_freebsd: Couldn't register custom debugging class!\n"));
|
|
||||||
+ } else {
|
|
||||||
+ DEBUG(10, ("vfs_freebsd: Debug class number of 'fileid': %d\n", vfs_freebsd_debug_level));
|
|
||||||
+ }
|
|
||||||
+
|
|
||||||
+ return ret;
|
|
||||||
+}
|
|
||||||
diff -Naurp a/source3/modules/wscript_build b/source3/modules/wscript_build
|
|
||||||
--- a/source3/modules/wscript_build 2024-02-02 04:33:51.236489800 -0500
|
|
||||||
+++ b/source3/modules/wscript_build 2024-08-05 13:57:36.247658000 -0400
|
|
||||||
@@ -631,6 +631,13 @@ bld.SAMBA3_MODULE('vfs_delay_inject',
|
|
||||||
enabled=bld.SAMBA3_IS_ENABLED_MODULE('vfs_delay_inject'),
|
|
||||||
install=False)
|
|
||||||
|
|
||||||
+bld.SAMBA3_MODULE('vfs_freebsd',
|
|
||||||
+ subsystem='vfs',
|
|
||||||
+ source='vfs_freebsd.c',
|
|
||||||
+ init_function='',
|
|
||||||
+ internal_module=bld.SAMBA3_IS_STATIC_MODULE('vfs_freebsd'),
|
|
||||||
+ enabled=bld.SAMBA3_IS_ENABLED_MODULE('vfs_freebsd'))
|
|
||||||
+
|
|
||||||
bld.SAMBA3_MODULE('vfs_widelinks',
|
|
||||||
subsystem='vfs',
|
|
||||||
source='vfs_widelinks.c',
|
|
||||||
@ -1,32 +0,0 @@
|
|||||||
--- a/samba-4.19.8/lib/replace/system/readline.h 2023-07-18 10:14:54.478091000 +0200
|
|
||||||
+++ b/lib/replace/system/readline.h 2024-10-02 13:47:48.773606000 +0200
|
|
||||||
@@ -46,10 +46,10 @@
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifdef HAVE_NEW_LIBREADLINE
|
|
||||||
-#ifdef HAVE_CPPFUNCTION
|
|
||||||
+#if defined(HAVE_RL_COMPLETION_FUNC_T)
|
|
||||||
+# define RL_COMPLETION_CAST (rl_completion_func_t *)
|
|
||||||
+#elif defined(HAVE_CPPFUNCTION)
|
|
||||||
# define RL_COMPLETION_CAST (CPPFunction *)
|
|
||||||
-#elif defined(HAVE_RL_COMPLETION_T)
|
|
||||||
-# define RL_COMPLETION_CAST (rl_completion_t *)
|
|
||||||
#else
|
|
||||||
# define RL_COMPLETION_CAST
|
|
||||||
#endif
|
|
||||||
diff -upr a/samba-4.19.8/libcli/smbreadline/wscript_configure b/libcli/smbreadline/wscript_configure
|
|
||||||
--- a/samba-4.19.8/libcli/smbreadline/wscript_configure 2023-07-18 10:14:54.558091600 +0200
|
|
||||||
+++ b/libcli/smbreadline/wscript_configure 2024-10-02 13:47:48.774008000 +0200
|
|
||||||
@@ -51,10 +51,10 @@ conf.CHECK_CODE('''
|
|
||||||
# endif
|
|
||||||
# endif
|
|
||||||
#endif
|
|
||||||
-int main(void) {rl_completion_t f; return 0;}
|
|
||||||
+int main(void) {rl_completion_func_t f; return 0;}
|
|
||||||
''',
|
|
||||||
'HAVE_RL_COMPLETION_FUNC_T', execute=False, addmain=False,
|
|
||||||
-msg='Checking for rl_completion_t')
|
|
||||||
+msg='Checking for rl_completion_func_t')
|
|
||||||
|
|
||||||
conf.CHECK_CODE('''
|
|
||||||
#ifdef HAVE_READLINE_READLINE_H
|
|
||||||
@ -1,121 +0,0 @@
|
|||||||
--- source3/lib/system.c.orig 2024-02-02 10:33:51.188489400 +0100
|
|
||||||
+++ source3/lib/system.c 2025-01-22 17:39:58.625028000 +0100
|
|
||||||
@@ -1047,22 +1047,108 @@
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
-bool sys_have_proc_fds(void)
|
|
||||||
+static bool freebsd_fdesc_check(const char *pattern)
|
|
||||||
{
|
|
||||||
- static bool checked = false;
|
|
||||||
- static bool have_proc_fds = false;
|
|
||||||
+ char fdesc_path[PATH_MAX];
|
|
||||||
+ int fd, fd2;
|
|
||||||
+
|
|
||||||
+ fd = open(lp_pid_directory(), O_DIRECTORY);
|
|
||||||
+ if (fd == -1) {
|
|
||||||
+ DBG_ERR("%s: failed to open pid directory: %s\n",
|
|
||||||
+ lp_pid_directory(), strerror(errno));
|
|
||||||
+ return false;
|
|
||||||
+ }
|
|
||||||
+
|
|
||||||
+ snprintf(fdesc_path, sizeof(fdesc_path), pattern, fd);
|
|
||||||
+
|
|
||||||
+ fd2 = open(fdesc_path, O_DIRECTORY);
|
|
||||||
+ if (fd2 == -1) {
|
|
||||||
+ /*
|
|
||||||
+ * Setting O_DIRECTORY on open of fdescfs mount
|
|
||||||
+ * without 'nodup' option will fail with ENOTDIR.
|
|
||||||
+ */
|
|
||||||
+ if (errno == ENOTDIR) {
|
|
||||||
+ DBG_ERR("%s: fdescfs filesystem is not mounted with "
|
|
||||||
+ "'nodup' option. This specific mount option is "
|
|
||||||
+ "required in order to enable race-free handling "
|
|
||||||
+ "of paths.\n"
|
|
||||||
+ "See documentation for Samba's New VFS' "
|
|
||||||
+ "for more details. The 'nodup' mount option was "
|
|
||||||
+ "introduced in FreeBSD 13.\n", fdesc_path);
|
|
||||||
+ close(fd);
|
|
||||||
+ return false;
|
|
||||||
+ }
|
|
||||||
+ DBG_ERR("%s: failed to open fdescfs path: %s\n",
|
|
||||||
+ fdesc_path, strerror(errno));
|
|
||||||
+ close(fd);
|
|
||||||
+ return false;
|
|
||||||
+ }
|
|
||||||
+ close(fd);
|
|
||||||
+ close(fd2);
|
|
||||||
+
|
|
||||||
+ return true;
|
|
||||||
+}
|
|
||||||
+
|
|
||||||
+static char* linux_pattern(char *buf, size_t bufsize)
|
|
||||||
+{
|
|
||||||
+ char proc_fd_path[PATH_MAX];
|
|
||||||
+ const char *pattern = "/proc/self/fd/%lu";
|
|
||||||
struct stat sb;
|
|
||||||
- int ret;
|
|
||||||
|
|
||||||
- if (checked) {
|
|
||||||
- return have_proc_fds;
|
|
||||||
+ snprintf(proc_fd_path, sizeof(proc_fd_path), pattern, 0);
|
|
||||||
+ if(stat(proc_fd_path, &sb) == 0) {
|
|
||||||
+ snprintf(buf, bufsize, "%s", pattern);
|
|
||||||
+ return buf;
|
|
||||||
}
|
|
||||||
+ return NULL;
|
|
||||||
+}
|
|
||||||
|
|
||||||
- ret = stat("/proc/self/fd/0", &sb);
|
|
||||||
- have_proc_fds = (ret == 0);
|
|
||||||
- checked = true;
|
|
||||||
+static char* freebsd_pattern(char *buf, size_t bufsize) {
|
|
||||||
+ const char** base;
|
|
||||||
+ const char* base_dir[] = {
|
|
||||||
+ lp_pid_directory(), /* This is a preferred location */
|
|
||||||
+ "/dev",
|
|
||||||
+ NULL
|
|
||||||
+ };
|
|
||||||
|
|
||||||
- return have_proc_fds;
|
|
||||||
+ for(base = &base_dir[0]; *base != NULL; base++) {
|
|
||||||
+ snprintf(buf, bufsize, "%s/fd/%%lu", *base);
|
|
||||||
+ if(freebsd_fdesc_check(buf)) {
|
|
||||||
+ return buf;
|
|
||||||
+ }
|
|
||||||
+ }
|
|
||||||
+ return NULL;
|
|
||||||
+}
|
|
||||||
+
|
|
||||||
+static char* (*proc_fd_patterns[])(char *, size_t) = {
|
|
||||||
+ linux_pattern,
|
|
||||||
+ freebsd_pattern,
|
|
||||||
+ NULL
|
|
||||||
+};
|
|
||||||
+
|
|
||||||
+static char proc_fd_pattern_buf[PATH_MAX];
|
|
||||||
+static const char *proc_fd_pattern = NULL;
|
|
||||||
+
|
|
||||||
+bool sys_have_proc_fds(void)
|
|
||||||
+{
|
|
||||||
+ static bool checked = false;
|
|
||||||
+ static bool have_proc_fds = false;
|
|
||||||
+ char* (**pattern_func)(char *, size_t) = NULL;
|
|
||||||
+
|
|
||||||
+ if (checked) {
|
|
||||||
+ return have_proc_fds;
|
|
||||||
+ }
|
|
||||||
+
|
|
||||||
+ for (pattern_func = &proc_fd_patterns[0]; *pattern_func != NULL; pattern_func++) {
|
|
||||||
+ if((*pattern_func)(proc_fd_pattern_buf, sizeof(proc_fd_pattern_buf)) != NULL) {
|
|
||||||
+ have_proc_fds = true;
|
|
||||||
+ proc_fd_pattern = proc_fd_pattern_buf;
|
|
||||||
+ break;
|
|
||||||
+ }
|
|
||||||
+ }
|
|
||||||
+
|
|
||||||
+ checked = true;
|
|
||||||
+ return have_proc_fds;
|
|
||||||
}
|
|
||||||
|
|
||||||
char *sys_proc_fd_path(int fd, struct sys_proc_fd_path_buf *buf)
|
|
||||||
@ -1,164 +0,0 @@
|
|||||||
From ff8b27f6f0c67cbb0fb37f80f3336c1bd0f28430 Mon Sep 17 00:00:00 2001
|
|
||||||
From: Andrew Walker <awalker@ixsystems.com>
|
|
||||||
Date: Thu, 16 Mar 2023 09:05:45 -0700
|
|
||||||
Subject: [PATCH] Fixups for VFS changes in 4.18
|
|
||||||
|
|
||||||
---
|
|
||||||
debian/changelog | 24 ++++++------------
|
|
||||||
lib/audit_logging/audit_logging.c | 4 +--
|
|
||||||
source3/modules/vfs_shadow_copy_zfs.c | 24 ++++++++----------
|
|
||||||
source3/modules/vfs_tmprotect.c | 2 +-
|
|
||||||
source3/modules/vfs_zfsacl.c | 35 +++++++++++++++++++++++++++
|
|
||||||
source3/utils/net_groupmap.c | 6 ++---
|
|
||||||
6 files changed, 58 insertions(+), 37 deletions(-)
|
|
||||||
|
|
||||||
diff --git a/source3/modules/vfs_zfsacl.c b/source3/modules/vfs_zfsacl.c
|
|
||||||
index e24cb683d2..18f8dcb4b2 100644
|
|
||||||
--- a/source3/modules/vfs_zfsacl.c
|
|
||||||
+++ b/source3/modules/vfs_zfsacl.c
|
|
||||||
@@ -307,6 +307,41 @@ static NTSTATUS zfs_set_nt_acl(vfs_handle_struct *handle, files_struct *fsp,
|
|
||||||
zfs_process_smbacl);
|
|
||||||
}
|
|
||||||
|
|
||||||
+static int get_zfsacl(TALLOC_CTX *mem_ctx,
|
|
||||||
+ const struct smb_filename *smb_fname,
|
|
||||||
+ ace_t **outbuf)
|
|
||||||
+{
|
|
||||||
+ int naces, rv;
|
|
||||||
+ ace_t *acebuf = NULL;
|
|
||||||
+
|
|
||||||
+ naces = acl(smb_fname->base_name, ACE_GETACLCNT, 0, NULL);
|
|
||||||
+ if (naces == -1) {
|
|
||||||
+ int dbg_level = 10;
|
|
||||||
+
|
|
||||||
+ if (errno == ENOSYS) {
|
|
||||||
+ dbg_level = 1;
|
|
||||||
+ }
|
|
||||||
+ DEBUG(dbg_level, ("acl(ACE_GETACLCNT, %s): %s ",
|
|
||||||
+ smb_fname->base_name, strerror(errno)));
|
|
||||||
+ return naces;
|
|
||||||
+ }
|
|
||||||
+ acebuf = talloc_size(mem_ctx, sizeof(ace_t)*naces);
|
|
||||||
+ if (acebuf == NULL) {
|
|
||||||
+ errno = ENOMEM;
|
|
||||||
+ return -1;
|
|
||||||
+ }
|
|
||||||
+
|
|
||||||
+ rv = acl(smb_fname->base_name, ACE_GETACL, naces, acebuf);
|
|
||||||
+ if (rv == -1) {
|
|
||||||
+ DBG_DEBUG("acl(ACE_GETACL, %s) failed: %s ",
|
|
||||||
+ smb_fname->base_name, strerror(errno));
|
|
||||||
+ return -1;
|
|
||||||
+ }
|
|
||||||
+
|
|
||||||
+ *outbuf = acebuf;
|
|
||||||
+ return naces;
|
|
||||||
+}
|
|
||||||
+
|
|
||||||
static int fget_zfsacl(TALLOC_CTX *mem_ctx,
|
|
||||||
struct files_struct *fsp,
|
|
||||||
ace_t **outbuf)
|
|
||||||
From 0c2c9f21cf01983d9001edef4983bc15b79a31ad Mon Sep 17 00:00:00 2001
|
|
||||||
From: Andrew <awalker@ixsystems.com>
|
|
||||||
Date: Mon, 29 Nov 2021 12:33:15 -0500
|
|
||||||
Subject: [PATCH] NAS-113538 / Fix procfd handling for xattr-based alternate
|
|
||||||
datastreams (#54)
|
|
||||||
|
|
||||||
vfs_streams_xattr openat() does not set fsp.flags.have_proc_fds. In open_streams_for_delete() the fsp is not allocated via talloc_zero() and so this may be unitialized memory.
|
|
||||||
|
|
||||||
This particular fix ensures vfs_streams_xattr sets the fsp have_proc_fds flag to the one defined in the associated tree connect for the fsp. In the case of vfs_ixnas, ensure that we read the NT ACL from fsp->base_fsp (file) rather than the fsp associated with the xattr.
|
|
||||||
|
|
||||||
This PR also fixes vfs_zfsacl for FreeBSD 13 (adding handling for procfd paths)
|
|
||||||
---
|
|
||||||
source3/modules/vfs_ixnas.c | 4 ++-
|
|
||||||
source3/modules/vfs_zfsacl.c | 62 ++++++++++++++++++++++++++++++++++++
|
|
||||||
2 files changed, 65 insertions(+), 1 deletion(-)
|
|
||||||
|
|
||||||
--- a/source3/modules/vfs_zfsacl.c
|
|
||||||
+++ b/source3/modules/vfs_zfsacl.c
|
|
||||||
@@ -235,12 +235,43 @@ static bool zfs_process_smbacl(vfs_handle_struct *handle, files_struct *fsp,
|
|
||||||
SMB_ASSERT(i == naces);
|
|
||||||
|
|
||||||
/* store acl */
|
|
||||||
+#ifdef O_PATH
|
|
||||||
+ if (fsp->fsp_flags.is_pathref) {
|
|
||||||
+ const char *proc_fd_path = NULL;
|
|
||||||
+ char buf[PATH_MAX];
|
|
||||||
+
|
|
||||||
+ if (!fsp->fsp_flags.have_proc_fds) {
|
|
||||||
+ DBG_ERR("fdescfs filesystem must be mounted with 'nodup' "
|
|
||||||
+ "option \n");
|
|
||||||
+ errno = EBADF;
|
|
||||||
+ return -1;
|
|
||||||
+ }
|
|
||||||
+
|
|
||||||
+ fd = fsp_get_pathref_fd(fsp);
|
|
||||||
+ proc_fd_path = sys_proc_fd_path(fd, buf, sizeof(buf));
|
|
||||||
+ if (proc_fd_path == NULL) {
|
|
||||||
+ DBG_ERR("%s: failed to generate pathref fd for %d\n",
|
|
||||||
+ fsp_str_dbg(fsp), fd);
|
|
||||||
+ errno = EBADF;
|
|
||||||
+ return -1;
|
|
||||||
+ }
|
|
||||||
+ rv = acl(proc_fd_path, ACE_SETACL, naces, acebuf);
|
|
||||||
+ } else {
|
|
||||||
+ fd = fsp_get_io_fd(fsp);
|
|
||||||
+ if (fd == -1) {
|
|
||||||
+ errno = EBADF;
|
|
||||||
+ return false;
|
|
||||||
+ }
|
|
||||||
+ rv = facl(fd, ACE_SETACL, naces, acebuf);
|
|
||||||
+ }
|
|
||||||
+#else
|
|
||||||
fd = fsp_get_pathref_fd(fsp);
|
|
||||||
if (fd == -1) {
|
|
||||||
errno = EBADF;
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
rv = facl(fd, ACE_SETACL, naces, acebuf);
|
|
||||||
+#endif
|
|
||||||
if (rv != 0) {
|
|
||||||
if(errno == ENOSYS) {
|
|
||||||
DEBUG(9, ("acl(ACE_SETACL, %s): Operation is not "
|
|
||||||
@@ -286,7 +317,38 @@ static int fget_zfsacl(TALLOC_CTX *mem_ctx,
|
|
||||||
ace_t *acebuf = NULL;
|
|
||||||
int fd;
|
|
||||||
|
|
||||||
+#ifdef O_PATH
|
|
||||||
+ if (fsp->fsp_flags.is_pathref) {
|
|
||||||
+ const char *proc_fd_path = NULL;
|
|
||||||
+ char buf[PATH_MAX];
|
|
||||||
+ struct smb_filename smb_fname;
|
|
||||||
+
|
|
||||||
+ if (!fsp->fsp_flags.have_proc_fds) {
|
|
||||||
+ DBG_ERR("fdescfs filesystem must be mounted with 'nodup' "
|
|
||||||
+ "option \n");
|
|
||||||
+ errno = EBADF;
|
|
||||||
+ return -1;
|
|
||||||
+ }
|
|
||||||
+
|
|
||||||
+ fd = fsp_get_pathref_fd(fsp);
|
|
||||||
+ proc_fd_path = sys_proc_fd_path(fd, buf, sizeof(buf));
|
|
||||||
+ if (proc_fd_path == NULL) {
|
|
||||||
+ DBG_ERR("%s: failed to generate pathref fd for %d\n",
|
|
||||||
+ fsp_str_dbg(fsp), fd);
|
|
||||||
+ errno = EBADF;
|
|
||||||
+ return -1;
|
|
||||||
+ }
|
|
||||||
+
|
|
||||||
+ smb_fname = (struct smb_filename) {
|
|
||||||
+ .base_name = discard_const_p(char, proc_fd_path)
|
|
||||||
+ };
|
|
||||||
+
|
|
||||||
+ return get_zfsacl(mem_ctx, &smb_fname, outbuf);
|
|
||||||
+ }
|
|
||||||
+ fd = fsp_get_io_fd(fsp);
|
|
||||||
+#else
|
|
||||||
fd = fsp_get_pathref_fd(fsp);
|
|
||||||
+#endif
|
|
||||||
if (fd == -1) {
|
|
||||||
errno = EBADF;
|
|
||||||
return -1;
|
|
||||||
--
|
|
||||||
2.43.0
|
|
||||||
|
|
||||||
@ -1,508 +0,0 @@
|
|||||||
https://bugzilla.samba.org/show_bug.cgi?id=15376
|
|
||||||
|
|
||||||
# 2024-08-05
|
|
||||||
# NOTE: Patch is partially split apart from the copy in net/samba419 due to Samba upstream
|
|
||||||
# making some Linux-specific changes. FreeBSD-specific linprocfs mount path bits are
|
|
||||||
# moved to a separate patch due to upstream hardcoding the Linux-specific procfs
|
|
||||||
# path in multiple places in commit 9f63fad392f3:
|
|
||||||
# https://git.samba.org/?p=samba.git;a=commitdiff;h=9f63fad392f3cff34d6a8e318e0427499170c417
|
|
||||||
|
|
||||||
diff -Naurp a/source3/include/proto.h b/source3/include/proto.h
|
|
||||||
--- a/source3/include/proto.h 2024-02-02 04:33:51.168489200 -0500
|
|
||||||
+++ b/source3/include/proto.h 2024-08-05 21:25:56.723092000 -0400
|
|
||||||
@@ -211,6 +211,10 @@ char *sys_proc_fd_path(int fd, struct sys_proc_fd_path
|
|
||||||
bool sys_have_proc_fds(void);
|
|
||||||
char *sys_proc_fd_path(int fd, struct sys_proc_fd_path_buf *buf);
|
|
||||||
|
|
||||||
+int sys_open_real_fd_from_pathref_fd(int fd,
|
|
||||||
+ int *mfd,
|
|
||||||
+ int flags);
|
|
||||||
+
|
|
||||||
struct stat;
|
|
||||||
void init_stat_ex_from_stat (struct stat_ex *dst,
|
|
||||||
const struct stat *src,
|
|
||||||
diff -Naurp a/source3/lib/system.c b/source3/lib/system.c
|
|
||||||
--- a/source3/lib/system.c 2024-02-02 04:33:51.188489400 -0500
|
|
||||||
+++ b/source3/lib/system.c 2024-08-05 21:25:56.723571000 -0400
|
|
||||||
@@ -1074,3 +1074,23 @@ char *sys_proc_fd_path(int fd, struct sys_proc_fd_path
|
|
||||||
|
|
||||||
return buf->buf;
|
|
||||||
}
|
|
||||||
+
|
|
||||||
+/* Helper function that opens a usable fd for accessing data
|
|
||||||
+ (metadata & content) from a pathref fd */
|
|
||||||
+int sys_open_real_fd_from_pathref_fd(int fd, int *rfd, int flags)
|
|
||||||
+{
|
|
||||||
+ int tfd;
|
|
||||||
+
|
|
||||||
+#if defined(HAVE_OPENAT) && defined(O_EMPTY_PATH)
|
|
||||||
+ /* This works for FreeBSD 13+ atleast */
|
|
||||||
+ tfd = openat(fd, "", O_EMPTY_PATH|flags);
|
|
||||||
+ if (tfd < 0) {
|
|
||||||
+ return errno;
|
|
||||||
+ }
|
|
||||||
+
|
|
||||||
+ *rfd = tfd;
|
|
||||||
+ return 0;
|
|
||||||
+#else
|
|
||||||
+ return ENOSYS;
|
|
||||||
+#endif
|
|
||||||
+}
|
|
||||||
diff -Naurp a/source3/modules/vfs_default.c b/source3/modules/vfs_default.c
|
|
||||||
--- a/source3/modules/vfs_default.c 2024-08-02 07:54:09.629892300 -0400
|
|
||||||
+++ b/source3/modules/vfs_default.c 2024-08-05 21:25:56.724593000 -0400
|
|
||||||
@@ -2688,7 +2688,7 @@ static int vfswrap_fchmod(vfs_handle_struct *handle, f
|
|
||||||
|
|
||||||
static int vfswrap_fchmod(vfs_handle_struct *handle, files_struct *fsp, mode_t mode)
|
|
||||||
{
|
|
||||||
- int result;
|
|
||||||
+ int result, fd, real_fd;
|
|
||||||
|
|
||||||
START_PROFILE(syscall_fchmod);
|
|
||||||
|
|
||||||
@@ -2698,8 +2698,9 @@ static int vfswrap_fchmod(vfs_handle_struct *handle, f
|
|
||||||
return result;
|
|
||||||
}
|
|
||||||
|
|
||||||
+ fd = fsp_get_pathref_fd(fsp);
|
|
||||||
+
|
|
||||||
if (fsp->fsp_flags.have_proc_fds) {
|
|
||||||
- int fd = fsp_get_pathref_fd(fsp);
|
|
||||||
struct sys_proc_fd_path_buf buf;
|
|
||||||
|
|
||||||
result = chmod(sys_proc_fd_path(fd, &buf), mode);
|
|
||||||
@@ -2708,6 +2709,17 @@ static int vfswrap_fchmod(vfs_handle_struct *handle, f
|
|
||||||
return result;
|
|
||||||
}
|
|
||||||
|
|
||||||
+ if (sys_open_real_fd_from_pathref_fd(fd, &real_fd, O_RDONLY|O_NONBLOCK) == 0) {
|
|
||||||
+ int saved_errno;
|
|
||||||
+
|
|
||||||
+ result = fchmod(real_fd, mode);
|
|
||||||
+ saved_errno = errno;
|
|
||||||
+ close(real_fd);
|
|
||||||
+ errno = saved_errno;
|
|
||||||
+ END_PROFILE(syscall_fchmod);
|
|
||||||
+ return result;
|
|
||||||
+ }
|
|
||||||
+
|
|
||||||
/*
|
|
||||||
* This is no longer a handle based call.
|
|
||||||
*/
|
|
||||||
@@ -2720,7 +2732,7 @@ static int vfswrap_fchown(vfs_handle_struct *handle, f
|
|
||||||
static int vfswrap_fchown(vfs_handle_struct *handle, files_struct *fsp, uid_t uid, gid_t gid)
|
|
||||||
{
|
|
||||||
#ifdef HAVE_FCHOWN
|
|
||||||
- int result;
|
|
||||||
+ int result, fd, real_fd;
|
|
||||||
|
|
||||||
START_PROFILE(syscall_fchown);
|
|
||||||
if (!fsp->fsp_flags.is_pathref) {
|
|
||||||
@@ -2729,8 +2741,9 @@ static int vfswrap_fchown(vfs_handle_struct *handle, f
|
|
||||||
return result;
|
|
||||||
}
|
|
||||||
|
|
||||||
+ fd = fsp_get_pathref_fd(fsp);
|
|
||||||
+
|
|
||||||
if (fsp->fsp_flags.have_proc_fds) {
|
|
||||||
- int fd = fsp_get_pathref_fd(fsp);
|
|
||||||
struct sys_proc_fd_path_buf buf;
|
|
||||||
|
|
||||||
result = chown(sys_proc_fd_path(fd, &buf), uid, gid);
|
|
||||||
@@ -2739,6 +2752,17 @@ static int vfswrap_fchown(vfs_handle_struct *handle, f
|
|
||||||
return result;
|
|
||||||
}
|
|
||||||
|
|
||||||
+ if (sys_open_real_fd_from_pathref_fd(fd, &real_fd, O_RDONLY|O_NONBLOCK) == 0) {
|
|
||||||
+ int saved_errno;
|
|
||||||
+
|
|
||||||
+ result = fchown(real_fd, uid, gid);
|
|
||||||
+ saved_errno = errno;
|
|
||||||
+ close(real_fd);
|
|
||||||
+ errno = saved_errno;
|
|
||||||
+ END_PROFILE(syscall_fchown);
|
|
||||||
+ return result;
|
|
||||||
+ }
|
|
||||||
+
|
|
||||||
/*
|
|
||||||
* This is no longer a handle based call.
|
|
||||||
*/
|
|
||||||
@@ -2812,7 +2836,7 @@ static int vfswrap_fntimes(vfs_handle_struct *handle,
|
|
||||||
files_struct *fsp,
|
|
||||||
struct smb_file_time *ft)
|
|
||||||
{
|
|
||||||
- int result = -1;
|
|
||||||
+ int result = -1, fd, real_fd;
|
|
||||||
struct timespec ts[2];
|
|
||||||
struct timespec *times = NULL;
|
|
||||||
|
|
||||||
@@ -2857,8 +2881,9 @@ static int vfswrap_fntimes(vfs_handle_struct *handle,
|
|
||||||
goto out;
|
|
||||||
}
|
|
||||||
|
|
||||||
+ fd = fsp_get_pathref_fd(fsp);
|
|
||||||
+
|
|
||||||
if (fsp->fsp_flags.have_proc_fds) {
|
|
||||||
- int fd = fsp_get_pathref_fd(fsp);
|
|
||||||
struct sys_proc_fd_path_buf buf;
|
|
||||||
|
|
||||||
result = utimensat(AT_FDCWD,
|
|
||||||
@@ -2869,6 +2894,16 @@ static int vfswrap_fntimes(vfs_handle_struct *handle,
|
|
||||||
goto out;
|
|
||||||
}
|
|
||||||
|
|
||||||
+ if (sys_open_real_fd_from_pathref_fd(fd, &real_fd, O_RDONLY|O_NONBLOCK) == 0) {
|
|
||||||
+ int saved_errno;
|
|
||||||
+
|
|
||||||
+ result = futimens(real_fd, times);
|
|
||||||
+ saved_errno = errno;
|
|
||||||
+ close(real_fd);
|
|
||||||
+ errno = saved_errno;
|
|
||||||
+ goto out;
|
|
||||||
+ }
|
|
||||||
+
|
|
||||||
/*
|
|
||||||
* The fd is a pathref (opened with O_PATH) and there isn't fd to
|
|
||||||
* path translation mechanism. Fallback to path based call.
|
|
||||||
@@ -3272,6 +3307,7 @@ static int vfswrap_fchflags(vfs_handle_struct *handle,
|
|
||||||
{
|
|
||||||
#ifdef HAVE_FCHFLAGS
|
|
||||||
int fd = fsp_get_pathref_fd(fsp);
|
|
||||||
+ int real_fd;
|
|
||||||
|
|
||||||
SMB_ASSERT(!fsp_is_alternate_stream(fsp));
|
|
||||||
|
|
||||||
@@ -3285,6 +3321,16 @@ static int vfswrap_fchflags(vfs_handle_struct *handle,
|
|
||||||
return chflags(sys_proc_fd_path(fd, &buf), flags);
|
|
||||||
}
|
|
||||||
|
|
||||||
+ if (sys_open_real_fd_from_pathref_fd(fd, &real_fd, O_RDONLY|O_NONBLOCK) == 0) {
|
|
||||||
+ int saved_errno, result;
|
|
||||||
+
|
|
||||||
+ result = fchflags(real_fd, flags);
|
|
||||||
+ saved_errno = errno;
|
|
||||||
+ close(real_fd);
|
|
||||||
+ errno = saved_errno;
|
|
||||||
+ return result;
|
|
||||||
+ }
|
|
||||||
+
|
|
||||||
/*
|
|
||||||
* This is no longer a handle based call.
|
|
||||||
*/
|
|
||||||
@@ -3513,6 +3559,7 @@ static ssize_t vfswrap_fgetxattr(struct vfs_handle_str
|
|
||||||
size_t size)
|
|
||||||
{
|
|
||||||
int fd = fsp_get_pathref_fd(fsp);
|
|
||||||
+ int real_fd;
|
|
||||||
|
|
||||||
SMB_ASSERT(!fsp_is_alternate_stream(fsp));
|
|
||||||
|
|
||||||
@@ -3526,6 +3573,16 @@ static ssize_t vfswrap_fgetxattr(struct vfs_handle_str
|
|
||||||
return getxattr(sys_proc_fd_path(fd, &buf), name, value, size);
|
|
||||||
}
|
|
||||||
|
|
||||||
+ if (sys_open_real_fd_from_pathref_fd(fd, &real_fd, O_RDONLY|O_NONBLOCK) == 0) {
|
|
||||||
+ int saved_errno, result;
|
|
||||||
+
|
|
||||||
+ result = fgetxattr(real_fd, name, value, size);
|
|
||||||
+ saved_errno = errno;
|
|
||||||
+ close(real_fd);
|
|
||||||
+ errno = saved_errno;
|
|
||||||
+ return result;
|
|
||||||
+ }
|
|
||||||
+
|
|
||||||
/*
|
|
||||||
* This is no longer a handle based call.
|
|
||||||
*/
|
|
||||||
@@ -3833,6 +3890,7 @@ static ssize_t vfswrap_flistxattr(struct vfs_handle_st
|
|
||||||
static ssize_t vfswrap_flistxattr(struct vfs_handle_struct *handle, struct files_struct *fsp, char *list, size_t size)
|
|
||||||
{
|
|
||||||
int fd = fsp_get_pathref_fd(fsp);
|
|
||||||
+ int real_fd;
|
|
||||||
|
|
||||||
SMB_ASSERT(!fsp_is_alternate_stream(fsp));
|
|
||||||
|
|
||||||
@@ -3846,6 +3904,16 @@ static ssize_t vfswrap_flistxattr(struct vfs_handle_st
|
|
||||||
return listxattr(sys_proc_fd_path(fd, &buf), list, size);
|
|
||||||
}
|
|
||||||
|
|
||||||
+ if (sys_open_real_fd_from_pathref_fd(fd, &real_fd, O_RDONLY|O_NONBLOCK) == 0) {
|
|
||||||
+ int saved_errno, result;
|
|
||||||
+
|
|
||||||
+ result = flistxattr(real_fd, list, size);
|
|
||||||
+ saved_errno = errno;
|
|
||||||
+ close(real_fd);
|
|
||||||
+ errno = saved_errno;
|
|
||||||
+ return result;
|
|
||||||
+ }
|
|
||||||
+
|
|
||||||
/*
|
|
||||||
* This is no longer a handle based call.
|
|
||||||
*/
|
|
||||||
@@ -3855,6 +3923,7 @@ static int vfswrap_fremovexattr(struct vfs_handle_stru
|
|
||||||
static int vfswrap_fremovexattr(struct vfs_handle_struct *handle, struct files_struct *fsp, const char *name)
|
|
||||||
{
|
|
||||||
int fd = fsp_get_pathref_fd(fsp);
|
|
||||||
+ int real_fd;
|
|
||||||
|
|
||||||
SMB_ASSERT(!fsp_is_alternate_stream(fsp));
|
|
||||||
|
|
||||||
@@ -3868,6 +3937,16 @@ static int vfswrap_fremovexattr(struct vfs_handle_stru
|
|
||||||
return removexattr(sys_proc_fd_path(fd, &buf), name);
|
|
||||||
}
|
|
||||||
|
|
||||||
+ if (sys_open_real_fd_from_pathref_fd(fd, &real_fd, O_RDONLY|O_NONBLOCK) == 0) {
|
|
||||||
+ int saved_errno, result;
|
|
||||||
+
|
|
||||||
+ result = fremovexattr(real_fd, name);
|
|
||||||
+ saved_errno = errno;
|
|
||||||
+ close(real_fd);
|
|
||||||
+ errno = saved_errno;
|
|
||||||
+ return result;
|
|
||||||
+ }
|
|
||||||
+
|
|
||||||
/*
|
|
||||||
* This is no longer a handle based call.
|
|
||||||
*/
|
|
||||||
@@ -3877,6 +3956,7 @@ static int vfswrap_fsetxattr(struct vfs_handle_struct
|
|
||||||
static int vfswrap_fsetxattr(struct vfs_handle_struct *handle, struct files_struct *fsp, const char *name, const void *value, size_t size, int flags)
|
|
||||||
{
|
|
||||||
int fd = fsp_get_pathref_fd(fsp);
|
|
||||||
+ int real_fd;
|
|
||||||
|
|
||||||
SMB_ASSERT(!fsp_is_alternate_stream(fsp));
|
|
||||||
|
|
||||||
@@ -3892,6 +3972,16 @@ static int vfswrap_fsetxattr(struct vfs_handle_struct
|
|
||||||
value,
|
|
||||||
size,
|
|
||||||
flags);
|
|
||||||
+ }
|
|
||||||
+
|
|
||||||
+ if (sys_open_real_fd_from_pathref_fd(fd, &real_fd, O_RDONLY|O_NONBLOCK) == 0) {
|
|
||||||
+ int saved_errno, result;
|
|
||||||
+
|
|
||||||
+ result = fsetxattr(real_fd, name, value, size, flags);
|
|
||||||
+ saved_errno = errno;
|
|
||||||
+ close(real_fd);
|
|
||||||
+ errno = saved_errno;
|
|
||||||
+ return result;
|
|
||||||
}
|
|
||||||
|
|
||||||
/*
|
|
||||||
diff -Naurp a/source3/modules/vfs_zfsacl.c b/source3/modules/vfs_zfsacl.c
|
|
||||||
--- a/source3/modules/vfs_zfsacl.c 2024-02-02 04:33:51.236489800 -0500
|
|
||||||
+++ b/source3/modules/vfs_zfsacl.c 2024-08-05 21:25:56.724941000 -0400
|
|
||||||
@@ -234,13 +234,39 @@ static bool zfs_process_smbacl(vfs_handle_struct *hand
|
|
||||||
|
|
||||||
SMB_ASSERT(i == naces);
|
|
||||||
|
|
||||||
- /* store acl */
|
|
||||||
- fd = fsp_get_pathref_fd(fsp);
|
|
||||||
- if (fd == -1) {
|
|
||||||
- errno = EBADF;
|
|
||||||
- return false;
|
|
||||||
+ if (!fsp->fsp_flags.is_pathref) {
|
|
||||||
+ rv = facl(fsp_get_io_fd(fsp), ACE_SETACL, naces, acebuf);
|
|
||||||
+ } else {
|
|
||||||
+ const char *procfd_p = NULL;
|
|
||||||
+ char buf[PATH_MAX];
|
|
||||||
+
|
|
||||||
+ fd = fsp_get_pathref_fd(fsp);
|
|
||||||
+ if (fsp->fsp_flags.have_proc_fds && (procfd_p = sys_proc_fd_path(fd, &buf))) {
|
|
||||||
+ rv = acl(procfd_p, ACE_SETACL, naces, acebuf);
|
|
||||||
+ } else {
|
|
||||||
+ int real_fd;
|
|
||||||
+
|
|
||||||
+ fd = fsp_get_pathref_fd(fsp);
|
|
||||||
+
|
|
||||||
+ /* First try this for versions of FreeBSD 13+ that allows facl() on O_PATH fd's */
|
|
||||||
+ rv = facl(fd, ACE_SETACL, naces, acebuf);
|
|
||||||
+
|
|
||||||
+ if (rv < 0 && errno == EBADF &&
|
|
||||||
+ sys_open_real_fd_from_pathref_fd(fd, &real_fd, O_RDONLY|O_NONBLOCK) == 0) {
|
|
||||||
+ /* Works on FreeBSD 13+ */
|
|
||||||
+ int saved_errno;
|
|
||||||
+
|
|
||||||
+ rv = facl(real_fd, ACE_SETACL, naces, acebuf);
|
|
||||||
+ saved_errno = errno;
|
|
||||||
+ close(real_fd);
|
|
||||||
+ errno = saved_errno;
|
|
||||||
+ } else {
|
|
||||||
+ /* Last ditch fallback */
|
|
||||||
+ rv = acl(fsp->fsp_name->base_name, ACE_SETACL, naces, acebuf);
|
|
||||||
+ }
|
|
||||||
+ }
|
|
||||||
}
|
|
||||||
- rv = facl(fd, ACE_SETACL, naces, acebuf);
|
|
||||||
+
|
|
||||||
if (rv != 0) {
|
|
||||||
if(errno == ENOSYS) {
|
|
||||||
DEBUG(9, ("acl(ACE_SETACL, %s): Operation is not "
|
|
||||||
@@ -284,14 +310,39 @@ static int fget_zfsacl(TALLOC_CTX *mem_ctx,
|
|
||||||
{
|
|
||||||
int naces, rv;
|
|
||||||
ace_t *acebuf = NULL;
|
|
||||||
- int fd;
|
|
||||||
+ int fd = -1;
|
|
||||||
+ const char *procfd_p = NULL;
|
|
||||||
+ char buf[PATH_MAX];
|
|
||||||
|
|
||||||
- fd = fsp_get_pathref_fd(fsp);
|
|
||||||
- if (fd == -1) {
|
|
||||||
- errno = EBADF;
|
|
||||||
- return -1;
|
|
||||||
+ if (!fsp->fsp_flags.is_pathref) {
|
|
||||||
+ naces = facl(fsp_get_io_fd(fsp), ACE_GETACLCNT, 0, NULL);
|
|
||||||
+ } else {
|
|
||||||
+ fd = fsp_get_pathref_fd(fsp);
|
|
||||||
+
|
|
||||||
+ if (fsp->fsp_flags.have_proc_fds && (procfd_p = sys_proc_fd_path(fd, &buf))) {
|
|
||||||
+ /* If we have procfd support, try this first */
|
|
||||||
+ naces = acl(procfd_p, ACE_GETACLCNT, 0, NULL);
|
|
||||||
+ } else {
|
|
||||||
+ int real_fd;
|
|
||||||
+
|
|
||||||
+ /* First try this for versions of FreeBSD 13+ that allows facl() on O_PATH fd's */
|
|
||||||
+ naces = facl(fd, ACE_GETACLCNT, 0, NULL);
|
|
||||||
+ if (naces < 0 && errno == EBADF &&
|
|
||||||
+ sys_open_real_fd_from_pathref_fd(fd, &real_fd, O_RDONLY|O_NONBLOCK) == 0) {
|
|
||||||
+ /* Works on FreeBSD 13+ */
|
|
||||||
+ int saved_errno;
|
|
||||||
+
|
|
||||||
+ naces = facl(real_fd, ACE_GETACLCNT, 0, NULL);
|
|
||||||
+ saved_errno = errno;
|
|
||||||
+ close(real_fd);
|
|
||||||
+ errno = saved_errno;
|
|
||||||
+ } else {
|
|
||||||
+ /* Last ditch fallback */
|
|
||||||
+ naces = acl(fsp->fsp_name->base_name, ACE_GETACLCNT, 0, NULL);
|
|
||||||
+ }
|
|
||||||
+ }
|
|
||||||
}
|
|
||||||
- naces = facl(fd, ACE_GETACLCNT, 0, NULL);
|
|
||||||
+
|
|
||||||
if (naces == -1) {
|
|
||||||
int dbg_level = 10;
|
|
||||||
|
|
||||||
@@ -309,7 +360,32 @@ static int fget_zfsacl(TALLOC_CTX *mem_ctx,
|
|
||||||
return -1;
|
|
||||||
}
|
|
||||||
|
|
||||||
- rv = facl(fd, ACE_GETACL, naces, acebuf);
|
|
||||||
+ if (!fsp->fsp_flags.is_pathref) {
|
|
||||||
+ rv = facl(fsp_get_io_fd(fsp), ACE_GETACL, naces, acebuf);
|
|
||||||
+ } else {
|
|
||||||
+ if (procfd_p) {
|
|
||||||
+ rv = acl(procfd_p, ACE_GETACL, naces, acebuf);
|
|
||||||
+ } else {
|
|
||||||
+ int real_fd;
|
|
||||||
+
|
|
||||||
+ /* First try this for versions of FreeBSD that allows facl() on O_PATH fd's */
|
|
||||||
+ rv = facl(fd, ACE_GETACL, naces, acebuf);
|
|
||||||
+ if (rv < 0 && errno == EBADF &&
|
|
||||||
+ sys_open_real_fd_from_pathref_fd(fd, &real_fd, O_RDONLY|O_NONBLOCK) == 0) {
|
|
||||||
+ /* Works on FreeBSD 13+ */
|
|
||||||
+ int saved_errno;
|
|
||||||
+
|
|
||||||
+ rv = facl(real_fd, ACE_GETACL, naces, acebuf);
|
|
||||||
+ saved_errno = errno;
|
|
||||||
+ close(real_fd);
|
|
||||||
+ errno = saved_errno;
|
|
||||||
+ } else {
|
|
||||||
+ /* Last ditch fallback */
|
|
||||||
+ rv = acl(fsp->fsp_name->base_name, ACE_GETACL, naces, acebuf);
|
|
||||||
+ }
|
|
||||||
+ }
|
|
||||||
+ }
|
|
||||||
+
|
|
||||||
if (rv == -1) {
|
|
||||||
DBG_DEBUG("acl(ACE_GETACL, %s): %s\n",
|
|
||||||
fsp_str_dbg(fsp), strerror(errno));
|
|
||||||
diff -Naurp a/source3/smbd/open.c b/source3/smbd/open.c
|
|
||||||
--- a/source3/smbd/open.c 2024-08-02 07:54:09.637892500 -0400
|
|
||||||
+++ b/source3/smbd/open.c 2024-08-05 21:27:26.052148000 -0400
|
|
||||||
@@ -1165,47 +1165,52 @@ static NTSTATUS reopen_from_fsp(struct files_struct *d
|
|
||||||
bool *p_file_created)
|
|
||||||
{
|
|
||||||
NTSTATUS status;
|
|
||||||
+ int new_fd;
|
|
||||||
int old_fd;
|
|
||||||
|
|
||||||
- if (fsp->fsp_flags.have_proc_fds &&
|
|
||||||
- ((old_fd = fsp_get_pathref_fd(fsp)) != -1)) {
|
|
||||||
+ old_fd = fsp_get_pathref_fd(fsp);
|
|
||||||
+ if (old_fd == -1) {
|
|
||||||
+ return NT_STATUS_MORE_PROCESSING_REQUIRED;
|
|
||||||
+ }
|
|
||||||
|
|
||||||
- struct sys_proc_fd_path_buf buf;
|
|
||||||
- struct smb_filename proc_fname = (struct smb_filename){
|
|
||||||
- .base_name = sys_proc_fd_path(old_fd, &buf),
|
|
||||||
- };
|
|
||||||
- mode_t mode = fsp->fsp_name->st.st_ex_mode;
|
|
||||||
- int new_fd;
|
|
||||||
+ if (sys_open_real_fd_from_pathref_fd(old_fd, &new_fd, how->flags) != 0) {
|
|
||||||
+ if (fsp->fsp_flags.have_proc_fds) {
|
|
||||||
+ struct sys_proc_fd_path_buf buf;
|
|
||||||
+ struct smb_filename proc_fname = (struct smb_filename){
|
|
||||||
+ .base_name = sys_proc_fd_path(old_fd, &buf),
|
|
||||||
+ };
|
|
||||||
+ mode_t mode = fsp->fsp_name->st.st_ex_mode;
|
|
||||||
|
|
||||||
- SMB_ASSERT(fsp->fsp_flags.is_pathref);
|
|
||||||
+ SMB_ASSERT(fsp->fsp_flags.is_pathref);
|
|
||||||
|
|
||||||
- if (S_ISLNK(mode)) {
|
|
||||||
- return NT_STATUS_STOPPED_ON_SYMLINK;
|
|
||||||
- }
|
|
||||||
- if (!(S_ISREG(mode) || S_ISDIR(mode))) {
|
|
||||||
- return NT_STATUS_IO_REPARSE_TAG_NOT_HANDLED;
|
|
||||||
- }
|
|
||||||
+ if (S_ISLNK(mode)) {
|
|
||||||
+ return NT_STATUS_STOPPED_ON_SYMLINK;
|
|
||||||
+ }
|
|
||||||
+ if (!(S_ISREG(mode) || S_ISDIR(mode))) {
|
|
||||||
+ return NT_STATUS_IO_REPARSE_TAG_NOT_HANDLED;
|
|
||||||
+ }
|
|
||||||
|
|
||||||
- fsp->fsp_flags.is_pathref = false;
|
|
||||||
+ new_fd = SMB_VFS_OPENAT(fsp->conn,
|
|
||||||
+ fsp->conn->cwd_fsp,
|
|
||||||
+ &proc_fname,
|
|
||||||
+ fsp,
|
|
||||||
+ how);
|
|
||||||
+ if (new_fd == -1) {
|
|
||||||
+ status = map_nt_error_from_unix(errno);
|
|
||||||
+ fd_close(fsp);
|
|
||||||
+ return status;
|
|
||||||
+ }
|
|
||||||
|
|
||||||
- new_fd = SMB_VFS_OPENAT(fsp->conn,
|
|
||||||
- fsp->conn->cwd_fsp,
|
|
||||||
- &proc_fname,
|
|
||||||
- fsp,
|
|
||||||
- how);
|
|
||||||
- if (new_fd == -1) {
|
|
||||||
- status = map_nt_error_from_unix(errno);
|
|
||||||
- fd_close(fsp);
|
|
||||||
- return status;
|
|
||||||
- }
|
|
||||||
+ status = fd_close(fsp);
|
|
||||||
+ if (!NT_STATUS_IS_OK(status)) {
|
|
||||||
+ return status;
|
|
||||||
+ }
|
|
||||||
|
|
||||||
- status = fd_close(fsp);
|
|
||||||
- if (!NT_STATUS_IS_OK(status)) {
|
|
||||||
- return status;
|
|
||||||
- }
|
|
||||||
+ fsp_set_fd(fsp, new_fd);
|
|
||||||
+ fsp->fsp_flags.is_pathref = false;
|
|
||||||
|
|
||||||
- fsp_set_fd(fsp, new_fd);
|
|
||||||
- return NT_STATUS_OK;
|
|
||||||
+ return NT_STATUS_OK;
|
|
||||||
+ }
|
|
||||||
}
|
|
||||||
|
|
||||||
/*
|
|
||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user