]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
smbd: Update fsp->fsp_flags.is_directory in vfs_stat_fsp()
authorVolker Lendecke <vl@samba.org>
Thu, 30 Jun 2022 08:45:54 +0000 (10:45 +0200)
committerRalph Boehme <slow@samba.org>
Mon, 25 Jul 2022 12:04:33 +0000 (12:04 +0000)
The type of a fsp should never change, but if this call to
vfs_stat_fsp() is the very first one on this fsp, we must update this
flag.

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
source3/smbd/vfs.c

index 1f46e9a25293d2eb80766cf3bbb65b0b16f1fe53..334814559112826ac7a5389c138c16193c4ce0c3 100644 (file)
@@ -1395,6 +1395,7 @@ NTSTATUS vfs_stat_fsp(files_struct *fsp)
                return map_nt_error_from_unix(errno);
        }
        update_stat_ex_from_saved_stat(&fsp->fsp_name->st, &saved_stat);
+       fsp->fsp_flags.is_directory = S_ISDIR(fsp->fsp_name->st.st_ex_mode);
        return NT_STATUS_OK;
 }