svn commit: samba r16969 - in trunk/source/smbd: .

jra at samba.org jra at samba.org
Wed Jul 12 03:02:36 GMT 2006


Author: jra
Date: 2006-07-12 03:02:35 +0000 (Wed, 12 Jul 2006)
New Revision: 16969

WebSVN: http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=rev&root=samba&rev=16969

Log:
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

Modified:
   trunk/source/smbd/msdfs.c


Changeset:
Modified: trunk/source/smbd/msdfs.c
===================================================================
--- trunk/source/smbd/msdfs.c	2006-07-12 03:02:33 UTC (rev 16968)
+++ trunk/source/smbd/msdfs.c	2006-07-12 03:02:35 UTC (rev 16969)
@@ -73,26 +73,32 @@
 }
 
 /**********************************************************************
-  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 @@
 
 	/* 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';



More information about the samba-cvs mailing list