s3: smbd: Add a new function parse_dfs_path_strict().
commit06750a9684bd9158e7f3b75a7bbce0d8e96c35ce
authorJeremy Allison <jra@samba.org>
Wed, 17 Aug 2022 21:17:23 +0000 (17 14:17 -0700)
committerJeremy Allison <jra@samba.org>
Sun, 28 Aug 2022 19:59:28 +0000 (28 19:59 +0000)
tree9a7b6942f228d98aa64ed9c67f580d2fa9b8f5b9
parent78ef185afdcecdba7da10f24b614073f47277725
s3: smbd: Add a new function parse_dfs_path_strict().

 #ifdef'ed out as not yet used. This will replace
parse_dfs_path() for all client sent names via
DFS RPC calls and for SMB_VFS_GET_DFS_REFERRALS().

The paths sent in these calls are guaranteed
to be of canonical form:

\SERVER\share\pathname.

Both for SMB1 and SMB2+ so we can be more strict
when parsing them.

 Checks DFS path starts with separator.
 Checks hostname is ours.
 Ensures servicename (share) is sent, and
    if so, terminates the name or is followed by
    \pathname.

Errors out if any checks fail.

Reserve parse_dfs_path() for DFS names sent
via "ordinary" SMB 1/2/3 calls where we must
be more lenient in parsing.

Note parse_dfs_path_strict() does not have
bool allow_broken_path or 'struct connection_struct'
as it will not be called from places that use
these.

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