From 541578ee21975ab008db2dcec69bd3c3f8283122 Mon Sep 17 00:00:00 2001 From: Sumit Bose Date: Tue, 23 Mar 2010 17:01:59 +0100 Subject: 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. --- src/providers/ldap/sdap_async_connection.c | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'src') diff --git a/src/providers/ldap/sdap_async_connection.c b/src/providers/ldap/sdap_async_connection.c index f8c69569f..2acbbb896 100644 --- a/src/providers/ldap/sdap_async_connection.c +++ b/src/providers/ldap/sdap_async_connection.c @@ -522,6 +522,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 */ -- cgit