]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
s3: smbd: mdssvc: All calls to SMB_VFS_FSTAT(fsp, &fsp->fsp_name->st) clobber fsp...
authorJeremy Allison <jra@samba.org>
Fri, 18 Mar 2022 18:56:53 +0000 (11:56 -0700)
committerJeremy Allison <jra@samba.org>
Thu, 24 Mar 2022 16:28:37 +0000 (16:28 +0000)
If doing an SMB_VFS_FSTAT() returning onto the stat struct stored in the fsp,
we must call vfs_stat_fsp() as this preserves the iflags.

BUG: https://bugzilla.samba.org/show_bug.cgi?id=15022

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
source3/rpc_server/mdssvc/mdssvc.c

index fa31b55a183fd61b33e233ecd07ebb15e98048b8..956e097eaf4bfad1f023f3761b7a5d4deec50106 100644 (file)
@@ -1354,13 +1354,13 @@ static bool slrpc_fetch_attributes(struct mds_ctx *mds_ctx,
                        return true;
                }
 
-               result = SMB_VFS_FSTAT(smb_fname->fsp, &smb_fname->st);
-               if (result != 0) {
+               status = vfs_stat_fsp(smb_fname->fsp);
+               if (!NT_STATUS_IS_OK(status)) {
                        TALLOC_FREE(smb_fname);
                        return true;
                }
 
-               sp = &smb_fname->st;
+               sp = &smb_fname->fsp->fsp_name->st;
        }
 
        ok = add_filemeta(mds_ctx, reqinfo, fm_array, path, sp);