]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
s3/smbd: make posix_sys_acl_blob_get_fd actually use handle api with the changes...
authorNoel Power <noel.power@suse.com>
Thu, 3 Jun 2021 17:49:06 +0000 (10:49 -0700)
committerRalph Boehme <slow@samba.org>
Wed, 9 Jun 2021 13:14:30 +0000 (13:14 +0000)
Signed-off-by: Noel Power <noel.power@suse.com>
Reviewed-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
source3/smbd/posix_acls.c

index 2d533b4373367c3bb44987ad1f5c9473ce2a9427..388e471363badcfec90b5fea6a3d82673dfd910c 100644 (file)
@@ -4657,44 +4657,18 @@ int posix_sys_acl_blob_get_fd(vfs_handle_struct *handle,
        SMB_STRUCT_STAT sbuf;
        TALLOC_CTX *frame;
        struct smb_acl_wrapper acl_wrapper = { 0 };
-       int fd = fsp_get_pathref_fd(fsp);
-       char buf[PATH_MAX] = {0};
-       struct smb_filename fname;
        int ret;
 
-       if (fsp->fsp_flags.have_proc_fds) {
-               const char *proc_fd_path = NULL;
-
-               proc_fd_path = sys_proc_fd_path(fd, buf, sizeof(buf));
-               if (proc_fd_path == NULL) {
-                       return -1;
-               }
-
-               fname = (struct smb_filename) {
-                       .base_name = discard_const_p(char, proc_fd_path),
-               };
-       } else {
-               /*
-                * This is no longer a handle based call.
-                */
-
-               fname = (struct smb_filename) {
-                       .base_name = fsp->fsp_name->base_name,
-               };
-       }
-
        frame = talloc_stackframe();
 
-       acl_wrapper.access_acl = smb_vfs_call_sys_acl_get_file(
-                                       handle,
-                                       &fname,
+       acl_wrapper.access_acl = smb_vfs_call_sys_acl_get_fd(handle,
+                                       fsp,
                                        SMB_ACL_TYPE_ACCESS,
                                        frame);
 
        if (fsp->fsp_flags.is_directory) {
-               acl_wrapper.default_acl = smb_vfs_call_sys_acl_get_file(
-                                               handle,
-                                               &fname,
+               acl_wrapper.default_acl = smb_vfs_call_sys_acl_get_fd(handle,
+                                               fsp,
                                                SMB_ACL_TYPE_DEFAULT,
                                                frame);
        }