summaryrefslogtreecommitdiff
path: root/source3/smbd
diff options
context:
space:
mode:
authorJeremy Allison <jra@samba.org>2006-07-12 03:02:33 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 11:19:16 -0500
commit725d88b6d460f6495ee3117a8124d30115cf37fe (patch)
treeb822dc8c0acbac72a308877e82fb14af1570bfca /source3/smbd
parent760671b0e2b5b169a6563783c3c10f3031bb7c9e (diff)
downloadsamba-725d88b6d460f6495ee3117a8124d30115cf37fe.tar.gz
samba-725d88b6d460f6495ee3117a8124d30115cf37fe.tar.bz2
samba-725d88b6d460f6495ee3117a8124d30115cf37fe.zip
r16968: The function parse_processed_dfs_path() is dependent on the
fact that check_path_syntax() will convert '\\' characters to '/'. When POSIX pathnames have been selected this doesn't happen, so we must look for the unaltered separator of '\\' instead of the modified '/'. Stevef please check this with the CIFSFS MS-DFS code ! Jeremy (This used to be commit 883bb398e58f54ee79160487b49b79a4774ef939)
Diffstat (limited to 'source3/smbd')
-rw-r--r--source3/smbd/msdfs.c16
1 files changed, 11 insertions, 5 deletions
diff --git a/source3/smbd/msdfs.c b/source3/smbd/msdfs.c
index 69da4194fd..b698bc781d 100644
--- a/source3/smbd/msdfs.c
+++ b/source3/smbd/msdfs.c
@@ -73,26 +73,32 @@ static BOOL parse_dfs_path(char *pathname, struct dfs_path *pdp)
}
/**********************************************************************
- Parse the pathname of the form /hostname/service/reqpath
- into the dfs_path structure
+ Parse the pathname of the form /hostname/service/reqpath
+ into the dfs_path structure
+ This code is dependent on the fact that check_path_syntax() will
+ convert '\\' characters to '/'.
+ When POSIX pathnames have been selected this doesn't happen, so we
+ must look for the unaltered separator of '\\' instead of the modified '/'.
+ JRA.
**********************************************************************/
static BOOL parse_processed_dfs_path(char* pathname, struct dfs_path *pdp, BOOL allow_wcards)
{
pstring pathname_local;
char *p,*temp;
+ const char sepchar = lp_posix_pathnames() ? '\\' : '/';
pstrcpy(pathname_local,pathname);
p = temp = pathname_local;
ZERO_STRUCTP(pdp);
- trim_char(temp,'/','/');
+ trim_char(temp,sepchar,sepchar);
DEBUG(10,("temp in parse_processed_dfs_path: .%s. after trimming \\'s\n",temp));
/* now tokenize */
/* parse out hostname */
- p = strchr_m(temp,'/');
+ p = strchr_m(temp,sepchar);
if(p == NULL) {
return False;
}
@@ -102,7 +108,7 @@ static BOOL parse_processed_dfs_path(char* pathname, struct dfs_path *pdp, BOOL
/* parse out servicename */
temp = p+1;
- p = strchr_m(temp,'/');
+ p = strchr_m(temp,sepchar);
if(p == NULL) {
pstrcpy(pdp->servicename,temp);
pdp->reqpath[0] = '\0';