Changes with Apache 2.0.43
+ *) Get mod_auth_ldap to retry connections on LDAP_SERVER_DOWN.
+ [Thomas Bennett <thomas.bennett@eds.com>, Graham Leggett]
+
*) Make sure the contents of the WWW-Authenticate header is
passed on a 4xx error by proxy. Previously all headers
were dropped, resulting in the browser being unable to
*/
int mod_auth_ldap_check_user_id(request_rec *r)
{
+ int failures = 0;
const char **vals = NULL;
char filtbuf[FILTER_LENGTH];
mod_auth_ldap_config_t *sec =
return DECLINED;
}
+start_over:
+
/* There is a good AuthLDAPURL, right? */
if (sec->host) {
ldc = util_ldap_connection_find(r, sec->host, sec->port,
sec->attributes, filtbuf, sent_pw, &dn, &vals);
util_ldap_connection_close(ldc);
+ /* sanity check - if server is down, retry it up to 5 times */
+ if (result == LDAP_SERVER_DOWN) {
+ util_ldap_connection_destroy(ldc);
+ if (failures++ <= 5) {
+ goto start_over;
+ }
+ }
+
+ /* handle bind failure */
if (result != LDAP_SUCCESS) {
ap_log_rerror(APLOG_MARK, APLOG_WARNING|APLOG_NOERRNO, 0, r,
"[%d] auth_ldap authenticate: "