diff options
author | Jeremy Allison <jra@samba.org> | 2007-06-20 17:38:42 +0000 |
---|---|---|
committer | Gerald (Jerry) Carter <jerry@samba.org> | 2007-10-10 12:23:28 -0500 |
commit | ce02d0dfcbeeeec316578322257d998589090c6f (patch) | |
tree | 3855284b3cede5e054a0149b8afef432dfbcb318 /source3/client | |
parent | 04c75d9c95c5321d1fe5455671074b0e46f0df77 (diff) | |
download | samba-ce02d0dfcbeeeec316578322257d998589090c6f.tar.gz samba-ce02d0dfcbeeeec316578322257d998589090c6f.tar.bz2 samba-ce02d0dfcbeeeec316578322257d998589090c6f.zip |
r23554: Fix bug #4711 by makeing cli_connect return an NTSTATUS.
Long overdue fix....
Jeremy.
(This used to be commit 073fdc5a58139796dbaa7ea9833dca5308f11282)
Diffstat (limited to 'source3/client')
-rw-r--r-- | source3/client/client.c | 10 |
1 files changed, 8 insertions, 2 deletions
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(); |