From 4bbb995e8dab284b4deaa2e2ee38eb329305d1c2 Mon Sep 17 00:00:00 2001 From: Volker Lendecke Date: Sun, 27 Aug 2006 17:24:31 +0000 Subject: r17854: Steal the LDAP in NTSTATUS trick from Samba4 Thanks to Michael Adam Volker (This used to be commit 91878f9b6fbe5187fb7d0464008ea0abe7f11a73) --- source3/libsmb/nterr.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'source3/libsmb/nterr.c') diff --git a/source3/libsmb/nterr.c b/source3/libsmb/nterr.c index c247d818c1..507bb60da4 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++; -- cgit