smbd: use metadata_fsp() with SMB_VFS_FGET_DOS_ATTRIBUTES()
authorRalph Boehme <slow@samba.org>
Fri, 29 Jul 2022 12:55:08 +0000 (14:55 +0200)
committerJule Anger <janger@samba.org>
Tue, 6 Sep 2022 06:32:13 +0000 (06:32 +0000)
BUG: https://bugzilla.samba.org/show_bug.cgi?id=15126
MR: https://gitlab.com/samba-team/samba/-/merge_requests/2643

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
(cherry picked from commit 03b9ce84736d536ab2dd8a5ce1a2656e6a90c8c8)

source3/smbd/dosmode.c
source3/smbd/open.c

index c62b03687579a8e3c99ca486383de9154262aaa1..d50dfd4989b5fadbb381cf7119a2e3fb65212758 100644 (file)
@@ -754,7 +754,8 @@ uint32_t fdos_mode(struct files_struct *fsp)
        }
 
        /* Get the DOS attributes via the VFS if we can */
-       status = SMB_VFS_FGET_DOS_ATTRIBUTES(fsp->conn, fsp, &result);
+       status = SMB_VFS_FGET_DOS_ATTRIBUTES(
+               fsp->conn, metadata_fsp(fsp), &result);
        if (!NT_STATUS_IS_OK(status)) {
                /*
                 * Only fall back to using UNIX modes if we get NOT_IMPLEMENTED.
index 90a2427e96fc48ede6bde913a93f442b01d5d023..d2a4b521d895339865ee5b85f2b10e0cc9cd1806 100644 (file)
@@ -3566,7 +3566,8 @@ static NTSTATUS open_file_ntcreate(connection_struct *conn,
                         */
                        uint32_t attr = 0;
 
-                       status = SMB_VFS_FGET_DOS_ATTRIBUTES(conn, smb_fname->fsp, &attr);
+                       status = SMB_VFS_FGET_DOS_ATTRIBUTES(
+                               conn, metadata_fsp(smb_fname->fsp), &attr);
                        if (NT_STATUS_IS_OK(status)) {
                                existing_dos_attributes = attr;
                        }