You are viewing a plain text version of this content. The canonical link for it is here.
Posted to cvs@httpd.apache.org by co...@apache.org on 2011/08/10 04:06:52 UTC
svn commit: r1156001 - /httpd/httpd/trunk/modules/ldap/util_ldap.c
Author: covener
Date: Wed Aug 10 02:06:52 2011
New Revision: 1156001
URL: http://svn.apache.org/viewvc?rev=1156001&view=rev
Log:
Try to obtain the specific LDAP error code returned during a failed
ldap_simple_bind().
Modified:
httpd/httpd/trunk/modules/ldap/util_ldap.c
Modified: httpd/httpd/trunk/modules/ldap/util_ldap.c
URL: http://svn.apache.org/viewvc/httpd/httpd/trunk/modules/ldap/util_ldap.c?rev=1156001&r1=1156000&r2=1156001&view=diff
==============================================================================
--- httpd/httpd/trunk/modules/ldap/util_ldap.c (original)
+++ httpd/httpd/trunk/modules/ldap/util_ldap.c Wed Aug 10 02:06:52 2011
@@ -459,7 +459,14 @@ static int uldap_simple_bind(util_ldap_c
int rc;
int msgid = ldap_simple_bind(ldc->ldap, binddn, bindpw);
if (msgid == -1) {
+ int ldaprc;
ldc->reason = "LDAP: ldap_simple_bind() failed";
+#ifdef LDAP_OPT_ERROR_NUMBER
+ if (LDAP_SUCCESS == ldap_get_option(ldc->ldap, LDAP_OPT_ERROR_NUMBER, &ldaprc)) return ldaprc;
+#endif
+#ifdef LDAP_OPT_RESULT_CODE
+ if (LDAP_SUCCESS == ldap_get_option(ldc->ldap, LDAP_OPT_RESULT_CODE, &ldaprc)) return ldaprc;
+#endif
/* -1 is LDAP_SERVER_DOWN in openldap, use something else */
return LDAP_OTHER;
}