From: Jeremy Allison Date: Fri, 18 Mar 2022 18:51:00 +0000 (-0700) Subject: s3: VFS: vxfs: All calls to SMB_VFS_FSTAT(fsp, &fsp->fsp_name->st) clobber fsp->fsp_n... X-Git-Tag: tevent-0.12.0~275 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=d460118be3ad2a3100bb3458f6f0223df12f7c3f;p=thirdparty%2Fsamba.git s3: VFS: vxfs: 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/modules/vfs_vxfs.c b/source3/modules/vfs_vxfs.c index 75945cc476c..ddd34ba812a 100644 --- a/source3/modules/vfs_vxfs.c +++ b/source3/modules/vfs_vxfs.c @@ -407,6 +407,7 @@ static bool vxfs_compare(struct files_struct *fsp, TALLOC_CTX *mem_ctx = talloc_tos(); char *existing_buf = NULL, *new_buf = NULL, *compact_buf = NULL; int status; + NTSTATUS ntstatus; DEBUG(10, ("vfs_vxfs: Getting existing ACL for %s\n", fsp_str_dbg(fsp))); @@ -424,9 +425,10 @@ static bool vxfs_compare(struct files_struct *fsp, goto out; } - status = SMB_VFS_FSTAT(fsp, &fsp->fsp_name->st); - if (status == -1) { + ntstatus = vfs_stat_fsp(fsp); + if (!NT_STATUS_IS_OK(ntstatus)) { DEBUG(10, ("vfs_vxfs: stat failed!\n")); + errno = map_errno_from_nt_status(ntstatus); goto out; }