]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
smbd: Turn file type handling in fdos_mode into a switch
authorVolker Lendecke <vl@samba.org>
Fri, 5 Jul 2024 15:56:40 +0000 (17:56 +0200)
committerJeremy Allison <jra@samba.org>
Fri, 12 Jul 2024 20:35:34 +0000 (20:35 +0000)
There will be more cases soon

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
source3/smbd/dosmode.c

index d7999775c262665edd287a51e3b41f279b3b87d1..d0ce6767b9c382193b396b665ec271e973917f51 100644 (file)
@@ -713,8 +713,12 @@ uint32_t fdos_mode(struct files_struct *fsp)
                return 0;
        }
 
-       if (S_ISLNK(fsp->fsp_name->st.st_ex_mode)) {
+       switch (fsp->fsp_name->st.st_ex_mode & S_IFMT) {
+       case S_IFLNK:
                return FILE_ATTRIBUTE_NORMAL;
+               break;
+       default:
+               break;
        }
 
        if (fsp->fsp_name->st.cached_dos_attributes != FILE_ATTRIBUTE_INVALID) {