From 94dea7a26c2f4cd4e7ca0a6913cbcbb4b0e6e881 Mon Sep 17 00:00:00 2001 From: Ralph Boehme Date: Fri, 17 Jul 2020 19:35:50 +0200 Subject: [PATCH] smbd: call open_pathref_fsp() in unlink_internals() in wildcard matching loop Signed-off-by: Ralph Boehme Reviewed-by: Jeremy Allison --- source3/smbd/reply.c | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/source3/smbd/reply.c b/source3/smbd/reply.c index ac997df2e8e..6fcca84b496 100644 --- a/source3/smbd/reply.c +++ b/source3/smbd/reply.c @@ -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); -- 2.47.3