]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
s3: smbd: In setup_close_full_information(), remove unneeded vfs_stat().
authorJeremy Allison <jra@samba.org>
Wed, 15 Dec 2021 18:41:39 +0000 (10:41 -0800)
committerJeremy Allison <jra@samba.org>
Thu, 16 Dec 2021 07:33:09 +0000 (07:33 +0000)
After openat_pathref_fsp() is successful we know we have a VALID_STAT().

It either returns NT_STATUS_OK or we look at the stat
struct for S_ISLNK so we know we have VALID_STAT().

If it's not successful we error out, so we don't need
another vfs_stat() here.

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
Autobuild-User(master): Jeremy Allison <jra@samba.org>
Autobuild-Date(master): Thu Dec 16 07:33:09 UTC 2021 on sn-devel-184

source3/smbd/smb2_close.c

index c218d12b6680d1f8beb6508bf933e8a8c413d9e9..648080f1a8cf4fb926b49d70a54b0e13229f2e0a 100644 (file)
@@ -163,7 +163,6 @@ static void setup_close_full_information(connection_struct *conn,
                                uint32_t *out_file_attributes)
 {
        NTSTATUS status;
-       int ret;
 
        status = openat_pathref_fsp(conn->cwd_fsp, smb_fname);
        if (NT_STATUS_EQUAL(status, NT_STATUS_OBJECT_NAME_NOT_FOUND) &&
@@ -176,11 +175,6 @@ static void setup_close_full_information(connection_struct *conn,
                return;
        }
 
-       ret = vfs_stat(conn, smb_fname);
-       if (ret != 0) {
-               return;
-       }
-
        *out_flags = SMB2_CLOSE_FLAGS_FULL_INFORMATION;
        *out_file_attributes = fdos_mode(smb_fname->fsp);
        *out_last_write_ts = smb_fname->st.st_ex_mtime;