]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
s3: smbd: DFS - Remove the last lp_posix_pathnames() from the SMB2/3 code paths.
authorJeremy Allison <jra@samba.org>
Sun, 20 Mar 2016 04:04:09 +0000 (21:04 -0700)
committerUri Simchoni <uri@samba.org>
Fri, 25 Mar 2016 12:23:48 +0000 (13:23 +0100)
lp_posix_pathnames() is only used in one place in SMB1 DFS
processing - in dealing with buggy clients, and not at all in SMB2/3.

Note that the removal of lp_posix_pathnames() in the initial detection
of path separator is a change in behavior - but the case where an
incoming DFS name *doesn't* begin with the correct separator is a client bug,
so I'm comfortable with making this change.

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Uri Simchoni <uri@samba.org>
Autobuild-User(master): Uri Simchoni <uri@samba.org>
Autobuild-Date(master): Fri Mar 25 13:23:48 CET 2016 on sn-devel-144

source3/smbd/msdfs.c

index 647ac3b80bebde2da0583afa6911966b0bf0c264..cab6ff327b647b1e415819dc7302a6058fb4fe8e 100644 (file)
@@ -82,9 +82,19 @@ static NTSTATUS parse_dfs_path(connection_struct *conn,
        eos_ptr = &pathname_local[strlen(pathname_local)];
        p = temp = pathname_local;
 
-       pdp->posix_path = (lp_posix_pathnames() && *pathname == '/');
+       /*
+        * Non-broken DFS paths *must* start with the
+        * path separator. For Windows this is always '\\',
+        * for posix paths this is always '/'.
+        */
 
-       sepchar = pdp->posix_path ? '/' : '\\';
+       if (*pathname == '/') {
+               pdp->posix_path = true;
+               sepchar = '/';
+       } else {
+               pdp->posix_path = false;
+               sepchar = '\\';
+       }
 
        if (allow_broken_path && (*pathname != sepchar)) {
                DEBUG(10,("parse_dfs_path: path %s doesn't start with %c\n",
@@ -92,6 +102,8 @@ static NTSTATUS parse_dfs_path(connection_struct *conn,
                /*
                 * Possibly client sent a local path by mistake.
                 * Try and convert to a local path.
+                * Note that this is an SMB1-only fallback
+                * to cope with known broken SMB1 clients.
                 */
 
                pdp->hostname = eos_ptr; /* "" */