Project

General

Profile

Bug #2464 ยป 0001-Allow-libldap-to-recover-from-EINTR-signals.patch

patch - codehero, 2012-12-19 08:52

View differences:

src/http_auth.c
return -1;
}
/* mod_cgi starts child processes, which will signal SIGCHILD when completed.
* If openldap receives this signal during a select call, it will be interrupted
* and cause the client to believe the server is down.
*
* Setting LDAP_OPT_RESTART will retry the select. In most cases the rate of invoked
* processes is limited by successful auths, so setting this should not cause any problems.
*
* NOTE: Watch out for libldap using sycalls without accounting for EINTR. */
ret = 1;
if (LDAP_OPT_SUCCESS != (ret = ldap_set_option(ldap, LDAP_OPT_RESTART, &ret))) {
log_error_write(srv, __FILE__, __LINE__, "ss", "ldap:", ldap_err2string(ret));
ldap_unbind_s(ldap);
return -1;
}
if (p->conf.auth_ldap_starttls == 1) {
if (LDAP_OPT_SUCCESS != (ret = ldap_start_tls_s(ldap, NULL, NULL))) {
log_error_write(srv, __FILE__, __LINE__, "ss", "ldap startTLS failed:", ldap_err2string(ret));
    (1-1/1)