From 584c412e0a87bb73d41e260f93b9915286888ba2 Mon Sep 17 00:00:00 2001 From: Gerald Carter Date: Thu, 24 Feb 2005 19:10:28 +0000 Subject: r5542: fix a few more msdfs bugs in smbclient against both smbd and 2k dfs root shares. (This used to be commit 5d2624c453b0bc961302edd9f2421a7c3d504d1f) --- source3/libsmb/clidfs.c | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) (limited to 'source3/libsmb/clidfs.c') diff --git a/source3/libsmb/clidfs.c b/source3/libsmb/clidfs.c index ea5d1d1acb..6d0d4a8edf 100644 --- a/source3/libsmb/clidfs.c +++ b/source3/libsmb/clidfs.c @@ -254,6 +254,8 @@ BOOL cli_resolve_path( struct cli_state *rootcli, const char *path, SMB_STRUCT_STAT sbuf; uint32 attributes; + *targetcli = NULL; + if ( !rootcli || !path || !targetcli ) return False; @@ -264,7 +266,7 @@ BOOL cli_resolve_path( struct cli_state *rootcli, const char *path, /* don't bother continuing if this is not a dfs root */ - if ( !rootcli->dfsroot || cli_qpathinfo_basic( rootcli, fullpath, &sbuf, &attributes ) ) { + if ( !rootcli->dfsroot || cli_qpathinfo_basic( rootcli, cleanpath, &sbuf, &attributes ) ) { *targetcli = rootcli; pstrcpy( targetpath, path ); return True; @@ -309,9 +311,11 @@ BOOL cli_resolve_path( struct cli_state *rootcli, const char *path, /* check for another dfs refeerrali, note that we are not checking for loops here */ - if ( cli_resolve_path( *targetcli, targetpath, &newcli, newpath ) ) { - *targetcli = newcli; - pstrcpy( targetpath, newpath ); + if ( !strequal( targetpath, "\\" ) ) { + if ( cli_resolve_path( *targetcli, targetpath, &newcli, newpath ) ) { + *targetcli = newcli; + pstrcpy( targetpath, newpath ); + } } return True; -- cgit