From: Jeremy Allison Date: Wed, 17 Aug 2022 21:23:45 +0000 (-0700) Subject: s3: smbd: Add a comment explaing why dfs_filename_convert() must continue to use... X-Git-Tag: talloc-2.4.0~1252 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=88e920491e0603821ba615a97a99069e7610a3b1;p=thirdparty%2Fsamba.git s3: smbd: Add a comment explaing why dfs_filename_convert() must continue to use parse_dfs_path(). 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 Reviewed-by: Ralph Boehme --- diff --git a/source3/smbd/msdfs.c b/source3/smbd/msdfs.c index 2c2ad8ea825..7aa5531e1c2 100644 --- a/source3/smbd/msdfs.c +++ b/source3/smbd/msdfs.c @@ -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,