PATCHES ACCEPTED TO BACKPORT FROM TRUNK:
[ start all new proposals below, under PATCHES PROPOSED. ]
- *) mod_ldap: Try to establish a new backend LDAP connection when the
- Microsoft LDAP client library returns LDAP_UNAVAILABLE, e.g. after the
- LDAP server has closed the connection due to a timeout.
- PR 39095 [Eric Covener]
- Trunk version of patch:
- http://svn.apache.org/viewvc?view=rev&revision=607766
- http://svn.apache.org/viewvc?rev=607841&view=rev
- 2.2.x
- http://people.apache.org/~covener/2.2.x-ldap-server-down-with607841.diff
- +1 covener, rpluem, wrowe
-
* mod_status: Modified default refresh value to 10 secs so that its possible
to correct a typo in the URL.
Trunk version of patch:
rc = ldap_simple_bind_s(ldc->ldap,
(char *)ldc->binddn,
(char *)ldc->bindpw);
- if (LDAP_SERVER_DOWN != rc) {
+ if (!AP_LDAP_IS_SERVER_DOWN(rc)) {
break;
} else if (failures == 5) {
/* attempt to init the connection once again */
}
/* search for reqdn */
- if ((result = ldap_search_ext_s(ldc->ldap, (char *)reqdn, LDAP_SCOPE_BASE,
- "(objectclass=*)", NULL, 1,
- NULL, NULL, NULL, APR_LDAP_SIZELIMIT, &res))
- == LDAP_SERVER_DOWN)
+ result = ldap_search_ext_s(ldc->ldap, (char *)reqdn, LDAP_SCOPE_BASE,
+ "(objectclass=*)", NULL, 1,
+ NULL, NULL, NULL, APR_LDAP_SIZELIMIT, &res);
+ if (AP_LDAP_IS_SERVER_DOWN(result))
{
ldc->reason = "DN Comparison ldap_search_ext_s() "
"failed with server down";
return result;
}
- if ((result = ldap_compare_s(ldc->ldap,
- (char *)dn,
- (char *)attrib,
- (char *)value))
- == LDAP_SERVER_DOWN) {
+ result = ldap_compare_s(ldc->ldap,
+ (char *)dn,
+ (char *)attrib,
+ (char *)value);
+ if (AP_LDAP_IS_SERVER_DOWN(result)) {
/* connection failed - try again */
ldc->reason = "ldap_compare_s() failed with server down";
uldap_connection_unbind(ldc);
}
/* try do the search */
- if ((result = ldap_search_ext_s(ldc->ldap,
- (char *)basedn, scope,
- (char *)filter, attrs, 0,
- NULL, NULL, NULL, APR_LDAP_SIZELIMIT, &res))
- == LDAP_SERVER_DOWN)
+ result = ldap_search_ext_s(ldc->ldap,
+ (char *)basedn, scope,
+ (char *)filter, attrs, 0,
+ NULL, NULL, NULL, APR_LDAP_SIZELIMIT, &res);
+ if (AP_LDAP_IS_SERVER_DOWN(result))
{
ldc->reason = "ldap_search_ext_s() for user failed with server down";
uldap_connection_unbind(ldc);
* fails, it means that the password is wrong (the dn obviously
* exists, since we just retrieved it)
*/
- if ((result = ldap_simple_bind_s(ldc->ldap,
- (char *)*binddn,
- (char *)bindpw)) == LDAP_SERVER_DOWN) {
+ result = ldap_simple_bind_s(ldc->ldap,
+ (char *)*binddn,
+ (char *)bindpw);
+ if (AP_LDAP_IS_SERVER_DOWN(result)) {
ldc->reason = "ldap_simple_bind_s() to check user credentials "
"failed with server down";
ldap_msgfree(res);
}
/* try do the search */
- if ((result = ldap_search_ext_s(ldc->ldap,
- (char *)basedn, scope,
- (char *)filter, attrs, 0,
- NULL, NULL, NULL, APR_LDAP_SIZELIMIT, &res))
- == LDAP_SERVER_DOWN)
+ result = ldap_search_ext_s(ldc->ldap,
+ (char *)basedn, scope,
+ (char *)filter, attrs, 0,
+ NULL, NULL, NULL, APR_LDAP_SIZELIMIT, &res);
+ if (AP_LDAP_IS_SERVER_DOWN(result))
{
ldc->reason = "ldap_search_ext_s() for user failed with server down";
uldap_connection_unbind(ldc);