summaryrefslogtreecommitdiff
path: root/source3/libads
diff options
context:
space:
mode:
authorJim McDonough <jmcd@samba.org>2002-04-04 02:49:30 +0000
committerJim McDonough <jmcd@samba.org>2002-04-04 02:49:30 +0000
commit417b1ce487c1db77c389587f9c187dc107d3dce4 (patch)
tree3b20f981cf44b06b14c196253ab7f5c97150a56a /source3/libads
parentadc57a79d99cfb6e0f5a1ba94275bb40eeb95bb7 (diff)
downloadsamba-417b1ce487c1db77c389587f9c187dc107d3dce4.tar.gz
samba-417b1ce487c1db77c389587f9c187dc107d3dce4.tar.bz2
samba-417b1ce487c1db77c389587f9c187dc107d3dce4.zip
Add ads_err2string() function for generating error strings from an ADS_STATUS.
I've got the cases besides gssapi...anyone know how to get those? (This used to be commit c937e1352207ad90e8257ad6c9f8b7c9cf92030d)
Diffstat (limited to 'source3/libads')
-rw-r--r--source3/libads/ldap.c15
1 files changed, 15 insertions, 0 deletions
diff --git a/source3/libads/ldap.c b/source3/libads/ldap.c
index 9670327dbe..57fd3305e7 100644
--- a/source3/libads/ldap.c
+++ b/source3/libads/ldap.c
@@ -66,6 +66,21 @@ ADS_STATUS ads_connect(ADS_STRUCT *ads)
return ads_sasl_bind(ads);
}
+char *ads_err2string(ADS_STATUS status)
+{
+ switch(status.error_type) {
+ case ADS_ERROR_LDAP:
+ return ldap_err2string(status.rc);
+ case ADS_ERROR_KRB5:
+ return error_message(status.rc);
+ case ADS_ERROR_GSS:
+ return "gssapi error";
+ case ADS_ERROR_SYSTEM:
+ return strerror(status.rc);
+ default:
+ return "unknown error";
+ }
+}
/* Do a search with paged results. cookie must be null on the first
call, and then returned on each subsequent call. It will be null