From: Jeremy Allison Date: Thu, 2 Dec 2021 00:08:13 +0000 (-0800) Subject: s3: smbd: In SMBntrename (0xa5) prevent wildcards in destination name. X-Git-Tag: tdb-1.4.6~389 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=ff4bbb1279a383ae0965601d89a6fb41d3cdd9c4;p=thirdparty%2Fsamba.git s3: smbd: In SMBntrename (0xa5) prevent wildcards in destination name. Signed-off-by: Jeremy Allison Reviewed-by: Ralph Boehme --- diff --git a/source3/smbd/nttrans.c b/source3/smbd/nttrans.c index f381714e129..254559fec8f 100644 --- a/source3/smbd/nttrans.c +++ b/source3/smbd/nttrans.c @@ -1771,6 +1771,11 @@ void reply_ntrename(struct smb_request *req) goto out; } + if (!req->posix_pathnames && ms_has_wild(newname)) { + reply_nterror(req, NT_STATUS_OBJECT_PATH_SYNTAX_BAD); + goto out; + } + if (!req->posix_pathnames) { /* The newname must begin with a ':' if the oldname contains a ':'. */