]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
s3: smbd: call_trans2setfilepathinfo(). All calls to SMB_VFS_FSTAT(fsp, &fsp->fsp_nam...
authorJeremy Allison <jra@samba.org>
Fri, 18 Mar 2022 19:27:53 +0000 (12:27 -0700)
committerJeremy Allison <jra@samba.org>
Thu, 24 Mar 2022 16:28:37 +0000 (16:28 +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>
source3/smbd/trans2.c

index d44599ed00ac2eb53a4335f5a0e9f058325bb5ec..56b5c0db90265f976ceb00df823d3bdd029be380 100644 (file)
@@ -9333,11 +9333,12 @@ static void call_trans2setfilepathinfo(connection_struct *conn,
                        /*
                         * Original code - this is an open file.
                         */
-                       if (SMB_VFS_FSTAT(fsp, &smb_fname->st) != 0) {
+                       status = vfs_stat_fsp(fsp);
+                       if (!NT_STATUS_IS_OK(status)) {
                                DEBUG(3,("call_trans2setfilepathinfo: fstat "
                                         "of %s failed (%s)\n", fsp_fnum_dbg(fsp),
-                                        strerror(errno)));
-                               reply_nterror(req, map_nt_error_from_unix(errno));
+                                        nt_errstr(status)));
+                               reply_nterror(req, status);
                                return;
                        }
                }