From: Jeremy Allison Date: Thu, 11 Aug 2022 04:49:51 +0000 (-0700) Subject: s3: smbd: Now parse_dfs_path() is only called from dfs_filename_convert() replace... X-Git-Tag: talloc-2.4.0~1244 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=5f0efdfe3cb3b267f09677659bd0149975382356;p=thirdparty%2Fsamba.git s3: smbd: Now parse_dfs_path() is only called from dfs_filename_convert() replace allow_broken_path with an SMB1 check. dfs_filename_convert() always sets allow_broken_path = !smb2, so just move this bool inside of parse_dfs_path(). We can now remove allow_broken_path. Signed-off-by: Jeremy Allison Reviewed-by: Ralph Boehme --- diff --git a/source3/smbd/msdfs.c b/source3/smbd/msdfs.c index a79bcff5197..988f6ee7ed5 100644 --- a/source3/smbd/msdfs.c +++ b/source3/smbd/msdfs.c @@ -253,6 +253,7 @@ static NTSTATUS parse_dfs_path(TALLOC_CTX *ctx, char *reqpath = NULL; char *eos_ptr = NULL; bool servicename_matches = false; + bool using_smb1 = !conn->sconn->using_smb2; pathname_local = talloc_strdup(ctx, pathname); if (pathname_local == NULL) { @@ -271,11 +272,16 @@ static NTSTATUS parse_dfs_path(TALLOC_CTX *ctx, p = pathname_local; /* - * Non-broken DFS paths *must* start with the - * path separator '/'. + * SMB1 DFS paths sent to the fileserver should start with + * the path separator '/'. However, libsmbclient libraries + * will set the DFS bit on SMB1 calls and then send non-DFS + * paths. We must cope with this. + * + * Note SMB2 paths sent to the fileserver never start with + * the path separator '/'. */ - if (allow_broken_path && (*p != '/')) { + if (using_smb1 && (*p != '/')) { DBG_ERR("path %s doesn't start with /\n", p); /* * Possibly client sent a local path by mistake.