summaryrefslogtreecommitdiff
path: root/source3/libsmb/clidfs.c
diff options
context:
space:
mode:
Diffstat (limited to 'source3/libsmb/clidfs.c')
-rw-r--r--source3/libsmb/clidfs.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/source3/libsmb/clidfs.c b/source3/libsmb/clidfs.c
index 4009b98b41..d5e31b5eb8 100644
--- a/source3/libsmb/clidfs.c
+++ b/source3/libsmb/clidfs.c
@@ -69,6 +69,7 @@ static struct cli_state *do_connect( const char *server, const char *share,
pstring servicename;
char *sharename;
fstring newserver, newshare;
+ NTSTATUS status;
/* make a copy so we don't modify the global string 'service' */
pstrcpy(servicename, share);
@@ -94,11 +95,15 @@ static struct cli_state *do_connect( const char *server, const char *share,
ip = dest_ip;
/* have to open a new connection */
- if (!(c=cli_initialise()) || (cli_set_port(c, port) != port) ||
- !cli_connect(c, server_n, &ip)) {
+ if (!(c=cli_initialise()) || (cli_set_port(c, port) != port)) {
d_printf("Connection to %s failed\n", server_n);
return NULL;
}
+ status = cli_connect(c, server_n, &ip);
+ if (!NT_STATUS_IS_OK(status)) {
+ d_printf("Connection to %s failed (Error %s)\n", server_n, nt_errstr(status));
+ return NULL;
+ }
c->protocol = max_protocol;
c->use_kerberos = use_kerberos;