Browse Source

[mod_authn_ldap] ldap_set_option LDAP_OPT_RESTART (fixes #2940)

ldap_set_option LDAP_OPT_RESTART to handle EINTR on SIGCHLD from CGI

(ldap uses poll(), which is not restartable with sigaction SA_RESTART)

x-ref:
  "mod_authn_ldap/mod_cgi race condition, "Can't contact LDAP server""
  https://redmine.lighttpd.net/issues/2940
personal/stbuehler/ci-build
Glenn Strauss 2 years ago
parent
commit
ae9cafecea
  1. 3
      src/mod_authn_ldap.c
  2. 3
      src/mod_vhostdb_ldap.c

3
src/mod_authn_ldap.c

@ -404,6 +404,9 @@ static LDAP * mod_authn_ldap_host_init(server *srv, plugin_config *s) {
return NULL;
}
/* restart ldap functions if interrupted by a signal, e.g. SIGCHLD */
ldap_set_option(ld, LDAP_OPT_RESTART, LDAP_OPT_ON);
if (s->auth_ldap_starttls) {
/* if no CA file is given, it is ok, as we will use encryption
* if the server requires a CAfile it will tell us */

3
src/mod_vhostdb_ldap.c

@ -256,6 +256,9 @@ static LDAP * mod_authn_ldap_host_init(server *srv, vhostdb_config *s) {
return NULL;
}
/* restart ldap functions if interrupted by a signal, e.g. SIGCHLD */
ldap_set_option(ld, LDAP_OPT_RESTART, LDAP_OPT_ON);
if (s->starttls) {
/* if no CA file is given, it is ok, as we will use encryption
* if the server requires a CAfile it will tell us */

Loading…
Cancel
Save