From 386325da318f642dd54f1b41a69e61630ea1a4e1 Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Fri, 18 Mar 2022 12:24:27 -0700 Subject: [PATCH] s3: smbd: rename_internals_fsp(). All calls to SMB_VFS_FSTAT(fsp, &fsp->fsp_name->st) clobber fsp->fsp_name->st.st_ex_iflags. 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 Reviewed-by: Ralph Boehme (cherry picked from commit b53a69f4ffcaa5ec9b8660152802f5a7b2effc1f) --- source3/smbd/reply.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/source3/smbd/reply.c b/source3/smbd/reply.c index 50730baecc7..9b6ebb029fa 100644 --- a/source3/smbd/reply.c +++ b/source3/smbd/reply.c @@ -7497,8 +7497,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); /*