]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
smbd: call open_pathref_fsp() in unlink_internals() in wildcard matching loop
authorRalph Boehme <slow@samba.org>
Fri, 17 Jul 2020 17:35:50 +0000 (19:35 +0200)
committerRalph Boehme <slow@samba.org>
Wed, 16 Dec 2020 09:08:31 +0000 (09:08 +0000)
Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
source3/smbd/reply.c

index ac997df2e8e745b25c693676f8a4bdf03474ceb0..6fcca84b496b96cd4f2e821f9b425cc25a066447 100644 (file)
@@ -3466,6 +3466,16 @@ NTSTATUS unlink_internals(connection_struct *conn,
                                goto out;
                        }
 
+                       status = openat_pathref_fsp(conn->cwd_fsp, f);
+                       if (!NT_STATUS_IS_OK(status) &&
+                           !NT_STATUS_EQUAL(status, NT_STATUS_STOPPED_ON_SYMLINK))
+                       {
+                               TALLOC_FREE(dir_hnd);
+                               TALLOC_FREE(frame);
+                               TALLOC_FREE(talloced);
+                               goto out;
+                       }
+
                        status = check_name(conn, f);
                        if (!NT_STATUS_IS_OK(status)) {
                                TALLOC_FREE(dir_hnd);