s3: smbd: In unlink_internals(), is_visible_file() -> is_visible_fsp().
[samba.git] / 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);