From ce02d0dfcbeeeec316578322257d998589090c6f Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Wed, 20 Jun 2007 17:38:42 +0000 Subject: r23554: Fix bug #4711 by makeing cli_connect return an NTSTATUS. Long overdue fix.... Jeremy. (This used to be commit 073fdc5a58139796dbaa7ea9833dca5308f11282) --- source3/client/client.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'source3/client/client.c') diff --git a/source3/client/client.c b/source3/client/client.c index 2df5c67db1..35716ab13c 100644 --- a/source3/client/client.c +++ b/source3/client/client.c @@ -3845,6 +3845,7 @@ static int do_message_op(void) fstring server_name; char name_type_hex[10]; int msg_port; + NTSTATUS status; make_nmb_name(&calling, calling_name, 0x0); make_nmb_name(&called , desthost, name_type); @@ -3861,12 +3862,17 @@ static int do_message_op(void) msg_port = port ? port : 139; - if (!(cli=cli_initialise()) || (cli_set_port(cli, msg_port) != msg_port) || - !cli_connect(cli, server_name, &ip)) { + if (!(cli=cli_initialise()) || (cli_set_port(cli, msg_port) != msg_port)) { d_printf("Connection to %s failed\n", desthost); return 1; } + status = cli_connect(cli, server_name, &ip); + if (!NT_STATUS_IS_OK(status)) { + d_printf("Connection to %s failed. Error %s\n", desthost, nt_errstr(status)); + return 1; + } + if (!cli_session_request(cli, &calling, &called)) { d_printf("session request failed\n"); cli_cm_shutdown(); -- cgit