From: Ralph Boehme Date: Fri, 29 Jul 2022 12:55:08 +0000 (+0200) Subject: smbd: use metadata_fsp() with SMB_VFS_FGET_DOS_ATTRIBUTES() X-Git-Tag: samba-4.15.10~19 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=ff3798ae0ff2219b366b40d02a97f220b834ada0;p=thirdparty%2Fsamba.git smbd: use metadata_fsp() with SMB_VFS_FGET_DOS_ATTRIBUTES() 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 Reviewed-by: Volker Lendecke (cherry picked from commit 03b9ce84736d536ab2dd8a5ce1a2656e6a90c8c8) --- diff --git a/source3/smbd/dosmode.c b/source3/smbd/dosmode.c index c62b0368757..d50dfd4989b 100644 --- a/source3/smbd/dosmode.c +++ b/source3/smbd/dosmode.c @@ -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. diff --git a/source3/smbd/open.c b/source3/smbd/open.c index 90a2427e96f..d2a4b521d89 100644 --- a/source3/smbd/open.c +++ b/source3/smbd/open.c @@ -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; }