diff options
Diffstat (limited to 'source3/torture')
-rw-r--r-- | source3/torture/locktest.c | 9 | ||||
-rw-r--r-- | source3/torture/masktest.c | 9 | ||||
-rw-r--r-- | source3/torture/torture.c | 11 |
3 files changed, 23 insertions, 6 deletions
diff --git a/source3/torture/locktest.c b/source3/torture/locktest.c index 7a970488b3..8d3234e367 100644 --- a/source3/torture/locktest.c +++ b/source3/torture/locktest.c @@ -165,6 +165,7 @@ static struct cli_state *connect_one(char *share, int snum) struct in_addr ip; fstring myname; static int count; + NTSTATUS status; fstrcpy(server,share+2); share = strchr_m(server,'\\'); @@ -185,11 +186,17 @@ static struct cli_state *connect_one(char *share, int snum) zero_ip(&ip); /* have to open a new connection */ - if (!(c=cli_initialise()) || !cli_connect(c, server_n, &ip)) { + if (!(c=cli_initialise())) { DEBUG(0,("Connection to %s failed\n", server_n)); return NULL; } + status = cli_connect(c, server_n, &ip); + if (!NT_STATUS_IS_OK(status)) { + DEBUG(0,("Connection to %s failed. Error %s\n", server_n, nt_errstr(status) )); + return NULL; + } + c->use_kerberos = use_kerberos; if (!cli_session_request(c, &calling, &called)) { diff --git a/source3/torture/masktest.c b/source3/torture/masktest.c index 0d6c0b16f2..e98cf81f33 100644 --- a/source3/torture/masktest.c +++ b/source3/torture/masktest.c @@ -170,6 +170,7 @@ static struct cli_state *connect_one(char *share) char *server_n; char *server; struct in_addr ip; + NTSTATUS status; server = share+2; share = strchr_m(server,'\\'); @@ -188,11 +189,17 @@ static struct cli_state *connect_one(char *share) zero_ip(&ip); /* have to open a new connection */ - if (!(c=cli_initialise()) || !cli_connect(c, server_n, &ip)) { + if (!(c=cli_initialise())) { DEBUG(0,("Connection to %s failed\n", server_n)); return NULL; } + status = cli_connect(c, server_n, &ip); + if (!NT_STATUS_IS_OK(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)) { diff --git a/source3/torture/torture.c b/source3/torture/torture.c index 39495c6a3e..92599e2765 100644 --- a/source3/torture/torture.c +++ b/source3/torture/torture.c @@ -102,6 +102,7 @@ static struct cli_state *open_nbt_connection(void) struct nmb_name called, calling; struct in_addr ip; struct cli_state *c; + NTSTATUS status; make_nmb_name(&calling, myname, 0x0); make_nmb_name(&called , host, 0x20); @@ -115,8 +116,9 @@ static struct cli_state *open_nbt_connection(void) c->port = port_to_use; - if (!cli_connect(c, host, &ip)) { - printf("Failed to connect with %s\n", host); + status = cli_connect(c, host, &ip); + if (!NT_STATUS_IS_OK(status)) { + printf("Failed to connect with %s. Error %s\n", host, nt_errstr(status) ); return NULL; } @@ -131,8 +133,9 @@ static struct cli_state *open_nbt_connection(void) * Well, that failed, try *SMBSERVER ... * However, we must reconnect as well ... */ - if (!cli_connect(c, host, &ip)) { - printf("Failed to connect with %s\n", host); + status = cli_connect(c, host, &ip); + if (!NT_STATUS_IS_OK(status)) { + printf("Failed to connect with %s. Error %s\n", host, nt_errstr(status) ); return NULL; } |