s3: VFS: vxfs: All calls to SMB_VFS_FSTAT(fsp, &fsp->fsp_name->st) clobber fsp->fsp_n...
authorJeremy Allison <jra@samba.org>
Fri, 18 Mar 2022 18:51:00 +0000 (11:51 -0700)
committerJule Anger <janger@samba.org>
Mon, 11 Apr 2022 08:32:10 +0000 (08:32 +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>
(cherry picked from commit d460118be3ad2a3100bb3458f6f0223df12f7c3f)

source3/modules/vfs_vxfs.c

index 75945cc476cfc6b6c38f0b7071c844e3b25f72ef..ddd34ba812a0401d1133eec543297a893c093c1e 100644 (file)
@@ -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;
        }