From 146f7bf4fbc06661c821f897303f777671eccf14 Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Fri, 4 Jun 2021 11:58:39 -0700 Subject: [PATCH] s3: smbd: In unlink_internals(), is_visible_file() -> is_visible_fsp(). Signed-off-by: Jeremy Allison Reviewed-by: Ralph Boehme --- source3/smbd/reply.c | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/source3/smbd/reply.c b/source3/smbd/reply.c index 44747408256..8027a868706 100644 --- a/source3/smbd/reply.c +++ b/source3/smbd/reply.c @@ -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); -- 2.34.1