smbd: update smb_fname statinfo from fsp
authorRalph Boehme <slow@samba.org>
Wed, 7 Jul 2021 10:40:05 +0000 (12:40 +0200)
committerKarolin Seeger <kseeger@samba.org>
Tue, 17 Aug 2021 09:08:36 +0000 (09:08 +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>
(cherry picked from commit b32e56d6eb29bfb5f368602edbc10d4b8bc9b4f0)

source3/smbd/files.c

index b70ce9f70e6eeac4d77c05ead1488c73df8c3a05..78629eb1d94cf229becbb2ec5d9d52e15aefb0c9 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,