summaryrefslogtreecommitdiff
path: root/source3/libsmb
diff options
context:
space:
mode:
authorGerald Carter <jerry@samba.org>2005-02-24 19:10:28 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 10:55:46 -0500
commit584c412e0a87bb73d41e260f93b9915286888ba2 (patch)
treebe9a164e2c4a14415ec4425a81a01a67d125948d /source3/libsmb
parentc3a5d90db43e6340e974f879f0c3b9c361bf3bb9 (diff)
downloadsamba-584c412e0a87bb73d41e260f93b9915286888ba2.tar.gz
samba-584c412e0a87bb73d41e260f93b9915286888ba2.tar.bz2
samba-584c412e0a87bb73d41e260f93b9915286888ba2.zip
r5542: fix a few more msdfs bugs in smbclient against both smbd and 2k dfs root
shares. (This used to be commit 5d2624c453b0bc961302edd9f2421a7c3d504d1f)
Diffstat (limited to 'source3/libsmb')
-rw-r--r--source3/libsmb/clidfs.c12
-rw-r--r--source3/libsmb/clirap.c17
2 files changed, 24 insertions, 5 deletions
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;
diff --git a/source3/libsmb/clirap.c b/source3/libsmb/clirap.c
index 6ede1b2b53..8e6742d438 100644
--- a/source3/libsmb/clirap.c
+++ b/source3/libsmb/clirap.c
@@ -655,12 +655,27 @@ BOOL cli_qpathinfo_basic( struct cli_state *cli, const char *name,
char param[sizeof(pstring)+6];
char *rparam=NULL, *rdata=NULL;
char *p;
+ pstring path;
+ int len;
+
+ /* send full paths to dfs root shares */
+
+ if ( cli->dfsroot )
+ pstr_sprintf(path, "\\%s\\%s\\%s", cli->desthost, cli->share, name );
+ else
+ pstrcpy( path, name );
+
+ /* cleanup */
+
+ len = strlen( path );
+ if ( path[len] == '\\' )
+ path[len] = '\0';
p = param;
memset(p, 0, 6);
SSVAL(p, 0, SMB_QUERY_FILE_BASIC_INFO);
p += 6;
- p += clistr_push(cli, p, name, sizeof(pstring)-6, STR_TERMINATE);
+ p += clistr_push(cli, p, path, sizeof(pstring)-6, STR_TERMINATE);
param_len = PTR_DIFF(p, param);
if (!cli_send_trans(cli, SMBtrans2,