s3: smbd: non_widelink_open(). All calls to SMB_VFS_FSTAT(fsp, &fsp->fsp_name->st...
authorJeremy Allison <jra@samba.org>
Fri, 18 Mar 2022 19:09:43 +0000 (12:09 -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 18694c81cc3c3d94dc99e3b11878021052279eb6)

source3/smbd/open.c

index ad0fcb8ac6f969b170fc55e6ca4152caf3d4b50a..1a07e122db2cad84a2214c1e38cab0d0c5f6d313 100644 (file)
@@ -779,9 +779,8 @@ static NTSTATUS non_widelink_open(const struct files_struct *dirfsp,
        fsp_set_fd(fsp, fd);
 
        if (fd != -1) {
-               ret = SMB_VFS_FSTAT(fsp, &fsp->fsp_name->st);
-               if (ret != 0) {
-                       status = map_nt_error_from_unix(errno);
+               status = vfs_stat_fsp(fsp);
+               if (!NT_STATUS_IS_OK(status)) {
                        goto out;
                }
                orig_fsp_name->st = fsp->fsp_name->st;