smbd: update smb_fname statinfo from fsp
authorRalph Boehme <slow@samba.org>
Wed, 7 Jul 2021 10:40:05 +0000 (12:40 +0200)
committerRalph Boehme <slow@samba.org>
Wed, 14 Jul 2021 08:09:31 +0000 (08:09 +0000)
fd_openat() has done an FSTAT on the handle so update the smb_fname stat info
with "truth".  from the handle.

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

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

index 35419315565c9f5b57ea526ce76f4810dec42115..413706fee0c3b15c409088de3974d3c1457adb98 100644 (file)
@@ -542,6 +542,13 @@ NTSTATUS openat_pathref_fsp(const struct files_struct *dirfsp,
                goto fail;
        }
 
+       /*
+        * fd_openat() has done an FSTAT on the handle
+        * so update the smb_fname stat info with "truth".
+        * from the handle.
+        */
+       smb_fname->st = fsp->fsp_name->st;
+
        fsp->file_id = vfs_file_id_from_sbuf(conn, &fsp->fsp_name->st);
 
        status = fsp_smb_fname_link(fsp,