]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
smbd: use fdos_mode() in setup_close_full_information()
authorRalph Boehme <slow@samba.org>
Mon, 19 Oct 2020 18:53:48 +0000 (20:53 +0200)
committerRalph Boehme <slow@samba.org>
Wed, 16 Dec 2020 09:08:32 +0000 (09:08 +0000)
Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
source3/smbd/smb2_close.c

index a7f1eb7ae4679a9e411589eed25a4c3dcd2e536e..229b41cd91c3d002a1792cb4d4fa7a712f79d57c 100644 (file)
@@ -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);