From 27022587e31769718ab53f4d114e03ac2f205f27 Mon Sep 17 00:00:00 2001 From: Günther Deschner Date: Fri, 6 May 2011 11:47:43 +0200 Subject: s3-libsmb: move protos to libsmb/proto.h Guenther --- source3/libsmb/clidfs.c | 1 + 1 file changed, 1 insertion(+) (limited to 'source3/libsmb/clidfs.c') diff --git a/source3/libsmb/clidfs.c b/source3/libsmb/clidfs.c index a0d60482ee..89dcf94482 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" -- cgit From 3f8621b5d396920f1756df17445ad8e675a606f5 Mon Sep 17 00:00:00 2001 From: Volker Lendecke Date: Sun, 29 May 2011 13:17:23 +0200 Subject: s3: Use cli_connect_nb in do_connect --- source3/libsmb/clidfs.c | 51 ++++++------------------------------------------- 1 file changed, 6 insertions(+), 45 deletions(-) (limited to 'source3/libsmb/clidfs.c') diff --git a/source3/libsmb/clidfs.c b/source3/libsmb/clidfs.c index 89dcf94482..5c5257fb6f 100644 --- a/source3/libsmb/clidfs.c +++ b/source3/libsmb/clidfs.c @@ -88,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; @@ -107,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; } @@ -117,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; } @@ -159,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); -- cgit