]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
s3/smbd: use SMB_VFS_FLISTXATTR() alone (also added assert fsp is not NULL)
authorNoel Power <npower@quick-trouble.localdomain>
Fri, 29 Jan 2021 14:53:43 +0000 (14:53 +0000)
committerJeremy Allison <jra@samba.org>
Fri, 26 Feb 2021 21:28:33 +0000 (21:28 +0000)
Signed-off-by: Noel Power <noel.power@suse.com>
Reviewed-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
source3/smbd/trans2.c

index 6ac33f8e0b639feadb9129a43795ef515abe4812..c3344b2b105e812b9f59cd3945bc3add85899835 100644 (file)
@@ -323,15 +323,11 @@ NTSTATUS get_ea_names_from_file(TALLOC_CTX *mem_ctx,
                return NT_STATUS_OK;
        }
 
-       if (fsp && !fsp->fsp_flags.is_pathref && fsp_get_io_fd(fsp) != -1) {
-               sizeret = SMB_VFS_FLISTXATTR(fsp, ea_namelist,
-                                            ea_namelist_size);
-       } else {
-               sizeret = SMB_VFS_LISTXATTR(conn,
-                                           smb_fname,
-                                           ea_namelist,
-                                           ea_namelist_size);
-       }
+       /* should be the case that fsp != NULL */
+       SMB_ASSERT(fsp != NULL);
+
+       sizeret = SMB_VFS_FLISTXATTR(fsp, ea_namelist,
+                                    ea_namelist_size);
 
        if ((sizeret == -1) && (errno == ERANGE)) {
                ea_namelist_size = 65536;
@@ -341,18 +337,8 @@ NTSTATUS get_ea_names_from_file(TALLOC_CTX *mem_ctx,
                }
                to_free = ea_namelist;
 
-               if (fsp &&
-                   !fsp->fsp_flags.is_pathref &&
-                   fsp_get_io_fd(fsp) != -1)
-               {
-                       sizeret = SMB_VFS_FLISTXATTR(fsp, ea_namelist,
-                                                    ea_namelist_size);
-               } else {
-                       sizeret = SMB_VFS_LISTXATTR(conn,
-                                                   smb_fname,
-                                                   ea_namelist,
-                                                   ea_namelist_size);
-               }
+               sizeret = SMB_VFS_FLISTXATTR(fsp, ea_namelist,
+                                            ea_namelist_size);
        }
 
        if (sizeret == -1) {