diff options
Diffstat (limited to 'source/libsmb/clidfs.c')
-rw-r--r-- | source/libsmb/clidfs.c | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/source/libsmb/clidfs.c b/source/libsmb/clidfs.c index 4009b98b418..d5e31b5eb85 100644 --- a/source/libsmb/clidfs.c +++ b/source/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; |