]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
smbd: Simplify dos_mode_msdfs()
authorVolker Lendecke <vl@samba.org>
Tue, 6 Dec 2022 09:54:48 +0000 (10:54 +0100)
committerJeremy Allison <jra@samba.org>
Mon, 12 Dec 2022 21:16:33 +0000 (21:16 +0000)
Use ISDOT[DOT]

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

index 2e3aa0934a7b804d38a17e34e8090c3f271e10fa..4168eb209c746aea2d298bc3b16cfe23eba55d05 100644 (file)
@@ -554,8 +554,7 @@ uint32_t dos_mode_msdfs(connection_struct *conn,
                }
 
                /* Only . and .. are not hidden. */
-               if (p[0] == '.' && !((p[1] == '\0') ||
-                               (p[1] == '.' && p[2] == '\0'))) {
+               if ((p[0] == '.') && !(ISDOT(p) || ISDOTDOT(p))) {
                        result |= FILE_ATTRIBUTE_HIDDEN;
                }
        }