Previously this didn't actually restrict wildcards here, as check_path_syntax_wcard()
returns the fact there was a wildcard in the last component, but doesn't
return an error. Just use check_path_syntax() instead and check
for wildcards separately.
Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
if (pdp->posix_path) {
status = check_path_syntax_posix(pdp->reqpath);
} else {
- if (allow_wcards) {
- status = check_path_syntax_wcard(pdp->reqpath,
- ppath_contains_wcard);
- } else {
- status = check_path_syntax(pdp->reqpath);
+ if (!allow_wcards) {
+ bool has_wcard = ms_has_wild(pdp->reqpath);
+ if (has_wcard) {
+ return NT_STATUS_INVALID_PARAMETER;
+ }
}
+ status = check_path_syntax(pdp->reqpath);
}
if (!NT_STATUS_IS_OK(status)) {