]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
s3: smbd: In SMBntrename (0xa5) prevent wildcards in destination name.
authorJeremy Allison <jra@samba.org>
Thu, 2 Dec 2021 00:08:13 +0000 (16:08 -0800)
committerRalph Boehme <slow@samba.org>
Thu, 9 Dec 2021 18:06:35 +0000 (18:06 +0000)
Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
source3/smbd/nttrans.c

index f381714e12904d4993fd901b13feba24e13c2395..254559fec8f00a0b9046ba54240279e034968efb 100644 (file)
@@ -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 ':'. */