summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSumit Bose <sbose@redhat.com>2010-03-23 17:01:59 +0100
committerStephen Gallagher <sgallagh@redhat.com>2010-03-25 12:14:03 -0400
commit6e8f828c84334c43500311ddcdb4341d87cdd71f (patch)
tree3da0e0321537d1d42923657878d3082e32d73c3a
parent1fafd0ab7e7c136ccc4fda54e6d2e0f947e28713 (diff)
downloadsssd-6e8f828c84334c43500311ddcdb4341d87cdd71f.tar.gz
sssd-6e8f828c84334c43500311ddcdb4341d87cdd71f.tar.xz
sssd-6e8f828c84334c43500311ddcdb4341d87cdd71f.zip
Set LDAP_OPT_RESTART for ldap_sasl_interactive_bind_s()
This option is needed for the rare case where a poll() call during ldap_sasl_interactive_bind_s() is interrupted by a signal. LDAP_OPT_RESTART enables the handling of the EINTR error instead of returning an error.
-rw-r--r--src/providers/ldap/sdap_async_connection.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/providers/ldap/sdap_async_connection.c b/src/providers/ldap/sdap_async_connection.c
index 586733f46..ad3d241da 100644
--- a/src/providers/ldap/sdap_async_connection.c
+++ b/src/providers/ldap/sdap_async_connection.c
@@ -497,6 +497,13 @@ static struct tevent_req *sasl_bind_send(TALLOC_CTX *memctx,
DEBUG(4, ("Executing sasl bind mech: %s, user: %s\n",
sasl_mech, sasl_user));
+ /* Until ldap_sasl_interactive_bind_s() is async we may want to set
+ * LDAP_OPT_RESTART to handle EINTR during poll(). */
+ ret = ldap_set_option(state->sh->ldap, LDAP_OPT_RESTART, LDAP_OPT_ON);
+ if (ret != LDAP_OPT_SUCCESS) {
+ DEBUG(1, ("Failed to set restart option.\n"));
+ }
+
/* FIXME: Warning, this is a sync call!
* No async variant exist in openldap libraries yet */