summaryrefslogtreecommitdiff
path: root/source3/libsmb
diff options
context:
space:
mode:
authorJeremy Allison <jra@samba.org>2006-02-15 02:07:14 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 11:10:07 -0500
commit8189bb6e4c5a3cde757bb7823f51541c8940914b (patch)
tree0df943929cf86e68b1355f58d7d13fa05b942bfb /source3/libsmb
parent0c0ce531a87f7e5f5a1a2980335322615a98c037 (diff)
downloadsamba-8189bb6e4c5a3cde757bb7823f51541c8940914b.tar.gz
samba-8189bb6e4c5a3cde757bb7823f51541c8940914b.tar.bz2
samba-8189bb6e4c5a3cde757bb7823f51541c8940914b.zip
r13502: Fix error messages for usershares when smbd is not
running. More generic error return cleanup in libsmb/ needs doing (everything returning NTSTATUS not BOOL). Jeremy (This used to be commit 654bb9853b450c5d509d182f67ec26ac320fd590)
Diffstat (limited to 'source3/libsmb')
-rw-r--r--source3/libsmb/cliconnect.c13
-rw-r--r--source3/libsmb/nterr.c4
2 files changed, 14 insertions, 3 deletions
diff --git a/source3/libsmb/cliconnect.c b/source3/libsmb/cliconnect.c
index 6f32fb1b5d..4c6b890db0 100644
--- a/source3/libsmb/cliconnect.c
+++ b/source3/libsmb/cliconnect.c
@@ -1394,7 +1394,11 @@ again:
DEBUG(1,("cli_start_connection: failed to connect to %s (%s)\n",
nmb_namestr(&called), inet_ntoa(ip)));
cli_shutdown(cli);
- return NT_STATUS_UNSUCCESSFUL;
+ if (is_zero_ip(ip)) {
+ return NT_STATUS_BAD_NETWORK_NAME;
+ } else {
+ return NT_STATUS_CONNECTION_REFUSED;
+ }
}
if (retry)
@@ -1412,7 +1416,7 @@ again:
make_nmb_name(&called , "*SMBSERVER", 0x20);
goto again;
}
- return NT_STATUS_UNSUCCESSFUL;
+ return NT_STATUS_BAD_NETWORK_NAME;
}
cli_setup_signing_state(cli, signing_state);
@@ -1424,7 +1428,10 @@ again:
if (!cli_negprot(cli)) {
DEBUG(1,("failed negprot\n"));
- nt_status = NT_STATUS_UNSUCCESSFUL;
+ nt_status = cli_nt_error(cli);
+ if (NT_STATUS_IS_OK(nt_status)) {
+ nt_status = NT_STATUS_UNSUCCESSFUL;
+ }
cli_shutdown(cli);
return nt_status;
}
diff --git a/source3/libsmb/nterr.c b/source3/libsmb/nterr.c
index 677c5d84c7..4f97379ee0 100644
--- a/source3/libsmb/nterr.c
+++ b/source3/libsmb/nterr.c
@@ -541,6 +541,8 @@ static nt_err_code_struct nt_errs[] =
{ NULL, NT_STATUS(0) }
};
+/* These need sorting..... */
+
nt_err_code_struct nt_err_desc[] =
{
{ "Success", NT_STATUS_OK },
@@ -595,6 +597,8 @@ nt_err_code_struct nt_err_desc[] =
{ "Duplicate name on network", NT_STATUS_DUPLICATE_NAME },
{ "Print queue is full", NT_STATUS_PRINT_QUEUE_FULL },
{ "No print spool space available", NT_STATUS_NO_SPOOL_SPACE },
+ { "The network name cannot be found", NT_STATUS_BAD_NETWORK_NAME },
+ { "The connection was refused", NT_STATUS_CONNECTION_REFUSED },
{ "Too many names", NT_STATUS_TOO_MANY_NAMES },
{ "Too many sessions", NT_STATUS_TOO_MANY_SESSIONS },
{ "Invalid server state", NT_STATUS_INVALID_SERVER_STATE },