From 1f4426b44e178d05337b7804987a74c4628a2530 Mon Sep 17 00:00:00 2001 From: Ralph Boehme Date: Sun, 13 Dec 2020 09:11:37 +0100 Subject: [PATCH] vfs_default: add support for SMB_ACL_TYPE_DEFAULT and pathref fsps in vfswrap_sys_acl_set_fd() Signed-off-by: Ralph Boehme Reviewed-by: Jeremy Allison --- source3/modules/vfs_default.c | 35 ++++++++++++++++++++++++++++++++++- 1 file changed, 34 insertions(+), 1 deletion(-) diff --git a/source3/modules/vfs_default.c b/source3/modules/vfs_default.c index 155bae33823..df52856cd1e 100644 --- a/source3/modules/vfs_default.c +++ b/source3/modules/vfs_default.c @@ -3236,7 +3236,40 @@ static int vfswrap_sys_acl_set_fd(vfs_handle_struct *handle, SMB_ACL_TYPE_T type, SMB_ACL_T theacl) { - return sys_acl_set_fd(handle, fsp, theacl); + if (!fsp->fsp_flags.is_pathref && + type == SMB_ACL_TYPE_ACCESS) + { + return sys_acl_set_fd(handle, fsp, theacl); + } + + if (fsp->fsp_flags.have_proc_fds) { + int fd = fsp_get_pathref_fd(fsp); + struct smb_filename smb_fname; + const char *p = NULL; + char buf[PATH_MAX]; + + p = sys_proc_fd_path(fd, buf, sizeof(buf)); + if (p == NULL) { + return -1; + } + + smb_fname = (struct smb_filename) { + .base_name = buf, + }; + + return sys_acl_set_file(handle, + &smb_fname, + type, + theacl); + } + + /* + * This is no longer a handle based call. + */ + return sys_acl_set_file(handle, + fsp->fsp_name, + type, + theacl); } static int vfswrap_sys_acl_delete_def_file(vfs_handle_struct *handle, -- 2.47.2