summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVolker Lendecke <vl@samba.org>2011-05-28 23:34:26 +0200
committerVolker Lendecke <vl@samba.org>2011-05-28 23:04:02 +0200
commit8a3199e00de3e138d36b99043703938482192ed7 (patch)
tree7a9cb8f296180f1fce3257d4d18130b5de0c4713
parent797316ae9797f7567e01f853effbd87d98b2abbb (diff)
downloadsamba-8a3199e00de3e138d36b99043703938482192ed7.tar.gz
samba-8a3199e00de3e138d36b99043703938482192ed7.tar.bz2
samba-8a3199e00de3e138d36b99043703938482192ed7.zip
s3: Use cli_connect_nb in smbtorture open_nbt_connection
-rw-r--r--source3/torture/torture.c38
1 files changed, 2 insertions, 36 deletions
diff --git a/source3/torture/torture.c b/source3/torture/torture.c
index 64ba5431d6..ae34077cbe 100644
--- a/source3/torture/torture.c
+++ b/source3/torture/torture.c
@@ -178,24 +178,11 @@ static bool force_cli_encryption(struct cli_state *c,
static struct cli_state *open_nbt_connection(void)
{
- struct nmb_name called, calling;
- struct sockaddr_storage ss;
struct cli_state *c;
NTSTATUS status;
- make_nmb_name(&calling, myname, 0x0);
- make_nmb_name(&called , host, 0x20);
-
- zero_sockaddr(&ss);
-
- if (!(c = cli_initialise_ex(signing_state))) {
- printf("Failed initialize cli_struct to connect with %s\n", host);
- return NULL;
- }
-
- c->port = port_to_use;
-
- status = cli_connect(c, host, &ss);
+ status = cli_connect_nb(host, NULL, port_to_use, 0x20, myname,
+ signing_state, &c);
if (!NT_STATUS_IS_OK(status)) {
printf("Failed to connect with %s. Error %s\n", host, nt_errstr(status) );
return NULL;
@@ -207,27 +194,6 @@ static struct cli_state *open_nbt_connection(void)
if (use_oplocks) c->use_oplocks = True;
if (use_level_II_oplocks) c->use_level_II_oplocks = True;
- if (!cli_session_request(c, &calling, &called)) {
- /*
- * Well, that failed, try *SMBSERVER ...
- * However, we must reconnect as well ...
- */
- status = cli_connect(c, host, &ss);
- if (!NT_STATUS_IS_OK(status)) {
- printf("Failed to connect with %s. Error %s\n", host, nt_errstr(status) );
- return NULL;
- }
-
- make_nmb_name(&called, "*SMBSERVER", 0x20);
- if (!cli_session_request(c, &calling, &called)) {
- printf("%s rejected the session\n",host);
- printf("We tried with a called name of %s & %s\n",
- host, "*SMBSERVER");
- cli_shutdown(c);
- return NULL;
- }
- }
-
return c;
}