From: Jeremy Allison Date: Wed, 9 Jun 2021 00:01:02 +0000 (-0700) Subject: s3: VFS: default: Remove the sys_proc_fd_path() fallback code in vfswrap_sys_acl_set_... X-Git-Tag: tevent-0.11.0~461 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=303185621178aa76a91458788eb13b731a3ce19f;p=thirdparty%2Fsamba.git s3: VFS: default: Remove the sys_proc_fd_path() fallback code in vfswrap_sys_acl_set_fd(). Just pass through to sys_acl_set_fd(), which goes to posixacl_sys_acl_set_fd() on posix ACL systems. We already have identical code in posixacl_sys_acl_set_fd() and these fallbacks are really system specific so we shouldn't be doing them in more than one place. Signed-off-by: Jeremy Allison Reviewed-by: Ralph Boehme --- diff --git a/source3/modules/vfs_default.c b/source3/modules/vfs_default.c index 4070dd4838c..187b68a78cf 100644 --- a/source3/modules/vfs_default.c +++ b/source3/modules/vfs_default.c @@ -3233,40 +3233,7 @@ static int vfswrap_sys_acl_set_fd(vfs_handle_struct *handle, SMB_ACL_TYPE_T type, SMB_ACL_T theacl) { - if (!fsp->fsp_flags.is_pathref && - type == SMB_ACL_TYPE_ACCESS) - { - return sys_acl_set_fd(handle, fsp, type, 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); + return sys_acl_set_fd(handle, fsp, type, theacl); } static int vfswrap_sys_acl_delete_def_fd(vfs_handle_struct *handle,