s3: smbd: Inside unix_convert(), never set state->name_is_wildcard.
authorJeremy Allison <jra@samba.org>
Fri, 3 Dec 2021 20:53:36 +0000 (12:53 -0800)
committerRalph Boehme <slow@samba.org>
Sat, 11 Dec 2021 07:17:29 +0000 (07:17 +0000)
We error out immediately if it's set anyway.
Preparing to remove 'state->name_is_wildcard' structure element.

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
source3/smbd/filename.c

index 995547aecaa74651cf91cd0c63817820e3ec3789..266815d540eeb40b7eb52819a9e711cdd205f744 100644 (file)
@@ -1152,8 +1152,8 @@ NTSTATUS unix_convert(TALLOC_CTX *mem_ctx,
 
        if (!state->posix_pathnames) {
                /* POSIX pathnames have no wildcards. */
-               state->name_has_wildcard = ms_has_wild(state->smb_fname->base_name);
-               if (state->name_has_wildcard) {
+               bool name_has_wildcard = ms_has_wild(state->smb_fname->base_name);
+               if (name_has_wildcard) {
                        /* Wildcard not valid anywhere. */
                        status = NT_STATUS_OBJECT_NAME_INVALID;
                        goto fail;