From c4ea95fd303ae6fd51d125e756c1289f440adbd2 Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Thu, 8 Mar 2007 02:51:41 +0000 Subject: 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) --- source3/smbd/msdfs.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'source3/smbd/msdfs.c') 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; } -- cgit