summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVolker Lendecke <vl@samba.org>2011-05-28 20:26:49 +0200
committerVolker Lendecke <vl@samba.org>2011-05-28 20:50:09 +0200
commit649873bcf374997088da73f85424cbb641e56735 (patch)
treeb263c5e9f4f7338f7a0dc49e28e2c29248b3ba55
parent1173a4f83d8001d6a00b389133de64f09d1d77a2 (diff)
downloadsamba-649873bcf374997088da73f85424cbb641e56735.tar.gz
samba-649873bcf374997088da73f85424cbb641e56735.tar.bz2
samba-649873bcf374997088da73f85424cbb641e56735.zip
s3: Use cli_connect_nb in masktest
-rw-r--r--source3/torture/masktest.c33
1 files changed, 3 insertions, 30 deletions
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",