]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
s3: smbd: In unlink_internals(), is_visible_file() -> is_visible_fsp().
authorJeremy Allison <jra@samba.org>
Fri, 4 Jun 2021 18:58:39 +0000 (11:58 -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/reply.c

index 44747408256862cca1b941ff71a4f7d7ee85cff2..8027a868706f39c67f52e8dd6d326c564a54e14e 100644 (file)
@@ -3410,18 +3410,14 @@ NTSTATUS unlink_internals(connection_struct *conn,
                        char *p = NULL;
                        struct smb_filename *f = NULL;
 
-                       if (!is_visible_file(conn,
-                                       dir_hnd,
-                                       dname,
-                                       &smb_fname->st,
-                                       true)) {
+                       /* Quick check for "." and ".." */
+                       if (ISDOT(dname) || ISDOTDOT(dname)) {
                                TALLOC_FREE(frame);
                                TALLOC_FREE(talloced);
                                continue;
                        }
 
-                       /* Quick check for "." and ".." */
-                       if (ISDOT(dname) || ISDOTDOT(dname)) {
+                       if (IS_VETO_PATH(conn, dname)) {
                                TALLOC_FREE(frame);
                                TALLOC_FREE(talloced);
                                continue;
@@ -3485,6 +3481,12 @@ NTSTATUS unlink_internals(connection_struct *conn,
                                goto out;
                        }
 
+                       if (!is_visible_fsp(f->fsp, false)) {
+                               TALLOC_FREE(frame);
+                               TALLOC_FREE(talloced);
+                               continue;
+                       }
+
                        status = check_name(conn, f);
                        if (!NT_STATUS_IS_OK(status)) {
                                TALLOC_FREE(dir_hnd);