]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
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)
committerVolker Lendecke <vl@samba.org>
Wed, 10 Aug 2022 15:32:35 +0000 (15: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>
source3/smbd/dosmode.c
source3/smbd/open.c

index b8ceb8e148ff23d949639f951db8208ecaea8fb5..5fc130ac66992b6e1e7f3decc16f288e250386dc 100644 (file)
@@ -727,7 +727,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 093f9b1725754a099e4d7a8fe07e919b1a7d08b4..42e0955f937a1ab25c906dd2d952affea612c15e 100644 (file)
@@ -3615,7 +3615,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;
                        }