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
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) {