From: Ralph Boehme Date: Mon, 19 Oct 2020 18:53:48 +0000 (+0200) Subject: smbd: use fdos_mode() in setup_close_full_information() X-Git-Tag: samba-4.14.0rc1~274 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=608085af10d96547d22ff6b997a5dfdb94d4a830;p=thirdparty%2Fsamba.git smbd: use fdos_mode() in setup_close_full_information() Signed-off-by: Ralph Boehme Reviewed-by: Jeremy Allison --- diff --git a/source3/smbd/smb2_close.c b/source3/smbd/smb2_close.c index a7f1eb7ae46..229b41cd91c 100644 --- a/source3/smbd/smb2_close.c +++ b/source3/smbd/smb2_close.c @@ -163,7 +163,17 @@ static void setup_close_full_information(connection_struct *conn, uint64_t *out_end_of_file, uint32_t *out_file_attributes) { + NTSTATUS status; int ret; + + status = openat_pathref_fsp(conn->cwd_fsp, smb_fname); + if (NT_STATUS_EQUAL(status, NT_STATUS_STOPPED_ON_SYMLINK)) { + status = NT_STATUS_OK; + } + if (!NT_STATUS_IS_OK(status)) { + return; + } + if (posix_open) { ret = SMB_VFS_LSTAT(conn, smb_fname); } else { @@ -174,7 +184,7 @@ static void setup_close_full_information(connection_struct *conn, } *out_flags = SMB2_CLOSE_FLAGS_FULL_INFORMATION; - *out_file_attributes = dos_mode(conn, smb_fname); + *out_file_attributes = fdos_mode(smb_fname->fsp); *out_last_write_ts = smb_fname->st.st_ex_mtime; *out_last_access_ts = smb_fname->st.st_ex_atime; *out_creation_ts = get_create_timespec(conn, NULL, smb_fname);