From: Jeremy Allison Date: Fri, 18 Mar 2022 19:24:27 +0000 (-0700) Subject: s3: smbd: rename_internals_fsp(). All calls to SMB_VFS_FSTAT(fsp, &fsp->fsp_name... X-Git-Tag: tevent-0.12.0~267 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=b53a69f4ffcaa5ec9b8660152802f5a7b2effc1f;p=thirdparty%2Fsamba.git 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 --- diff --git a/source3/smbd/reply.c b/source3/smbd/reply.c index a8bb2d5d333..1677d997fe9 100644 --- a/source3/smbd/reply.c +++ b/source3/smbd/reply.c @@ -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); /*