]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
s3: smbd: Now parse_dfs_path() is only called from dfs_filename_convert() replace...
authorJeremy Allison <jra@samba.org>
Thu, 11 Aug 2022 04:49:51 +0000 (21:49 -0700)
committerJeremy Allison <jra@samba.org>
Sun, 28 Aug 2022 19:59:28 +0000 (19:59 +0000)
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 <jra@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
source3/smbd/msdfs.c

index a79bcff519711c7a163f7baa75d1f288a01c0b76..988f6ee7ed5a73c050203fa33ece33bc36cdd5f2 100644 (file)
@@ -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.