From: Noel Power Date: Fri, 29 Jan 2021 14:53:43 +0000 (+0000) Subject: s3/smbd: use SMB_VFS_FLISTXATTR() alone (also added assert fsp is not NULL) X-Git-Tag: tevent-0.11.0~1721 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=6d353212a5a9430b14c6fa239b206b7c6909b834;p=thirdparty%2Fsamba.git s3/smbd: use SMB_VFS_FLISTXATTR() alone (also added assert fsp is not NULL) Signed-off-by: Noel Power Reviewed-by: Ralph Boehme Reviewed-by: Jeremy Allison --- diff --git a/source3/smbd/trans2.c b/source3/smbd/trans2.c index 6ac33f8e0b6..c3344b2b105 100644 --- a/source3/smbd/trans2.c +++ b/source3/smbd/trans2.c @@ -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) {