diff options
author | Andrew Bartlett <abartlet@samba.org> | 2011-06-24 16:26:23 +1000 |
---|---|---|
committer | Andrew Bartlett <abartlet@samba.org> | 2011-06-24 16:26:23 +1000 |
commit | 6da26870e0ae5acd6ff49a30ec2f6886b44d095e (patch) | |
tree | 850c71039563c16a5d563c47e7ba2ab645baf198 /source3/libsmb/clidfs.c | |
parent | 6925a799d04c6fa59dd2ddef1f5510f9bb7d17d1 (diff) | |
parent | 2610c05b5b95cc7036b3d6dfb894c6cfbdb68483 (diff) | |
download | samba-6da26870e0ae5acd6ff49a30ec2f6886b44d095e.tar.gz samba-6da26870e0ae5acd6ff49a30ec2f6886b44d095e.tar.bz2 samba-6da26870e0ae5acd6ff49a30ec2f6886b44d095e.zip |
Merge 2610c05b5b95cc7036b3d6dfb894c6cfbdb68483 as Samba-4.0alpha16
Diffstat (limited to 'source3/libsmb/clidfs.c')
-rw-r--r-- | source3/libsmb/clidfs.c | 52 |
1 files changed, 7 insertions, 45 deletions
diff --git a/source3/libsmb/clidfs.c b/source3/libsmb/clidfs.c index a0d60482ee..5c5257fb6f 100644 --- a/source3/libsmb/clidfs.c +++ b/source3/libsmb/clidfs.c @@ -20,6 +20,7 @@ */ #include "includes.h" +#include "libsmb/libsmb.h" #include "libsmb/clirap.h" #include "msdfs.h" #include "trans2.h" @@ -87,10 +88,6 @@ static struct cli_state *do_connect(TALLOC_CTX *ctx, int name_type) { struct cli_state *c = NULL; - struct nmb_name called, calling; - const char *called_str; - const char *server_n; - struct sockaddr_storage ss; char *servicename; char *sharename; char *newserver, *newshare; @@ -106,7 +103,6 @@ static struct cli_state *do_connect(TALLOC_CTX *ctx, sharename = servicename; if (*sharename == '\\') { sharename += 2; - called_str = sharename; if (server == NULL) { server = sharename; } @@ -116,36 +112,19 @@ static struct cli_state *do_connect(TALLOC_CTX *ctx, } *sharename = 0; sharename++; - } else { - called_str = server; } - - server_n = server; - - zero_sockaddr(&ss); - - make_nmb_name(&calling, global_myname(), 0x0); - make_nmb_name(&called , called_str, name_type); - - again: - zero_sockaddr(&ss); - - /* have to open a new connection */ - c = cli_initialise_ex(get_cmdline_auth_info_signing_state(auth_info)); - if (c == NULL) { - d_printf("Connection to %s failed\n", server_n); + if (server == NULL) { return NULL; } - if (port) { - cli_set_port(c, port); - } - status = cli_connect(c, server_n, &ss); + status = cli_connect_nb( + server, NULL, port, name_type, NULL, + get_cmdline_auth_info_signing_state(auth_info), &c); + if (!NT_STATUS_IS_OK(status)) { d_printf("Connection to %s failed (Error %s)\n", - server_n, + server, nt_errstr(status)); - cli_shutdown(c); return NULL; } @@ -158,23 +137,6 @@ static struct cli_state *do_connect(TALLOC_CTX *ctx, get_cmdline_auth_info_fallback_after_kerberos(auth_info); c->use_ccache = get_cmdline_auth_info_use_ccache(auth_info); - if (!cli_session_request(c, &calling, &called)) { - char *p; - d_printf("session request to %s failed (%s)\n", - called.name, cli_errstr(c)); - cli_shutdown(c); - c = NULL; - if ((p=strchr_m(called.name, '.'))) { - *p = 0; - goto again; - } - if (strcmp(called.name, "*SMBSERVER")) { - make_nmb_name(&called , "*SMBSERVER", 0x20); - goto again; - } - return NULL; - } - DEBUG(4,(" session request ok\n")); status = cli_negprot(c); |