diff options
author | Gerald Carter <jerry@samba.org> | 2005-02-26 14:42:55 +0000 |
---|---|---|
committer | Gerald (Jerry) Carter <jerry@samba.org> | 2007-10-10 10:55:48 -0500 |
commit | 96572957fc3df956ec0fad242fc7d04ab6a6961f (patch) | |
tree | 59379dd1ff10ce299201eae187893c0b2124c716 /source3/libsmb/clidfs.c | |
parent | 76d72a6bc62cba0111cb82b87b560255513e49c2 (diff) | |
download | samba-96572957fc3df956ec0fad242fc7d04ab6a6961f.tar.gz samba-96572957fc3df956ec0fad242fc7d04ab6a6961f.tar.xz samba-96572957fc3df956ec0fad242fc7d04ab6a6961f.zip |
r5577: get recurse; dir working across single level dfs referrals
(This used to be commit d4443807bc7a5a8615c69517365a92709db7ce29)
Diffstat (limited to 'source3/libsmb/clidfs.c')
-rw-r--r-- | source3/libsmb/clidfs.c | 53 |
1 files changed, 53 insertions, 0 deletions
diff --git a/source3/libsmb/clidfs.c b/source3/libsmb/clidfs.c index 6db6330ca6b..62b682a748d 100644 --- a/source3/libsmb/clidfs.c +++ b/source3/libsmb/clidfs.c @@ -27,6 +27,7 @@ struct client_connection { struct client_connection *prev, *next; struct cli_state *cli; + pstring mount; }; /* global state....globals reek! */ @@ -166,6 +167,54 @@ static struct cli_state *do_connect( const char *server, const char *share, return c; } +/**************************************************************************** +****************************************************************************/ + +static void cli_cm_set_mntpoint( struct cli_state *c, const char *mnt ) +{ + struct client_connection *p; + int i; + pstring path; + char *ppath; + + for ( p=connections,i=0; p; p=p->next,i++ ) { + if ( strequal(p->cli->desthost, c->desthost) && strequal(p->cli->share, c->share) ) + break; + } + + if ( p ) { + pstrcpy( p->mount, mnt ); + dos_clean_name( p->mount ); + +#if 0 + /* strip any leading '\\' */ + ppath = path; + if ( *ppath == '\\' ) + ppath++; + pstrcpy( p->mount, ppath ); +#endif + } +} + +/**************************************************************************** +****************************************************************************/ + +const char * cli_cm_get_mntpoint( struct cli_state *c ) +{ + struct client_connection *p; + int i; + + for ( p=connections,i=0; p; p=p->next,i++ ) { + if ( strequal(p->cli->desthost, c->desthost) && strequal(p->cli->share, c->share) ) + break; + } + + if ( p ) + return p->mount; + + return NULL; +} + /******************************************************************** Add a new connection to the list ********************************************************************/ @@ -186,6 +235,8 @@ static struct cli_state* cli_cm_connect( const char *server, const char *share, DLIST_ADD( connections, node ); + cli_cm_set_mntpoint( node->cli, "" ); + return node->cli; } @@ -585,6 +636,8 @@ BOOL cli_resolve_path( struct cli_state *rootcli, const char *path, return False; } + + cli_cm_set_mntpoint( *targetcli, cleanpath ); /* check for another dfs refeerrali, note that we are not checking for loops here */ |