From 649873bcf374997088da73f85424cbb641e56735 Mon Sep 17 00:00:00 2001 From: Volker Lendecke Date: Sat, 28 May 2011 20:26:49 +0200 Subject: s3: Use cli_connect_nb in masktest --- source3/torture/masktest.c | 33 +++------------------------------ 1 file changed, 3 insertions(+), 30 deletions(-) (limited to 'source3/torture') diff --git a/source3/torture/masktest.c b/source3/torture/masktest.c index 2c938baacc..a1734abded 100644 --- a/source3/torture/masktest.c +++ b/source3/torture/masktest.c @@ -167,10 +167,8 @@ return a connection to a server static struct cli_state *connect_one(char *share) { struct cli_state *c; - struct nmb_name called, calling; char *server_n; char *server; - struct sockaddr_storage ss; NTSTATUS status; server = share+2; @@ -181,40 +179,15 @@ static struct cli_state *connect_one(char *share) server_n = server; - zero_sockaddr(&ss); - - make_nmb_name(&calling, "masktest", 0x0); - make_nmb_name(&called , server, 0x20); - - again: - zero_sockaddr(&ss); - - /* have to open a new connection */ - if (!(c=cli_initialise())) { - DEBUG(0,("Connection to %s failed\n", server_n)); - return NULL; - } - - status = cli_connect(c, server_n, &ss); + status = cli_connect_nb(server, NULL, 0, "masktest", Undefined, &c); if (!NT_STATUS_IS_OK(status)) { - DEBUG(0,("Connection to %s failed. Error %s\n", server_n, nt_errstr(status) )); + DEBUG(0,("Connection to %s failed. Error %s\n", server_n, + nt_errstr(status))); return NULL; } c->protocol = max_protocol; - if (!cli_session_request(c, &calling, &called)) { - DEBUG(0,("session request to %s failed\n", called.name)); - cli_shutdown(c); - 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); if (!NT_STATUS_IS_OK(status)) { DEBUG(0, ("protocol negotiation failed: %s\n", -- cgit