sbonazzo / rpms / cyrus-sasl

Forked from rpms/cyrus-sasl 2 years ago
Clone

Blame SOURCES/cyrus-sasl-2.1.22-ldap-timeout.patch

b9abc1
commit c9447e1c3ffba88783e5d9396b832be82d3c78fc
b9abc1
Author: Kazuo Ito <ito.kazuo@oss.ntt.co.jp>
b9abc1
Date:   Wed Dec 10 12:03:29 2008 +0900
b9abc1
b9abc1
    support for LDAP_OPT_TIMEOUT
b9abc1
    
b9abc1
    OpenLDAP since 2.4 implements support for this option in ldap_result(),
b9abc1
    among other things.
b9abc1
b9abc1
diff --git a/saslauthd/lak.c b/saslauthd/lak.c
b9abc1
index 803d51f..8714265 100644
b9abc1
--- a/saslauthd/lak.c
b9abc1
+++ b/saslauthd/lak.c
b9abc1
@@ -833,6 +833,11 @@ static int lak_connect(
b9abc1
 		syslog(LOG_WARNING|LOG_AUTH, "Unable to set LDAP_OPT_NETWORK_TIMEOUT %d.%d.", lak->conf->timeout.tv_sec, lak->conf->timeout.tv_usec);
b9abc1
 	}
b9abc1
 
b9abc1
+	rc = ldap_set_option(lak->ld, LDAP_OPT_TIMEOUT, &(lak->conf->timeout));
b9abc1
+	if (rc != LDAP_OPT_SUCCESS) {
b9abc1
+		syslog(LOG_WARNING|LOG_AUTH, "Unable to set LDAP_OPT_TIMEOUT %d.%d.", lak->conf->timeout.tv_sec, lak->conf->timeout.tv_usec);
b9abc1
+	}
b9abc1
+
b9abc1
 	rc = ldap_set_option(lak->ld, LDAP_OPT_TIMELIMIT, &(lak->conf->time_limit));
b9abc1
 	if (rc != LDAP_OPT_SUCCESS) {
b9abc1
 		syslog(LOG_WARNING|LOG_AUTH, "Unable to set LDAP_OPT_TIMELIMIT %d.", lak->conf->time_limit);