s3: VFS: default: Remove the sys_proc_fd_path() fallback code in vfswrap_sys_acl_set_...
authorJeremy Allison <jra@samba.org>
Wed, 9 Jun 2021 00:01:02 +0000 (17:01 -0700)
committerRalph Boehme <slow@samba.org>
Wed, 9 Jun 2021 13:14:31 +0000 (13:14 +0000)
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 <jra@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
source3/modules/vfs_default.c

index 4070dd4838c195a9da8f98a639bd40dbd5f0bb74..187b68a78cf8141e375442460d08f573da52eeb1 100644 (file)
@@ -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,