diff options
author | Andrew Bartlett <abartlet@samba.org> | 2003-02-24 03:28:37 +0000 |
---|---|---|
committer | Andrew Bartlett <abartlet@samba.org> | 2003-02-24 03:28:37 +0000 |
commit | 630944d179bd3b1ff877b9c52c00c3f452a2e9cf (patch) | |
tree | 1adaab9002c0faa2dbcbd2766a26614517b9c7f0 /source3/client/client.c | |
parent | a9ae0df3332270cc66cd9167564ff9ee93f23f44 (diff) | |
download | samba-630944d179bd3b1ff877b9c52c00c3f452a2e9cf.tar.gz samba-630944d179bd3b1ff877b9c52c00c3f452a2e9cf.tar.bz2 samba-630944d179bd3b1ff877b9c52c00c3f452a2e9cf.zip |
Cleint-side-auth/kerberos fixes from HEAD, and don't connect to a share
twice, let the libsmb code determine what form the share name should take.
Andrew Bartlett
(This used to be commit a25f6126647c94551c03bfc28e3fb5ec5ef6264a)
Diffstat (limited to 'source3/client/client.c')
-rw-r--r-- | source3/client/client.c | 28 |
1 files changed, 9 insertions, 19 deletions
diff --git a/source3/client/client.c b/source3/client/client.c index 4761b0ae5c..5da12fd984 100644 --- a/source3/client/client.c +++ b/source3/client/client.c @@ -41,6 +41,7 @@ static pstring password; static pstring username; static pstring workgroup; static char *cmdstr; +static BOOL got_user; static BOOL got_pass; static int io_bufsize = 64512; static BOOL use_kerberos; @@ -2433,24 +2434,9 @@ static struct cli_state *do_connect(const char *server, const char *share) if (!cli_send_tconX(c, sharename, "?????", password, strlen(password)+1)) { - pstring full_share; - - /* - * Some servers require \\server\share for the share - * while others are happy with share as we gave above - * Lets see if we give it the long form if it works - */ - pstrcpy(full_share, "\\\\"); - pstrcat(full_share, server); - pstrcat(full_share, "\\"); - pstrcat(full_share, sharename); - if (!cli_send_tconX(c, full_share, "?????", password, - strlen(password) + 1)) { - - d_printf("tree connect failed: %s\n", cli_errstr(c)); - cli_shutdown(c); - return NULL; - } + d_printf("tree connect failed: %s\n", cli_errstr(c)); + cli_shutdown(c); + return NULL; } DEBUG(4,(" tconx ok\n")); @@ -2889,6 +2875,8 @@ static void remember_query_host(const char *arg, case 'U': { char *lp; + + got_user = True; pstrcpy(username,optarg); if ((lp=strchr_m(username,'%'))) { *lp = 0; @@ -2985,7 +2973,6 @@ static void remember_query_host(const char *arg, case 'k': #ifdef HAVE_KRB5 use_kerberos = True; - got_pass = True; #else d_printf("No kerberos support compiled in\n"); exit(1); @@ -2997,6 +2984,9 @@ static void remember_query_host(const char *arg, } } + if (use_kerberos && !got_user) + got_pass = True; + init_names(); if(*new_name_resolve_order) |