summaryrefslogtreecommitdiff
path: root/source4/libcli/util/nterr.c
diff options
context:
space:
mode:
authorAndrew Tridgell <tridge@samba.org>2005-07-04 01:23:38 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 13:19:08 -0500
commite0d521ca79314b7c27512565262f614f67e20e64 (patch)
tree9efe89f626380bb861052fce0e9ac4ccf3287f27 /source4/libcli/util/nterr.c
parentb48c1214548a22c989231291221554e3de2d3954 (diff)
downloadsamba-e0d521ca79314b7c27512565262f614f67e20e64.tar.gz
samba-e0d521ca79314b7c27512565262f614f67e20e64.tar.bz2
samba-e0d521ca79314b7c27512565262f614f67e20e64.zip
r8104: - added support for our client library to not negotiate nt status codes, controlled
with 'nt status support' option. - make nt_errstr() display nice strings for dos status codes encoded using NT_STATUS_DOS() - no longer map between dos and nt status codes in the client library, instead return using NT_STATUS_DOS() - fixed the RAW-CONTEXT test to look for NT_STATUS_DOS(ERRSRV, ERRbaduid) instead of NT_STATUS_INVALID_HANDLE (This used to be commit ff5549e87ffae9f062394f30d8fd1ae95b614735)
Diffstat (limited to 'source4/libcli/util/nterr.c')
-rw-r--r--source4/libcli/util/nterr.c19
1 files changed, 10 insertions, 9 deletions
diff --git a/source4/libcli/util/nterr.c b/source4/libcli/util/nterr.c
index eca47572e3..a5ba1305e4 100644
--- a/source4/libcli/util/nterr.c
+++ b/source4/libcli/util/nterr.c
@@ -648,9 +648,17 @@ static const nt_err_code_struct nt_err_desc[] =
*****************************************************************************/
const char *nt_errstr(NTSTATUS nt_code)
{
- static fstring msg;
+ static char msg[40];
int idx = 0;
+ if (NT_STATUS_IS_DOS(nt_code)) {
+ return dos_errstr(NT_STATUS_DOS_CLASS(nt_code),
+ NT_STATUS_DOS_CODE(nt_code));
+ } else if (NT_STATUS_IS_LDAP(nt_code)) {
+ slprintf(msg, sizeof(msg), "LDAP code %u", NT_STATUS_LDAP_CODE(nt_code));
+ return msg;
+ }
+
while (nt_errs[idx].nt_errstr != NULL) {
if (NT_STATUS_V(nt_errs[idx].nt_errcode) ==
NT_STATUS_V(nt_code)) {
@@ -659,14 +667,7 @@ const char *nt_errstr(NTSTATUS nt_code)
idx++;
}
- if (NT_STATUS_IS_DOS(nt_code)) {
- slprintf(msg, sizeof(msg), "DOS code %u:%u",
- NT_STATUS_DOS_CLASS(nt_code), NT_STATUS_DOS_CODE(nt_code));
- } else if (NT_STATUS_IS_LDAP(nt_code)) {
- slprintf(msg, sizeof(msg), "LDAP code %u", NT_STATUS_LDAP_CODE(nt_code));
- } else {
- slprintf(msg, sizeof(msg), "NT code 0x%08x", NT_STATUS_V(nt_code));
- }
+ slprintf(msg, sizeof(msg), "NT code 0x%08x", NT_STATUS_V(nt_code));
return msg;
}