s3: smbd: rename_internals_fsp(). All calls to SMB_VFS_FSTAT(fsp, &fsp->fsp_name...
authorJeremy Allison <jra@samba.org>
Fri, 18 Mar 2022 19:24:27 +0000 (12:24 -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/smbd/reply.c

index a8bb2d5d3339b9c96aa2331c716a0851e39253cb..1677d997fe90c33a3b0fa8a2befb7837fc150c77 100644 (file)
@@ -7499,8 +7499,8 @@ NTSTATUS rename_internals_fsp(connection_struct *conn,
                         * We must set the archive bit on the newly renamed
                         * file.
                         */
-                       ret = SMB_VFS_FSTAT(fsp, &fsp->fsp_name->st);
-                       if (ret == 0) {
+                       status = vfs_stat_fsp(fsp);
+                       if (NT_STATUS_IS_OK(status)) {
                                uint32_t old_dosmode;
                                old_dosmode = fdos_mode(fsp);
                                /*