1
0
mirror of https://github.com/samba-team/samba.git synced 2025-03-12 20:58:37 +03:00

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 <slow@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
(cherry picked from commit 03b9ce84736d536ab2dd8a5ce1a2656e6a90c8c8)
This commit is contained in:
Ralph Boehme 2022-07-29 14:55:08 +02:00 committed by Jule Anger
parent f0a52d4337
commit ff3798ae0f
2 changed files with 4 additions and 2 deletions

View 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.

View 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;
}