s3: smbd: Inside 'struct uc_state', remove allow_wcard_last_component.
authorJeremy Allison <jra@samba.org>
Fri, 3 Dec 2021 19:33:42 +0000 (11:33 -0800)
committerRalph Boehme <slow@samba.org>
Sat, 11 Dec 2021 07:17:29 +0000 (07:17 +0000)
This is never allowed.

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

index 5988396ee130e479f899f751ab0897b45a2ecdfa..fe3db77c862a20537032bea5f103311097b66979 100644 (file)
@@ -538,7 +538,6 @@ struct uc_state {
        bool component_was_mangled;
        bool name_has_wildcard;
        bool posix_pathnames;
-       bool allow_wcard_last_component;
        bool done;
        bool case_sensitive;
        bool case_preserve;
@@ -896,7 +895,7 @@ static NTSTATUS unix_convert_step(struct uc_state *state)
                        return NT_STATUS_OBJECT_NAME_INVALID;
                }
                return determine_path_error(state->end+1,
-                                           state->allow_wcard_last_component,
+                                           false,
                                            state->posix_pathnames);
        }
 
@@ -988,7 +987,6 @@ NTSTATUS unix_convert(TALLOC_CTX *mem_ctx,
                .orig_path = orig_path,
                .ucf_flags = ucf_flags,
                .posix_pathnames = (ucf_flags & UCF_POSIX_PATHNAMES),
-               .allow_wcard_last_component = (ucf_flags & UCF_ALWAYS_ALLOW_WCARD_LCOMP),
                .case_sensitive = conn->case_sensitive,
                .case_preserve = conn->case_preserve,
                .short_case_preserve = conn->short_case_preserve,
@@ -1074,7 +1072,7 @@ NTSTATUS unix_convert(TALLOC_CTX *mem_ctx,
                        status = NT_STATUS_OBJECT_NAME_INVALID;
                } else {
                        status =determine_path_error(&state->orig_path[2],
-                           state->allow_wcard_last_component,
+                           false,
                            state->posix_pathnames);
                }
                goto err;
@@ -1201,7 +1199,7 @@ 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 && !state->allow_wcard_last_component) {
+               if (state->name_has_wildcard) {
                        /* Wildcard not valid anywhere. */
                        status = NT_STATUS_OBJECT_NAME_INVALID;
                        goto fail;