From: Jeremy Allison Date: Wed, 1 Dec 2021 20:31:44 +0000 (-0800) Subject: s3: smbd: In reply_unlink() remove the possibility of receiving a wildcard name. X-Git-Tag: tdb-1.4.6~394 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=f46445cb6ae81d17a423da9ef0b2703ae755d191;p=thirdparty%2Fsamba.git s3: smbd: In reply_unlink() remove the possibility of receiving a wildcard name. This was the only user of "has_wild=true" passed to unlink_internals(). Next commit will remove this functionality from unlink_internals(). Signed-off-by: Jeremy Allison Reviewed-by: Ralph Boehme --- diff --git a/source3/smbd/reply.c b/source3/smbd/reply.c index 8ee17643200..64c386785a9 100644 --- a/source3/smbd/reply.c +++ b/source3/smbd/reply.c @@ -3543,10 +3543,8 @@ void reply_unlink(struct smb_request *req) struct smb_filename *smb_fname = NULL; uint32_t dirtype; NTSTATUS status; - uint32_t ucf_flags = UCF_ALWAYS_ALLOW_WCARD_LCOMP | - ucf_flags_from_smb_request(req); + uint32_t ucf_flags = ucf_flags_from_smb_request(req); TALLOC_CTX *ctx = talloc_tos(); - bool has_wild = false; START_PROFILE(SMBunlink); @@ -3579,22 +3577,9 @@ void reply_unlink(struct smb_request *req) goto out; } - if (!req->posix_pathnames) { - char *lcomp = get_original_lcomp(ctx, - conn, - name, - ucf_flags); - if (lcomp == NULL) { - reply_nterror(req, NT_STATUS_NO_MEMORY); - goto out; - } - has_wild = ms_has_wild(lcomp); - TALLOC_FREE(lcomp); - } - DEBUG(3,("reply_unlink : %s\n", smb_fname_str_dbg(smb_fname))); - status = unlink_internals(conn, req, dirtype, smb_fname, has_wild); + status = unlink_internals(conn, req, dirtype, smb_fname, false); if (!NT_STATUS_IS_OK(status)) { if (open_was_deferred(req->xconn, req->mid)) { /* We have re-scheduled this call. */