From: Volker Lendecke Date: Mon, 23 Oct 2023 14:40:55 +0000 (+0200) Subject: smbd: Make a fake file's stat a valid regular file X-Git-Tag: talloc-2.4.2~829 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=6c3c37cf2092615375ad3fb6a06505a4d1363eb0;p=thirdparty%2Fsamba.git smbd: Make a fake file's stat a valid regular file We'll add strict checks to only open IFDIR and IFREG soon. Signed-off-by: Volker Lendecke Reviewed-by: Ralph Boehme --- diff --git a/source3/smbd/filename.c b/source3/smbd/filename.c index 9f4ae7b5c81..a37d0709d0f 100644 --- a/source3/smbd/filename.c +++ b/source3/smbd/filename.c @@ -953,7 +953,10 @@ static NTSTATUS filename_convert_dirfsp_nosymlink( if (smb_fname == NULL) { return NT_STATUS_NO_MEMORY; } - smb_fname->st = (SMB_STRUCT_STAT) { .st_ex_nlink = 1 }; + smb_fname->st = (SMB_STRUCT_STAT){ + .st_ex_nlink = 1, + .st_ex_mode = S_IFREG | 0644, + }; smb_fname->st.st_ex_btime = (struct timespec){0, SAMBA_UTIME_OMIT}; smb_fname->st.st_ex_atime =