]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
s3: smbd: Add a comment explaing why dfs_filename_convert() must continue to use...
authorJeremy Allison <jra@samba.org>
Wed, 17 Aug 2022 21:23:45 +0000 (14:23 -0700)
committerJeremy Allison <jra@samba.org>
Sun, 28 Aug 2022 19:59:28 +0000 (19:59 +0000)
libsmbclient libraries will always set the FLAGS2_DFS_PATHNAMES
bit when talking to a DFS share, but don't always canonicalize
the incoming pathname to a DFS one (see the code for cli_list()
that puts a non-DFS pathname into SMB2trans2_FindFirst for
example). This is a problem in our client libraries for both
SMB1 and SMB2+

As we still must cope with these older clients we must
keep the lenient parsing for DFS filenames sent over SMB1/2/3.

A future task - change the use of parse_dfs_path() in
dfs_filename_convert() to parse_dfs_path_strict() for SMB2
only and then try and get all our torture tests to pass.
This is not an easy fix (and would still break old clients
out there as well :-( ).

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

index 2c2ad8ea82573571914aaab28b95624173c715a0..7aa5531e1c2687f97238cb1092ed5c0841203f19 100644 (file)
@@ -1131,6 +1131,16 @@ NTSTATUS dfs_filename_convert(TALLOC_CTX *ctx,
        char *reqpath = NULL;
        NTSTATUS status;
 
+       /*
+        * We must use the non-strict version of parse_dfs_path for
+        * pathnames sent to the fileserver over SMB1/2/3.
+        * libsmbclient callers always set the FLAGS2_DFS_PATHNAMES
+        * but then don't send a DFS path in (for example) FindFirst
+        * or other calls. This is a problem with our client libraries
+        * for both SMB1 and SMB2+ and will remain so whilst broken
+        * versions of libsmbclient are being used.
+        */
+
        status = parse_dfs_path(ctx,
                                conn,
                                dfs_path_in,