summaryrefslogtreecommitdiff
path: root/source3/smbd/msdfs.c
diff options
context:
space:
mode:
authorJeremy Allison <jra@samba.org>2016-03-19 21:04:09 -0700
committerUri Simchoni <uri@samba.org>2016-03-25 13:23:48 +0100
commitfca78dddb428b89b01317e47a0db34124dda555e (patch)
treec0e0832fd507e86258727a37045fb726c467fcfc /source3/smbd/msdfs.c
parentc51b8c22349bde6a3280c51ac147cab5ea27b5a6 (diff)
downloadsamba-fca78dddb428b89b01317e47a0db34124dda555e.tar.gz
s3: smbd: DFS - Remove the last lp_posix_pathnames() from the SMB2/3 code paths.
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
Diffstat (limited to 'source3/smbd/msdfs.c')
-rw-r--r--source3/smbd/msdfs.c16
1 files changed, 14 insertions, 2 deletions
diff --git a/source3/smbd/msdfs.c b/source3/smbd/msdfs.c
index 647ac3b80be..cab6ff327b6 100644
--- a/source3/smbd/msdfs.c
+++ b/source3/smbd/msdfs.c
@@ -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; /* "" */