git: bbae646f6b6d - main - net/samba422: Update to 4.22.3
- Go to: [ bottom of page ] [ top of archives ] [ this month ]
Date: Wed, 22 Oct 2025 14:31:16 UTC
The branch main has been updated by 0mp:
URL: https://cgit.FreeBSD.org/ports/commit/?id=bbae646f6b6d0c9a8c25c8c7546336890f6db59b
commit bbae646f6b6d0c9a8c25c8c7546336890f6db59b
Author: Mateusz Piotrowski <0mp@FreeBSD.org>
AuthorDate: 2025-10-22 14:20:07 +0000
Commit: Mateusz Piotrowski <0mp@FreeBSD.org>
CommitDate: 2025-10-22 14:24:37 +0000
net/samba422: Update to 4.22.3
Most of this patch is Andrej Ebert's work. I fixed some of the remaining
issues and prepared it for landing in the ports tree under sponsorship
from Klara, Inc.
Changes in the port include:
- There's an unconditional dependency on devel/icu now,
since Samba pulls it in if it's in the build environment and
complains afterwards if icu is bumped without a Samba rebuild.
- Remove GSSAPI Builtin converters/p5-JSON build dependency,
it's not needed since 4.20 as per upstream:
https://www.samba.org/samba/history/samba-4.20.0.html
- Change the LDAP_CONFIGURE option to --with-ldap/--without-ldap, the
--with-openldap was patched in by the removed patch 0013.
- Fix building with AD_DC disabled (by yasu@FreeBSD.org).
The following paragraphs explain why certain files were added, modified, or
deleted.
0013-Pass-additional-msg-parameter-to-CHECK_LIB-so-it-can.patch was removed.
This patch did 3 things:
- Introduce --with-openldap that we don't use anymore.
- Increase verbosity of messages during buildtime, which we can drop.
- Change the default of --with-libiconv, which we workaround now by passing
ICONV_PREFIX explicitly.
0024-Cherry-pick-ZFS-provisioning-code-by-iXsystems-Inc.patch was split into:
- patch-source3_smbd_pysmbd.c
- patch-python_samba_join.py
- patch-python_samba_provision_____init____.py
0027-Add-VFS-module-vfs_freebsd-that-implements-FreeBSD-s.patch was split into:
- patch-source3_modules_vfs__freebsd.c
- patch-docs-xml_manpages_vfs__freebsd.8.xml
- patch-docs-xml_wscript__build
- patch-source3_lib_sysacls.c
- patch-source3_modules_wscript__build
- patch-source3_param_loadparm.c
0028-Fix-rl_completion_func_t.patch was removed. Those changes seem to already
be present in this release of Samba.
0099-s3-modules-zfsacl-fix-get-set-ACL-on-FreeBSD-13.patch was removed as it is
no longer necessary thanks to patch-source3_modules_vfs__zfsacl.c.
0100-Fix-pathref-handling-for-FreeBSD-13plus_samba42x.patch was removed as it
has been superseded by 0028-s3-lib-system-add-FreeBSD-proc_fd_pattern.patch.
This change integrates the fdescfs patch from bug #284623, comment #20.
0102-FreeBSD-vfs_freebsd-fix-sys_proc_fd_path-args.patch was moved to
patch-source3_modules_vfs__freebsd.c.
patch-docs-xml_manpages_vfs__freebsd.8.xml contains parts of
0027-Add-VFS-module-vfs_freebsd-that-implements-FreeBSD-s.patch.
patch-docs-xml_wscript__build contains parts of
0027-Add-VFS-module-vfs_freebsd-that-implements-FreeBSD-s.patch.
patch-lib_ldb_wscript was removed as ldb is now bundled and private
per default, as upstream recommends. Samba now conflicts with databases/ldb*.
Subsequent commits to net/samba422 will make the bundled ldb public, so that
other ports in the FreeBSD Ports Collection can satisfy their ldb dependency
requirements with Samba 4.22.
patch-lib_util_util_crypt_c was added to help Samba find the right headers.
Obtained from:
https://github.com/openbsd/ports/blob/master/net/samba/patches/patch-lib_util_util_crypt_c.
patch-lib_util_wscript__build was removed as it no longer applied cleanly.
patch-python_samba_join.py contains parts of
0024-Cherry-pick-ZFS-provisioning-code-by-iXsystems-Inc.patch.
patch-python_samba_provision_____init____.py contains parts of
0024-Cherry-pick-ZFS-provisioning-code-by-iXsystems-Inc.patch.
patch-python_samba_tdb__util.py was removed as those changes were upstreamed
and are shipped in this version of Samba. Refer to
https://bugzilla.samba.org/show_bug.cgi?id=15804 for more details.
patch-source3_lib_sysacls.c contains parts of
0027-Add-VFS-module-vfs_freebsd-that-implements-FreeBSD-s.patch.
patch-source3_modules_vfs__freebsd.c contains parts of
0027-Add-VFS-module-vfs_freebsd-that-implements-FreeBSD-s.patch and
0102-FreeBSD-vfs_freebsd-fix-sys_proc_fd_path-args.patch.
patch-source3_modules_vfs__zfsacl.c was added. It is a patch by Peter Eriksson
from https://bugzilla.samba.org/show_bug.cgi?id=15376. This change fixes
setting ACLs from Windows for us, which was broken since Samba 4.19.
patch-source3_modules_wscript__build contains parts of
0027-Add-VFS-module-vfs_freebsd-that-implements-FreeBSD-s.patch.
patch-source3_param_loadparm.c contains parts of
0027-Add-VFS-module-vfs_freebsd-that-implements-FreeBSD-s.patch.
patch-source3_smbd_pysmbd.c contains parts of
0024-Cherry-pick-ZFS-provisioning-code-by-iXsystems-Inc.patch.
patch-source3_wscript__build was removed as it no longer applied cleanly.
In future updates we should probably bring back
0024-Cherry-pick-ZFS-provisioning-code-by-iXsystems-Inc.patch and
0027-Add-VFS-module-vfs_freebsd-that-implements-FreeBSD-s.patch.
Changes: https://wiki.samba.org/index.php/Samba_Features_added/changed#Samba_4.21
Changes: https://wiki.samba.org/index.php/Samba_Features_added/changed#Samba_4.22
PR: 284623, 287985
Reported by: Andrej Ebert <andrej@ebert.su>
Reviewed by: Michael Zoon <zoon01@xigmanas.com>
Tested by: ghelmer@, kiwi@
Sponsored by: Klara, Inc.
Differential Revision: https://reviews.freebsd.org/D52168
Co-authored-by: Andrej Ebert <andrej@ebert.su>
Co-authored-by: Yasuhiro Kimura <yasu@FreeBSD.org>
---
net/Makefile | 1 +
net/samba422/Makefile | 58 +--
net/samba422/distinfo | 6 +-
...onal-msg-parameter-to-CHECK_LIB-so-it-can.patch | 70 ---
...ck-ZFS-provisioning-code-by-iXsystems-Inc.patch | 367 ---------------
.../files/0028-Fix-rl_completion_func_t.patch | 32 --
...ules-zfsacl-fix-get-set-ACL-on-FreeBSD-13.patch | 164 -------
...href-handling-for-FreeBSD-13plus_samba42x.patch | 515 ---------------------
...BSD-vfs_freebsd-fix-sys_proc_fd_path-args.patch | 53 ---
net/samba422/files/README.FreeBSD.in | 7 +-
.../patch-docs-xml_manpages_vfs__freebsd.8.xml | 172 +++++++
net/samba422/files/patch-docs-xml_wscript__build | 10 +
net/samba422/files/patch-lib_ldb_wscript | 61 ---
net/samba422/files/patch-lib_util_util_crypt_c | 15 +
net/samba422/files/patch-lib_util_wscript__build | 11 -
net/samba422/files/patch-python_samba_join.py | 11 +
.../patch-python_samba_provision_____init____.py | 71 +++
net/samba422/files/patch-python_samba_tdb__util.py | 15 -
net/samba422/files/patch-source3_lib_sysacls.c | 19 +
....patch => patch-source3_modules_vfs__freebsd.c} | 233 +---------
.../files/patch-source3_modules_vfs__zfsacl.c | 182 ++++++++
.../files/patch-source3_modules_wscript__build | 16 +
net/samba422/files/patch-source3_param_loadparm.c | 32 ++
net/samba422/files/patch-source3_smbd_pysmbd.c | 230 +++++++++
net/samba422/files/patch-source3_wscript__build | 44 --
net/samba422/pkg-plist | 118 +++--
net/samba422/pkg-plist.ad_dc | 8 +-
net/samba422/pkg-plist.python | 73 ++-
28 files changed, 915 insertions(+), 1679 deletions(-)
diff --git a/net/Makefile b/net/Makefile
index 030e053eb1a9..6dd01d26c59b 100644
--- a/net/Makefile
+++ b/net/Makefile
@@ -1489,6 +1489,7 @@
SUBDIR += samba416
SUBDIR += samba419
SUBDIR += samba420
+ SUBDIR += samba422
SUBDIR += samplicator
SUBDIR += savvycan
SUBDIR += sbm
diff --git a/net/samba422/Makefile b/net/samba422/Makefile
index 3696bb72befa..5451fc1ac479 100644
--- a/net/samba422/Makefile
+++ b/net/samba422/Makefile
@@ -1,6 +1,5 @@
-PORTNAME= ${SAMBA4_BASENAME}420
+PORTNAME= ${SAMBA4_BASENAME}422
PORTVERSION= ${SAMBA4_VERSION}
-PORTREVISION= 10
CATEGORIES?= net
MASTER_SITES= SAMBA/samba/stable SAMBA/samba/rc
DISTNAME= ${SAMBA4_DISTNAME}
@@ -29,7 +28,6 @@ EXTRA_PATCHES= \
${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 \
@@ -40,18 +38,12 @@ EXTRA_PATCHES= \
${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}/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_VERSION= 4.22.3
SAMBA4_DISTNAME= ${SAMBA4_BASENAME}-${SAMBA4_VERSION:S|.p|pre|:S|.r|rc|:S|.t|tp|:S|.a|alpha|}
WRKSRC?= ${WRKDIR}/${DISTNAME}
@@ -98,7 +90,7 @@ CONFIGURE_ENV= PTHREAD_LDFLAGS="-lpthread" \
PYTHONHASHSEED=1
MAKE_ENV= PYTHONHASHSEED=1
-USES= bison compiler:c++11-lang iconv localbase:ldflags \
+USES= compiler:c++11-lang iconv localbase:ldflags \
perl5 pkgconfig shebangfix waf gettext-runtime
USE_PERL5= build
USE_LDCONFIG= ${SAMBA4_LIBDIR}
@@ -116,8 +108,8 @@ SUB_LIST= PKGCONFIGDIR=${PKGCONFIGDIR_REL}
##############################################################################
OPTIONS_SUB= yes
-OPTIONS_DEFINE= AD_DC ADS CLUSTER CUPS DOCS FAM GPGME \
- LDAP MANPAGES PROFILE PYTHON3 QUOTAS \
+OPTIONS_DEFINE= AD_DC ADS CLUSTER CUPS DOCS FAM LDAP GPGME \
+ MANPAGES PROFILE PYTHON3 QUOTAS \
SYSLOG UTMP
#OPTIONS_DEFINE+= DEVELOPER MEMORY_DEBUG
@@ -135,7 +127,7 @@ OPTIONS_DEFAULT= AD_DC ADS DOCS FAM LDAP MANPAGES \
PROFILE PYTHON3 QUOTAS SYSLOG UTMP \
FRUIT GSSAPI_BUILTIN AVAHI
##############################################################################
-ADS_DESC= Active Directory client(implies LDAP)
+ADS_DESC= Active Directory client
AD_DC_DESC= Active Directory Domain Controller(implies PYTHON3)
CLUSTER_DESC= Clustering support
DEVELOPER_DESC= With developer framework
@@ -177,6 +169,9 @@ LIB_DEPENDS+= libgnutls.so:security/gnutls
LIB_DEPENDS+= libgcrypt.so:security/libgcrypt
# NFSv4 ACL glue
LIB_DEPENDS+= libsunacl.so:sysutils/libsunacl
+# libicu
+LIB_DEPENDS+= libicui18n.so:devel/icu
+LIB_DEPENDS+= libicuuc.so:devel/icu
# Jansson
BUILD_DEPENDS+= jansson>=2.10:devel/jansson
RUN_DEPENDS+= jansson>=2.10:devel/jansson
@@ -197,7 +192,7 @@ SAMBA4_BUNDLED_CMOCKA?= no
SAMBA4_BUNDLED_TALLOC?= no
SAMBA4_BUNDLED_TEVENT?= no
SAMBA4_BUNDLED_TDB?= no
-SAMBA4_BUNDLED_LDB?= no
+SAMBA4_BUNDLED_LDB?= yes
# cmocka
.if defined(SAMBA4_BUNDLED_CMOCKA) && ${SAMBA4_BUNDLED_CMOCKA} == yes
SAMBA4_BUNDLED_LIBS+= cmocka
@@ -218,8 +213,8 @@ PLIST_SUB+= SAMBA4_BUNDLED_TALLOC=""
SUB_LIST+= SAMBA4_BUNDLED_TALLOC=""
.else
SAMBA4_BUNDLED_LIBS+= !talloc
-BUILD_DEPENDS+= talloc242>=2.4.2:devel/talloc242
-RUN_DEPENDS+= talloc242>=2.4.2:devel/talloc242
+BUILD_DEPENDS+= talloc243>=2.4.3:devel/talloc243
+RUN_DEPENDS+= talloc243>=2.4.3:devel/talloc243
PLIST_SUB+= SAMBA4_BUNDLED_TALLOC="@comment "
SUB_LIST+= SAMBA4_BUNDLED_TALLOC="@comment "
.endif
@@ -231,8 +226,8 @@ PLIST_SUB+= SAMBA4_BUNDLED_TEVENT=""
SUB_LIST+= SAMBA4_BUNDLED_TEVENT=""
.else
SAMBA4_BUNDLED_LIBS+= !tevent
-BUILD_DEPENDS+= tevent016>=0.16.1:devel/tevent016
-RUN_DEPENDS+= tevent016>=0.16.1:devel/tevent016
+BUILD_DEPENDS+= tevent017>=0.17:devel/tevent017
+RUN_DEPENDS+= tevent017>=0.17:devel/tevent017
PLIST_SUB+= SAMBA4_BUNDLED_TEVENT="@comment "
SUB_LIST+= SAMBA4_BUNDLED_TEVENT="@comment "
.endif
@@ -244,8 +239,8 @@ PLIST_SUB+= SAMBA4_BUNDLED_TDB=""
SUB_LIST+= SAMBA4_BUNDLED_TDB=""
.else
SAMBA4_BUNDLED_LIBS+= !tdb
-BUILD_DEPENDS+= tdb1410>=1.4.10:databases/tdb1410
-RUN_DEPENDS+= tdb1410>=1.4.10:databases/tdb1410
+BUILD_DEPENDS+= tdb1413>=1.4.13:databases/tdb1413
+RUN_DEPENDS+= tdb1413>=1.4.13:databases/tdb1413
PLIST_SUB+= SAMBA4_BUNDLED_TDB="@comment "
SUB_LIST+= SAMBA4_BUNDLED_TDB="@comment "
.endif
@@ -253,6 +248,7 @@ SUB_LIST+= SAMBA4_BUNDLED_TDB="@comment "
.if defined(SAMBA4_BUNDLED_LDB) && ${SAMBA4_BUNDLED_LDB} == yes
SAMBA4_BUNDLED_LDB= yes
SAMBA4_BUNDLED_LIBS+= ldb
+CONFLICTS_INSTALL+= ldb-* ldb2-*
PLIST_SUB+= SAMBA4_BUNDLED_LDB=""
SUB_LIST+= SAMBA4_BUNDLED_LDB=""
SAMBA4_MODULEDIR= ${SAMBA4_LIBDIR}/modules
@@ -290,6 +286,7 @@ TEST_RUN_DEPENDS= ${PYTHON_PKGNAMEPREFIX}iso8601>=0.1.11:devel/py-iso8601@${PY_
CONFIGURE_ARGS+= \
--with-pam \
--with-iconv \
+ --with-libiconv="${ICONV_PREFIX}" \
--with-winbind \
--with-regedit \
--disable-rpath \
@@ -341,7 +338,7 @@ 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_CONFIGURE_OFF= --without-ad-dc --without-ldb-lmdb
AD_DC_BUILD_DEPENDS= ${SAMBA4_LMDB_DEPENDS}
AD_DC_RUN_DEPENDS= ${SAMBA4_LMDB_DEPENDS}
AD_DC_VARS= PLIST+=${PKGDIR}/pkg-plist.ad_dc
@@ -351,7 +348,6 @@ AD_DC_BUILD_DEPENDS+= ${PYTHON_PKGNAMEPREFIX}markdown>=3.3.7:textproc/py-markdo
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
@@ -367,13 +363,7 @@ GPGME_CONFIGURE_WITH= gpgme
GPGME_LIB_DEPENDS= libgpgme.so:security/gpgme
GPGME_RUN_DEPENDS= ${PYTHON_PKGNAMEPREFIX}gpg>=2.0.0:security/py-gpg@${PY_FLAVOR}
-.if exists(/usr/libexec/krb5kdc)
-GSSAPI_BUILTIN_USES= gssapi
-GSSAPI_MIT_CONFIGURE_ON= --with-system-mitkrb5 ${GSSAPIBASEDIR} \
- --with-system-mitkdc=${GSSAPIBASEDIR}/libexec/krb5kdc
-.endif
-
-GSSAPI_BUILTIN_BUILD_DEPENDS= p5-JSON>=4.0:converters/p5-JSON
+GSSAPI_BUILTIN_USES= bison
GSSAPI_MIT_CONFIGURE_ON= --with-system-mitkrb5 ${GSSAPIBASEDIR} \
--with-system-mitkdc=${GSSAPIBASEDIR}/sbin/krb5kdc \
@@ -386,7 +376,8 @@ 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_CONFIGURE_ON= --with-ldap
+LDAP_CONFIGURE_OFF= --without-ldap
LDAP_USES= ldap
LDAP_VARS= SAMBA4_MODULES+=idmap_ldap
@@ -617,11 +608,6 @@ 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
diff --git a/net/samba422/distinfo b/net/samba422/distinfo
index e6dc8bc2d49f..270840dcc448 100644
--- a/net/samba422/distinfo
+++ b/net/samba422/distinfo
@@ -1,3 +1,3 @@
-TIMESTAMP = 1737565689
-SHA256 (samba-4.20.7.tar.gz) = 5afe8b66e612ab1c7e57c6146adfe98ec3ea9d40dee2962a2076a3d6d6973b78
-SIZE (samba-4.20.7.tar.gz) = 42523056
+TIMESTAMP = 1752217501
+SHA256 (samba-4.22.3.tar.gz) = 8fd7092629a3596d935cd7567d934979f94272918ec3affd0cc807934ecf22ba
+SIZE (samba-4.22.3.tar.gz) = 42869744
diff --git a/net/samba422/files/0013-Pass-additional-msg-parameter-to-CHECK_LIB-so-it-can.patch b/net/samba422/files/0013-Pass-additional-msg-parameter-to-CHECK_LIB-so-it-can.patch
deleted file mode 100644
index 0508ba5113dd..000000000000
--- a/net/samba422/files/0013-Pass-additional-msg-parameter-to-CHECK_LIB-so-it-can.patch
+++ /dev/null
@@ -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
-
diff --git a/net/samba422/files/0024-Cherry-pick-ZFS-provisioning-code-by-iXsystems-Inc.patch b/net/samba422/files/0024-Cherry-pick-ZFS-provisioning-code-by-iXsystems-Inc.patch
deleted file mode 100644
index 3746f0e479f6..000000000000
--- a/net/samba422/files/0024-Cherry-pick-ZFS-provisioning-code-by-iXsystems-Inc.patch
+++ /dev/null
@@ -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
-
diff --git a/net/samba422/files/0028-Fix-rl_completion_func_t.patch b/net/samba422/files/0028-Fix-rl_completion_func_t.patch
deleted file mode 100644
index 33debfab76bc..000000000000
--- a/net/samba422/files/0028-Fix-rl_completion_func_t.patch
+++ /dev/null
@@ -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
diff --git a/net/samba422/files/0099-s3-modules-zfsacl-fix-get-set-ACL-on-FreeBSD-13.patch b/net/samba422/files/0099-s3-modules-zfsacl-fix-get-set-ACL-on-FreeBSD-13.patch
deleted file mode 100644
index 275e7e464456..000000000000
--- a/net/samba422/files/0099-s3-modules-zfsacl-fix-get-set-ACL-on-FreeBSD-13.patch
+++ /dev/null
@@ -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;
- }
*** 2411 LINES SKIPPED ***