]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
s3:smbd:trans2.c - add twrp to tmp smb_fname in smbd_do_qfsinfo
authorAndrew Walker <awalker@ixsystems.com>
Tue, 8 Dec 2020 15:36:10 +0000 (10:36 -0500)
committerNoel Power <npower@samba.org>
Tue, 15 Dec 2020 15:32:18 +0000 (15:32 +0000)
Preserve VSS-related timestamp in temporary smb_filename before
calling vfs_stat_fn() in smbd_do_qfsinfo. Otherwise, we can fail
here on smb2_getinfo requests if file does not exist outside of
shadow copy path.

Signed-off-by: Andrew Walker <awalker@ixsystems.com>
Reviewed-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Noel Power <npower@samba.org>
Autobuild-User(master): Noel Power <npower@samba.org>
Autobuild-Date(master): Tue Dec 15 15:32:18 UTC 2020 on sn-devel-184

source3/smbd/trans2.c

index f6e261ed658e54a5a4ec4f9a455684f2238d20c5..5dac5f0f265e9ebdd62fb9a1ec46d00b0821db42 100644 (file)
@@ -3616,8 +3616,11 @@ NTSTATUS smbd_do_qfsinfo(struct smbXsrv_connection *xconn,
 
        DEBUG(3,("smbd_do_qfsinfo: level = %d\n", info_level));
 
-       ZERO_STRUCT(smb_fname);
-       smb_fname.base_name = discard_const_p(char, filename);
+       smb_fname = (struct smb_filename) {
+               .base_name = discard_const_p(char, filename),
+               .flags = fname ? fname->flags : 0,
+               .twrp = fname ? fname->twrp : 0,
+       };
 
        if(info_level != SMB_FS_QUOTA_INFORMATION
           && SMB_VFS_STAT(conn, &smb_fname) != 0) {