vfs_preopen: make use of any hints from samba_path_matching_check_last_component()
authorStefan Metzmacher <metze@samba.org>
Fri, 11 Jun 2021 21:08:19 +0000 (21:08 +0000)
committerStefan Metzmacher <metze@samba.org>
Thu, 1 Jul 2021 13:02:31 +0000 (13:02 +0000)
commit430cbfc7918939fde22d8da2327451b6801173bd
treeeeb2259155804c928c4b988167b72e024197cd70
parente51a2e6e4ee5409a61b2adb069561fcf40da3818
vfs_preopen: make use of any hints from samba_path_matching_check_last_component()

samba_path_matching_check_last_component() may return the start and end
offset of a submatch (for us the bytes where the digits are expected).

We use that in order to allow preopen_parse_fname() to just
look at these bytes and ignore any trailing digits after the submatch.

For the current use of samba_path_matching_mswild_create(),
there's no difference as we'll always get replace_start=-1 and
replace_end=-1. But the next commit will make optional use of
samba_path_matching_regex_sub1_create(), which will change the situation
and allow to return hints we got from regexec().

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
source3/modules/vfs_preopen.c