]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
s3: smbd: Change recursive_rmdir(), is_visible_file() -> is_visible_fsp().
authorJeremy Allison <jra@samba.org>
Thu, 3 Jun 2021 00:42:27 +0000 (17:42 -0700)
committerRalph Boehme <slow@samba.org>
Wed, 9 Jun 2021 13:14:30 +0000 (13:14 +0000)
Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
source3/smbd/close.c

index 7c38a79e9d76939bc9a293b6fa5c3d88d6073887..38965f679879c0d79575661e7e1b9866b4536e62 100644 (file)
@@ -877,15 +877,6 @@ bool recursive_rmdir(TALLOC_CTX *ctx,
                        continue;
                }
 
-               if (!is_visible_file(conn,
-                                       dir_hnd,
-                                       dname,
-                                       &st,
-                                       false)) {
-                       TALLOC_FREE(talloced);
-                       continue;
-               }
-
                /* Construct the full name. */
                fullname = talloc_asprintf(ctx,
                                "%s/%s",
@@ -931,6 +922,14 @@ bool recursive_rmdir(TALLOC_CTX *ctx,
                        goto err_break;
                }
 
+               if (!is_visible_fsp(atname->fsp, false)) {
+                       TALLOC_FREE(smb_dname_full);
+                       TALLOC_FREE(fullname);
+                       TALLOC_FREE(talloced);
+                       TALLOC_FREE(atname);
+                       continue;
+               }
+
                retval = SMB_VFS_UNLINKAT(conn,
                                          dirfsp,
                                          atname,