summaryrefslogtreecommitdiffstats
path: root/source3/libsmb/nterr.c
diff options
context:
space:
mode:
authorVolker Lendecke <vlendec@samba.org>2006-08-27 17:24:31 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 11:38:54 -0500
commit4bbb995e8dab284b4deaa2e2ee38eb329305d1c2 (patch)
treeb360dbcf98c92e7b73d4c2bc592efc5fd34850bc /source3/libsmb/nterr.c
parent5d4a189d4e1ddc7ba19c585811f2fb45b9534cc7 (diff)
downloadsamba-4bbb995e8dab284b4deaa2e2ee38eb329305d1c2.tar.gz
samba-4bbb995e8dab284b4deaa2e2ee38eb329305d1c2.tar.xz
samba-4bbb995e8dab284b4deaa2e2ee38eb329305d1c2.zip
r17854: Steal the LDAP in NTSTATUS trick from Samba4
Thanks to Michael Adam <ma@sernet.de> Volker (This used to be commit 91878f9b6fbe5187fb7d0464008ea0abe7f11a73)
Diffstat (limited to 'source3/libsmb/nterr.c')
-rw-r--r--source3/libsmb/nterr.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/source3/libsmb/nterr.c b/source3/libsmb/nterr.c
index c247d818c1b..507bb60da4c 100644
--- a/source3/libsmb/nterr.c
+++ b/source3/libsmb/nterr.c
@@ -650,11 +650,14 @@ const char *nt_errstr(NTSTATUS nt_code)
static pstring msg;
int idx = 0;
+ if (NT_STATUS_TYPE(nt_code) == NT_STATUS_TYPE_LDAP) {
+ return ldap_err2string(NT_STATUS_LDAP_CODE(nt_code));
+ }
+
slprintf(msg, sizeof(msg), "NT code 0x%08x", NT_STATUS_V(nt_code));
while (nt_errs[idx].nt_errstr != NULL) {
- if (NT_STATUS_V(nt_errs[idx].nt_errcode) ==
- NT_STATUS_V(nt_code)) {
+ if (NT_STATUS_EQUAL(nt_errs[idx].nt_errcode, nt_code)) {
return nt_errs[idx].nt_errstr;
}
idx++;