summaryrefslogtreecommitdiff
path: root/source3
diff options
context:
space:
mode:
authorJeremy Allison <jra@samba.org>2007-03-08 02:51:41 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 12:18:28 -0500
commitc4ea95fd303ae6fd51d125e756c1289f440adbd2 (patch)
treeed0d66eda79258ef05164adc35103a70227d34b3 /source3
parent6e5ea70e9e0aafa39dbf8cd53238d0045f38f468 (diff)
downloadsamba-c4ea95fd303ae6fd51d125e756c1289f440adbd2.tar.gz
samba-c4ea95fd303ae6fd51d125e756c1289f440adbd2.tar.bz2
samba-c4ea95fd303ae6fd51d125e756c1289f440adbd2.zip
r21758: Fix a very specific dfs bug when passing in POSIX
pathnames. When we're working out how much we've consumed we need to backtrack by either a '/' or '\\' component, as both are valid separators. Jeremy. (This used to be commit 1722ea20db2d531f92fb18fa5783f09258727c64)
Diffstat (limited to 'source3')
-rw-r--r--source3/smbd/msdfs.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/source3/smbd/msdfs.c b/source3/smbd/msdfs.c
index 25c9c59497..c34512493f 100644
--- a/source3/smbd/msdfs.c
+++ b/source3/smbd/msdfs.c
@@ -92,7 +92,7 @@ static BOOL parse_processed_dfs_path(char* pathname, struct dfs_path *pdp, BOOL
ZERO_STRUCTP(pdp);
trim_char(temp,sepchar,sepchar);
- DEBUG(10,("temp in parse_processed_dfs_path: .%s. after trimming \\'s\n",temp));
+ DEBUG(10,("temp in parse_processed_dfs_path: .%s. after trimming /'s\n",temp));
/* now tokenize */
/* parse out hostname */
@@ -401,12 +401,15 @@ static BOOL resolve_dfs_path(TALLOC_CTX *ctx,
*/
if (consumedcntp) {
- char *q;
pstring buf;
pstrcpy(buf, dfspath);
trim_char(buf, '\0', '\\');
for (; consumed_level; consumed_level--) {
- q = strrchr_m(buf, '\\');
+ char *q, *q1, *q2;
+ /* Either '\\' or '/' may be a separator. */
+ q1 = strrchr_m(buf, '\\');
+ q2 = strrchr_m(buf, '/');
+ q = MAX(q1,q2);
if (q) {
*q = 0;
}