summaryrefslogtreecommitdiff
path: root/source3/utils
diff options
context:
space:
mode:
authorJeremy Allison <jra@samba.org>2007-06-20 17:38:42 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 12:23:28 -0500
commitce02d0dfcbeeeec316578322257d998589090c6f (patch)
tree3855284b3cede5e054a0149b8afef432dfbcb318 /source3/utils
parent04c75d9c95c5321d1fe5455671074b0e46f0df77 (diff)
downloadsamba-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/utils')
-rw-r--r--source3/utils/net_rpc.c4
-rw-r--r--source3/utils/net_time.c6
2 files changed, 7 insertions, 3 deletions
diff --git a/source3/utils/net_rpc.c b/source3/utils/net_rpc.c
index e2639fe896..315b56100f 100644
--- a/source3/utils/net_rpc.c
+++ b/source3/utils/net_rpc.c
@@ -6206,6 +6206,7 @@ BOOL net_rpc_check(unsigned flags)
BOOL ret = False;
struct in_addr server_ip;
char *server_name = NULL;
+ NTSTATUS status;
/* flags (i.e. server type) may depend on command */
if (!net_find_server(NULL, flags, &server_ip, &server_name))
@@ -6215,7 +6216,8 @@ BOOL net_rpc_check(unsigned flags)
return False;
}
- if (!cli_connect(cli, server_name, &server_ip))
+ status = cli_connect(cli, server_name, &server_ip);
+ if (!NT_STATUS_IS_OK(status))
goto done;
if (!attempt_netbios_session_request(&cli, global_myname(),
server_name, &server_ip))
diff --git a/source3/utils/net_time.c b/source3/utils/net_time.c
index f6269627da..5e952780d3 100644
--- a/source3/utils/net_time.c
+++ b/source3/utils/net_time.c
@@ -29,14 +29,16 @@ static time_t cli_servertime(const char *host, struct in_addr *ip, int *zone)
struct nmb_name calling, called;
time_t ret = 0;
struct cli_state *cli = NULL;
+ NTSTATUS status;
cli = cli_initialise();
if (!cli) {
goto done;
}
- if (!cli_connect(cli, host, ip)) {
- fprintf(stderr,"Can't contact server\n");
+ status = cli_connect(cli, host, ip);
+ if (!NT_STATUS_IS_OK(status)) {
+ fprintf(stderr,"Can't contact server %s. Error %s\n", host, nt_errstr(status));
goto done;
}