]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
smbd: Use ISDOT[DOT] in can_delete_directory_fsp()
authorVolker Lendecke <vl@samba.org>
Wed, 28 Oct 2020 14:40:39 +0000 (15:40 +0100)
committerJeremy Allison <jra@samba.org>
Tue, 10 Nov 2020 19:49:33 +0000 (19:49 +0000)
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
source3/smbd/dir.c

index 6b5b4715d5460d74e537bd602ca75a3ce8826119..14ce758422b10defc943b83e09425f3c1d2871b9 100644 (file)
@@ -1776,12 +1776,9 @@ NTSTATUS can_delete_directory_fsp(files_struct *fsp)
        }
 
        while ((dname = ReadDirName(dir_hnd, &dirpos, &st, &talloced))) {
-               /* Quick check for "." and ".." */
-               if (dname[0] == '.') {
-                       if (!dname[1] || (dname[1] == '.' && !dname[2])) {
-                               TALLOC_FREE(talloced);
-                               continue;
-                       }
+               if (ISDOT(dname) || (ISDOTDOT(dname))) {
+                       TALLOC_FREE(talloced);
+                       continue;
                }
 
                if (!is_visible_file(conn,