-+ 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 -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 -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 ***