Tivoli Directory Server 6.3 libs always return a (bogus) error
when setting LDAP_OPT_CONNECT_TIMEOUT.
This commit is contained in:
@@ -1996,14 +1996,13 @@ sudo_ldap_set_options_conn(LDAP *ld)
|
|||||||
struct timeval tv;
|
struct timeval tv;
|
||||||
tv.tv_sec = ldap_conf.timeout;
|
tv.tv_sec = ldap_conf.timeout;
|
||||||
tv.tv_usec = 0;
|
tv.tv_usec = 0;
|
||||||
|
DPRINTF(("ldap_set_option(LDAP_OPT_TIMEOUT, %ld)",
|
||||||
|
(long)tv.tv_sec), 1);
|
||||||
rc = ldap_set_option(ld, LDAP_OPT_TIMEOUT, &tv);
|
rc = ldap_set_option(ld, LDAP_OPT_TIMEOUT, &tv);
|
||||||
if (rc != LDAP_OPT_SUCCESS) {
|
if (rc != LDAP_OPT_SUCCESS) {
|
||||||
warningx("ldap_set_option(TIMEOUT, %ld): %s",
|
warningx("ldap_set_option(TIMEOUT, %ld): %s",
|
||||||
(long)tv.tv_sec, ldap_err2string(rc));
|
(long)tv.tv_sec, ldap_err2string(rc));
|
||||||
debug_return_int(-1);
|
|
||||||
}
|
}
|
||||||
DPRINTF(("ldap_set_option(LDAP_OPT_TIMEOUT, %ld)",
|
|
||||||
(long)tv.tv_sec), 1);
|
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
#ifdef LDAP_OPT_NETWORK_TIMEOUT
|
#ifdef LDAP_OPT_NETWORK_TIMEOUT
|
||||||
@@ -2012,27 +2011,29 @@ sudo_ldap_set_options_conn(LDAP *ld)
|
|||||||
struct timeval tv;
|
struct timeval tv;
|
||||||
tv.tv_sec = ldap_conf.bind_timelimit / 1000;
|
tv.tv_sec = ldap_conf.bind_timelimit / 1000;
|
||||||
tv.tv_usec = 0;
|
tv.tv_usec = 0;
|
||||||
|
DPRINTF(("ldap_set_option(LDAP_OPT_NETWORK_TIMEOUT, %ld)",
|
||||||
|
(long)tv.tv_sec), 1);
|
||||||
rc = ldap_set_option(ld, LDAP_OPT_NETWORK_TIMEOUT, &tv);
|
rc = ldap_set_option(ld, LDAP_OPT_NETWORK_TIMEOUT, &tv);
|
||||||
|
# if !defined(LDAP_OPT_CONNECT_TIMEOUT) || LDAP_VENDOR_VERSION != 510
|
||||||
|
/* Tivoli Directory Server 6.3 libs always return a (bogus) error. */
|
||||||
if (rc != LDAP_OPT_SUCCESS) {
|
if (rc != LDAP_OPT_SUCCESS) {
|
||||||
warningx("ldap_set_option(NETWORK_TIMEOUT, %ld): %s",
|
warningx("ldap_set_option(NETWORK_TIMEOUT, %ld): %s",
|
||||||
(long)tv.tv_sec, ldap_err2string(rc));
|
(long)tv.tv_sec, ldap_err2string(rc));
|
||||||
debug_return_int(-1);
|
|
||||||
}
|
}
|
||||||
DPRINTF(("ldap_set_option(LDAP_OPT_NETWORK_TIMEOUT, %ld)",
|
# endif
|
||||||
(long)tv.tv_sec), 1);
|
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if defined(LDAP_OPT_X_TLS) && !defined(HAVE_LDAPSSL_INIT)
|
#if defined(LDAP_OPT_X_TLS) && !defined(HAVE_LDAPSSL_INIT)
|
||||||
if (ldap_conf.ssl_mode == SUDO_LDAP_SSL) {
|
if (ldap_conf.ssl_mode == SUDO_LDAP_SSL) {
|
||||||
int val = LDAP_OPT_X_TLS_HARD;
|
int val = LDAP_OPT_X_TLS_HARD;
|
||||||
|
DPRINTF(("ldap_set_option(LDAP_OPT_X_TLS, LDAP_OPT_X_TLS_HARD)"), 1);
|
||||||
rc = ldap_set_option(ld, LDAP_OPT_X_TLS, &val);
|
rc = ldap_set_option(ld, LDAP_OPT_X_TLS, &val);
|
||||||
if (rc != LDAP_SUCCESS) {
|
if (rc != LDAP_SUCCESS) {
|
||||||
warningx("ldap_set_option(LDAP_OPT_X_TLS, LDAP_OPT_X_TLS_HARD): %s",
|
warningx("ldap_set_option(LDAP_OPT_X_TLS, LDAP_OPT_X_TLS_HARD): %s",
|
||||||
ldap_err2string(rc));
|
ldap_err2string(rc));
|
||||||
debug_return_int(-1);
|
debug_return_int(-1);
|
||||||
}
|
}
|
||||||
DPRINTF(("ldap_set_option(LDAP_OPT_X_TLS, LDAP_OPT_X_TLS_HARD)"), 1);
|
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
debug_return_int(0);
|
debug_return_int(0);
|
||||||
|
Reference in New Issue
Block a user