svn commit: r531474 - in head/net: . samba411 samba411/files samba411/files/man
Timur I. Bakeyev
timur at FreeBSD.org
Sun Apr 12 02:00:36 UTC 2020
Author: timur
Date: Sun Apr 12 02:00:35 2020
New Revision: 531474
URL: https://svnweb.freebsd.org/changeset/ports/531474
Log:
Add new Samba 4.11 port
Added:
head/net/samba411/
head/net/samba411/Makefile (contents, props changed)
head/net/samba411/distinfo (contents, props changed)
head/net/samba411/files/
head/net/samba411/files/0001-Zfs-provision-1.patch (contents, props changed)
head/net/samba411/files/README.FreeBSD.in (contents, props changed)
head/net/samba411/files/man/
head/net/samba411/files/man/ctdb-script.options.5 (contents, props changed)
head/net/samba411/files/man/ctdb-statistics.7 (contents, props changed)
head/net/samba411/files/man/ctdb-tunables.7 (contents, props changed)
head/net/samba411/files/man/ctdb.1 (contents, props changed)
head/net/samba411/files/man/ctdb.7 (contents, props changed)
head/net/samba411/files/man/ctdb.conf.5 (contents, props changed)
head/net/samba411/files/man/ctdb.sysconfig.5 (contents, props changed)
head/net/samba411/files/man/ctdb_diagnostics.1 (contents, props changed)
head/net/samba411/files/man/ctdbd.1 (contents, props changed)
head/net/samba411/files/man/ctdbd_wrapper.1 (contents, props changed)
head/net/samba411/files/man/gentest.1 (contents, props changed)
head/net/samba411/files/man/ldbadd.1 (contents, props changed)
head/net/samba411/files/man/ldbdel.1 (contents, props changed)
head/net/samba411/files/man/ldbedit.1 (contents, props changed)
head/net/samba411/files/man/ldbmodify.1 (contents, props changed)
head/net/samba411/files/man/ldbrename.1 (contents, props changed)
head/net/samba411/files/man/ldbsearch.1 (contents, props changed)
head/net/samba411/files/man/locktest.1 (contents, props changed)
head/net/samba411/files/man/ltdbtool.1 (contents, props changed)
head/net/samba411/files/man/masktest.1 (contents, props changed)
head/net/samba411/files/man/ndrdump.1 (contents, props changed)
head/net/samba411/files/man/nmblookup4.1 (contents, props changed)
head/net/samba411/files/man/ntlm_auth4.1 (contents, props changed)
head/net/samba411/files/man/oLschema2ldif.1 (contents, props changed)
head/net/samba411/files/man/onnode.1 (contents, props changed)
head/net/samba411/files/man/ping_pong.1 (contents, props changed)
head/net/samba411/files/man/regdiff.1 (contents, props changed)
head/net/samba411/files/man/regpatch.1 (contents, props changed)
head/net/samba411/files/man/regshell.1 (contents, props changed)
head/net/samba411/files/man/regtree.1 (contents, props changed)
head/net/samba411/files/man/samba-gpupdate.8 (contents, props changed)
head/net/samba411/files/man/smbtorture.1 (contents, props changed)
head/net/samba411/files/man/talloc.3 (contents, props changed)
head/net/samba411/files/man/tdbbackup.8 (contents, props changed)
head/net/samba411/files/man/tdbdump.8 (contents, props changed)
head/net/samba411/files/man/tdbrestore.8 (contents, props changed)
head/net/samba411/files/man/tdbtool.8 (contents, props changed)
head/net/samba411/files/man/vfs_freebsd.8 (contents, props changed)
head/net/samba411/files/patch-bind (contents, props changed)
head/net/samba411/files/patch-buildtools_scripts_abi__gen.sh (contents, props changed)
head/net/samba411/files/patch-buildtools_wafsamba_samba__autoconf.py (contents, props changed)
head/net/samba411/files/patch-buildtools_wafsamba_samba__install.py (contents, props changed)
head/net/samba411/files/patch-buildtools_wafsamba_wafsamba.py (contents, props changed)
head/net/samba411/files/patch-buildtools_wafsamba_wscript (contents, props changed)
head/net/samba411/files/patch-ctdb_wscript (contents, props changed)
head/net/samba411/files/patch-dwrap (contents, props changed)
head/net/samba411/files/patch-dynconfig_wscript (contents, props changed)
head/net/samba411/files/patch-examples_pdb_wscript__build (contents, props changed)
head/net/samba411/files/patch-lib_ldb_ldb__key__value_ldb__kv__cache.c (contents, props changed)
head/net/samba411/files/patch-lib_ldb_ldb__mdb_ldb__mdb.c (contents, props changed)
head/net/samba411/files/patch-lib_ldb_wscript (contents, props changed)
head/net/samba411/files/patch-lib_replace_wscript (contents, props changed)
head/net/samba411/files/patch-lib_talloc_talloc.c (contents, props changed)
head/net/samba411/files/patch-lib_talloc_wscript (contents, props changed)
head/net/samba411/files/patch-lib_tdb_wscript (contents, props changed)
head/net/samba411/files/patch-lib_util_wscript__build (contents, props changed)
head/net/samba411/files/patch-listen-backlog (contents, props changed)
head/net/samba411/files/patch-mdns (contents, props changed)
head/net/samba411/files/patch-nsswitch_wscript__build (contents, props changed)
head/net/samba411/files/patch-source3_include_includes.h (contents, props changed)
head/net/samba411/files/patch-source3_lib_sysquotas__4B.c (contents, props changed)
head/net/samba411/files/patch-source3_lib_util.c (contents, props changed)
head/net/samba411/files/patch-source3_librpc_crypto_gse.c (contents, props changed)
head/net/samba411/files/patch-source3_modules_vfs__fruit.c (contents, props changed)
head/net/samba411/files/patch-source3_modules_vfs__streams__xattr.c (contents, props changed)
head/net/samba411/files/patch-source3_modules_vfs__virusfilter__utils.c (contents, props changed)
head/net/samba411/files/patch-source3_registry_tests_test__regfio.c (contents, props changed)
head/net/samba411/files/patch-source3_smbd_quotas.c (contents, props changed)
head/net/samba411/files/patch-source3_smbd_utmp.c (contents, props changed)
head/net/samba411/files/patch-source3_torture_cmd__vfs.c (contents, props changed)
head/net/samba411/files/patch-source3_utils_net.c (contents, props changed)
head/net/samba411/files/patch-source3_utils_net__time.c (contents, props changed)
head/net/samba411/files/patch-source3_winbindd_wscript__build (contents, props changed)
head/net/samba411/files/patch-source3_wscript (contents, props changed)
head/net/samba411/files/patch-source3_wscript__build (contents, props changed)
head/net/samba411/files/patch-source4_dsdb_samdb_ldb__modules_count_attrs.c (contents, props changed)
head/net/samba411/files/patch-source4_heimdal_lib_roken_rand.c (contents, props changed)
head/net/samba411/files/patch-source4_kdc_kdc-service-mit.c (contents, props changed)
head/net/samba411/files/patch-source4_lib_http_http.c (contents, props changed)
head/net/samba411/files/patch-vfs_freebsd (contents, props changed)
head/net/samba411/files/pkg-message.in (contents, props changed)
head/net/samba411/files/samba_server.in (contents, props changed)
head/net/samba411/pkg-descr (contents, props changed)
head/net/samba411/pkg-plist (contents, props changed)
Modified:
head/net/Makefile
Modified: head/net/Makefile
==============================================================================
--- head/net/Makefile Sun Apr 12 01:59:59 2020 (r531473)
+++ head/net/Makefile Sun Apr 12 02:00:35 2020 (r531474)
@@ -1357,6 +1357,7 @@
SUBDIR += ryu
SUBDIR += s3ql
SUBDIR += samba410
+ SUBDIR += samba411
SUBDIR += samplicator
SUBDIR += savvycan
SUBDIR += sbd
Added: head/net/samba411/Makefile
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ head/net/samba411/Makefile Sun Apr 12 02:00:35 2020 (r531474)
@@ -0,0 +1,655 @@
+# Created by: timur at FreeBSD.org
+# $FreeBSD$
+
+PORTNAME= ${SAMBA4_BASENAME}411
+PORTVERSION= ${SAMBA4_VERSION}
+PORTREVISION= 0
+CATEGORIES?= net
+MASTER_SITES= SAMBA/samba/stable SAMBA/samba/rc
+DISTNAME= ${SAMBA4_DISTNAME}
+
+MAINTAINER= timur at FreeBSD.org
+COMMENT= Free SMB/CIFS and AD/DC server and client for Unix
+
+LICENSE= GPLv3+
+LICENSE_FILE= ${WRKSRC}/COPYING
+
+IGNORE_NONTHREAD_PYTHON= needs port lang/python${PYTHON_SUFFIX} to be build with THREADS support
+CONFLICTS_INSTALL?= samba4-4.0.* samba4[1-9]-4.* samba410-4.10.* p5-Parse-Pidl-4.*
+
+USES= cpe
+
+EXTRA_PATCHES+= ${PATCHDIR}/0001-Zfs-provision-1.patch:-p1
+
+SAMBA4_BASENAME= samba
+SAMBA4_PORTNAME= ${SAMBA4_BASENAME}4
+SAMBA4_VERSION= 4.11.7
+SAMBA4_DISTNAME= ${SAMBA4_BASENAME}-${SAMBA4_VERSION:S|.p|pre|:S|.r|rc|:S|.t|tp|:S|.a|alpha|}
+
+WRKSRC?= ${WRKDIR}/${DISTNAME}
+
+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
+
+CONFIGURE_ARGS+= --mandir="${MANPREFIX}/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"
+
+USES+= compiler:c++11-lang iconv localbase:ldflags \
+ perl5 pkgconfig shebangfix ssl waf gettext-runtime
+USE_PERL5= build
+USE_LDCONFIG= ${SAMBA4_LIBDIR}
+WAF_CMD= buildtools/bin/waf
+CONFIGURE_LOG= bin/config.log
+
+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 NTVFS PROFILE QUOTAS SPOTLIGHT SYSLOG UTMP
+# This shouldn't be default in the release
+OPTIONS_DEFINE+= DEVELOPER MANDOC
+#OPTIONS_DEFINE+= MEMORY_DEBUG
+
+OPTIONS_DEFINE_amd64= AESNI
+OPTIONS_DEFAULT_amd64= AESNI
+
+OPTIONS_GROUP= VFS
+OPTIONS_GROUP_VFS= FRUIT GLUSTERFS
+
+OPTIONS_SINGLE= GSSAPI ZEROCONF
+# GSSAPI_HEIMDAL
+OPTIONS_SINGLE_GSSAPI= GSSAPI_BUILTIN GSSAPI_MIT
+OPTIONS_SINGLE_ZEROCONF= ZEROCONF_NONE AVAHI MDNSRESPONDER
+
+OPTIONS_RADIO= DNS
+OPTIONS_RADIO_DNS= NSUPDATE BIND911 BIND916
+# Make those default options
+OPTIONS_DEFAULT= AD_DC ADS DOCS FAM LDAP \
+ QUOTAS SYSLOG UTMP PROFILE \
+ FRUIT GSSAPI_BUILTIN AVAHI
+##############################################################################
+AD_DC_DESC= Active Directory Domain Controller
+ADS_DESC= Active Directory client(implies LDAP)
+AESNI_DESC= Accelerated AES crypto functions(amd64 only)
+CLUSTER_DESC= Clustering support
+DEVELOPER_DESC= With developer framework(implies NTVFS)
+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
+NTVFS_DESC= Build *DEPRECATED* NTVFS file server
+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
+GLUSTERFS_DESC= GlusterFS support
+FRUIT_DESC= MacOSX and TimeMachine support
+
+GSSAPI_BUILTIN_DESC= GSSAPI support via bundled Heimdal
+
+ZEROCONF_DESC= Zero configuration networking
+ZEROCONF_NONE_DESC= Zeroconf support is absent
+
+DNS_DESC= DNS frontend
+BIND911_DESC= Use Bind 9.11 as AD DC DNS server frontend
+BIND916_DESC= Use Bind 9.16 as AD DC DNS server frontend
+NSUPDATE_DESC= Use samba NSUPDATE utility for AD DC
+##############################################################################
+# XXX: Unconditional dependencies which can't be switched off(if present in
+# the system)
+
+# Iconv(picked up unconditionaly)
+LIB_DEPENDS+= libiconv.so:converters/libiconv
+# 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
+LIB_DEPENDS+= libtasn1.so: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?= yes
+# 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
+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
+CONFLICTS_INSTALL+= talloc-* talloc1-*
+PLIST_SUB+= SAMBA4_BUNDLED_TALLOC=""
+SUB_LIST+= SAMBA4_BUNDLED_TALLOC=""
+.else
+SAMBA4_BUNDLED_LIBS+= !talloc
+BUILD_DEPENDS+= talloc>=2.2.0:devel/talloc
+RUN_DEPENDS+= talloc>=2.2.0:devel/talloc
+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.10.0:devel/tevent
+RUN_DEPENDS+= tevent>=0.10.0:devel/tevent
+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.2:databases/tdb
+RUN_DEPENDS+= tdb>=1.4.2:databases/tdb
+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+= ldb20>=2.0.8:databases/ldb20
+RUN_DEPENDS+= ldb20>=2.0.8:databases/ldb20
+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/tshark
+##############################################################################
+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+= 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+= man/man8/vfs_glusterfs.8.gz
+##############################################################################
+ZEROCONF_NONE_VARS= 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
+##############################################################################
+BIND911_RUN_DEPENDS= bind911>=9.11.0.0:dns/bind911
+BIND916_RUN_DEPENDS= bind916>=9.16.0.0:dns/bind916
+NSUPDATE_RUN_DEPENDS= samba-nsupdate:dns/samba-nsupdate
+##############################################################################
+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_IMPLIES= NTVFS
+DEVELOPER_CONFIGURE_ON= --enable-developer --enable-selftest --abi-check-disable
+DEVELOPER_RUN_DEPENDS= ${SAMBA4_LMDB_DEPENDS}
+DEVELOPER_BUILD_DEPENDS= ${GDB_CMD}:devel/gdb \
+ ${SAMBA4_LMDB_DEPENDS}
+DEVELOPER_TEST_DEPENDS= ${GDB_CMD}:devel/gdb
+DEVELOPER_VARS_OFF= GDB_CMD=true
+# XXX: Mostly used in conjuction with the DEVELOPER option, don't enable it
+# if you don't know what you are doing
+NTVFS_IMPLIES= AD_DC
+NTVFS_CONFIGURE_WITH= ntvfs-fileserver
+NTVFS_PLIST_FILES= ${SAMBA4_MODULEDIR}/service/smb.so \
+ lib/samba4/private/libntvfs-samba4.so
+##############################################################################
+CLUSTER_CONFIGURE_WITH= cluster-support
+
+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
+
+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
+SPOTLIGHT_USES= bison gnome
+SPOTLIGHT_USE= gnome=glib20
+
+SYSLOG_CONFIGURE_WITH= syslog
+
+UTMP_CONFIGURE_WITH= utmp
+
+AD_DC_CONFIGURE_OFF= --without-ad-dc
+AD_DC_BUILD_DEPENDS= ${SAMBA4_LMDB_DEPENDS}
+AD_DC_RUN_DEPENDS= ${SAMBA4_LMDB_DEPENDS}
+
+ADS_IMPLIES= LDAP
+ADS_CONFIGURE_WITH= ads dnsupdate
+
+LDAP_CONFIGURE_WITH= ldap
+LDAP_CONFIGURE_ON= --with-openldap=${LOCALBASE}
+LDAP_USE= OPENLDAP=yes
+LDAP_VARS= SAMBA4_MODULES+=idmap_ldap
+
+GSSAPI_MIT_CONFIGURE_ON= --with-system-mitkrb5 ${GSSAPIBASEDIR} \
+ --with-system-mitkdc=${GSSAPIBASEDIR}/sbin/krb5kdc \
+ --with-experimental-mit-ad-dc
+GSSAPI_MIT_USES= gssapi:mit
+
+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"
+
+##############################################################################
+.include <bsd.port.options.mk>
+##############################################################################
+
+.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+= vfs_freebsd
+
+SAMBA4_MODULES+= 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
+
+.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 defined(NO_PYTHON)
+USES+= python:build,test
+CONFIGURE_ARGS+= --disable-python
+PLIST_SUB+= SAMBA4_PYTHON="@comment "
+SUB_LIST+= SAMBA4_PYTHON="@comment "
+.else
+USES+= python:3.4+
+PLIST_SUB+= SAMBA4_PYTHON=""
+SUB_LIST+= SAMBA4_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
+# External Python modules
+BUILD_DEPENDS+= ${PYTHON_PKGNAMEPREFIX}iso8601>=0.1.11:devel/py-iso8601@${PY_FLAVOR}
+RUN_DEPENDS+= ${PYTHON_PKGNAMEPREFIX}iso8601>=0.1.11:devel/py-iso8601@${PY_FLAVOR}
+.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
+
+.if defined(WITH_DEBUG)
+CONFIGURE_ARGS+= --verbose --enable-debug
+MAKE_ARGS+= --verbose
+DEBUG_FLAGS?= -g -ggdb3 -O0
+.endif
+
+##############################################################################
+.include <bsd.port.pre.mk>
+##############################################################################
+
+# Require llvm 4.0 and AMD64
+.if ${PORT_OPTIONS:MAESNI} && ${ARCH} == "amd64"
+CONFIGURE_ARGS+= --accel-aes=intelaesni
+PLIST_FILES+= lib/samba4/private/libaesni-intel-samba4.so
+.else
+CONFIGURE_ARGS+= --accel-aes=none
+.endif
+
+
+# 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+= lib/samba4/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 \
+ man/man8/winbind_krb5_localauth.8.gz
+. if ${PORT_OPTIONS:MAD_DC}
+PLIST_FILES+= lib/samba4/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
+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'
+.if ${CHOSEN_COMPILER_TYPE} == clang
+CFLAGS+= -fno-color-diagnostics
+.endif
+# Allow rpcgen to find proper CPP
+MAKE_ENV+= RPCGEN_CPP="${CPP}"
+#.if ${readline_ARGS} == port
+#CFLAGS+= -D_FUNCTION_DEF
+#.endif
+
+# Make sure that the right version of Python is used by the tools
+# https://bugzilla.samba.org/show_bug.cgi?id=7305
+SHEBANG_FILES= ${PATCH_WRKSRC}/source4/scripting/bin/* ${PATCH_WRKSRC}/selftest/*
+
+SAMBA4_SUB= SAMBA4_LOGDIR="${SAMBA4_LOGDIR}" \
+ SAMBA4_RUNDIR="${SAMBA4_RUNDIR}" \
+ SAMBA4_LOCKDIR="${SAMBA4_LOCKDIR}" \
+ 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:MAD_DC} && ${PORT_OPTIONS:MNTVFS}
+ @${ECHO_CMD}; \
+ ${ECHO_MSG} "===> NTVFS option requires AD_DC to be set"; \
+ ${ECHO_CMD}; \
+ ${FALSE}
+.endif
+ @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-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/ldbadd.1 \
+ lib/ldb/man/ldbsearch.1 \
+ lib/ldb/man/ldbmodify.1 \
+ lib/ldb/man/ldbrename.1 \
+ lib/ldb/man/ldbdel.1 \
+ lib/ldb/man/ldbedit.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:
+.if defined(NO_PYTHON)
+ ${RM} -r ${STAGEDIR}${PYTHON_SITELIBDIR}/samba/third_party/dns \
+ ${STAGEDIR}${PYTHON_SITELIBDIR}/samba/third_party/iso8601
+.endif
+
+post-install-fix-manpages:
+.for f in vfs_aio_linux.8 vfs_btrfs.8 vfs_ceph.8 vfs_gpfs.8
+ ${RM} ${STAGEDIR}${PREFIX}/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}/man/man1/${f} ${STAGEDIR}${PREFIX}/man/man1/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}/man/man8/${f} ${STAGEDIR}${PREFIX}/man/man8/samba-${f}
+. endfor
+.endif
+
+post-install: post-install-rm-junk post-install-fix-manpages
+ ${LN} -sf smb.conf.5.gz ${STAGEDIR}${PREFIX}/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 dir in auth bind9 gensec gpext idmap ldb nss_info pdb perfcount process_model service vfs
+ ${INSTALL} -d -m 0755 "${STAGEDIR}${SAMBA4_MODULEDIR}/${dir}"
+.endfor
+.if !defined(WITH_DEBUG)
+ -${FIND} ${STAGEDIR}${PREFIX}/bin ${STAGEDIR}${PREFIX}/sbin \
+ -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}/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>
Added: head/net/samba411/distinfo
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ head/net/samba411/distinfo Sun Apr 12 02:00:35 2020 (r531474)
@@ -0,0 +1,3 @@
+TIMESTAMP = 1586645355
+SHA256 (samba-4.11.7.tar.gz) = 79b6f9ebc357373f885153e2d5d26dc6def9f4511ee4bcbe8a8e2622acc42143
+SIZE (samba-4.11.7.tar.gz) = 18541292
Added: head/net/samba411/files/0001-Zfs-provision-1.patch
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ head/net/samba411/files/0001-Zfs-provision-1.patch Sun Apr 12 02:00:35 2020 (r531474)
@@ -0,0 +1,329 @@
+From 2664c997587416a2c8c911a75158485a5c98b70b Mon Sep 17 00:00:00 2001
+From: John Hixon <john at ixsystems.com>
+Date: Sat, 20 May 2017 04:39:37 +0200
+Subject: [PATCH] Zfs provision (#1)
+
+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 at iXsystems.com>
+---
+ python/samba/provision/__init__.py | 25 ++++--
+ source3/lib/sysacls.c | 10 +++
+ source3/param/loadparm.c | 7 ++
+ source3/smbd/pysmbd.c | 156 ++++++++++++++++++++++++++++++++++++-
+ 4 files changed, 191 insertions(+), 7 deletions(-)
+
+diff --git a/python/samba/provision/__init__.py b/python/samba/provision/__init__.py
+index 5de986463a5..cd3b91f41b9 100644
+--- a/python/samba/provision/__init__.py
++++ b/python/samba/provision/__init__.py
+@@ -1556,19 +1556,24 @@ 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, gid)
++ set_simple_acl(file.name, 0o755, 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)
+@@ -1821,6 +1828,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:
+@@ -2184,6 +2194,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 0bf3c37edfa..786cd39b5bc 100644
+--- a/source3/lib/sysacls.c
++++ b/source3/lib/sysacls.c
+@@ -38,6 +38,16 @@
+ #include "modules/vfs_hpuxacl.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 a2fcc4246c9..4b676897fc1 100644
+--- a/source3/param/loadparm.c
++++ b/source3/param/loadparm.c
+@@ -2740,6 +2740,13 @@ static void init_locals(void)
+ } 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 63fc5d68c33..f5a536ee186 100644
+--- a/source3/smbd/pysmbd.c
++++ b/source3/smbd/pysmbd.c
+@@ -393,6 +393,20 @@ static SMB_ACL_T make_simple_acl(TALLOC_
+ 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
+ */
+@@ -438,6 +452,57 @@ static PyObject *py_smbd_set_simple_acl(
+ 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", "gid", "service", NULL };
++ char *fname, *service = NULL;
++ int ret;
++ int mode, gid = -1;
++ SMB_ACL_T acl;
++ TALLOC_CTX *frame;
++ connection_struct *conn;
++
++ if (!PyArg_ParseTupleAndKeywords(args, kwargs, "si|iz",
++ discard_const_p(char *, kwnames),
++ &fname, &mode, &gid, &service))
++ 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, NULL);
++ 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
+ */
+@@ -537,7 +602,7 @@ static PyObject *py_smbd_unlink(PyObject
+ }
+
+ /*
+- 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))
+@@ -549,6 +614,86 @@ static PyObject *py_smbd_have_posix_acls
+ #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)
++{
++ /*
++ * This should really be done in source3/param/loadparm.c
++ */
++#if defined(HAVE_LIBSUNACL) && defined(FREEBSD)
++ lp_do_parameter(-1, "vfs objects", "dfs_samba4 zfsacl");
++#endif
++ Py_RETURN_NONE;
++}
++
+ /*
+ set the NT ACL on a file
+ */
+@@ -883,10 +1028,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 },
*** DIFF OUTPUT TRUNCATED AT 1000 LINES ***
More information about the svn-ports-head
mailing list