From: Alan T. DeKok Date: Fri, 20 Oct 2017 18:05:22 +0000 (-0400) Subject: fail connection if we can't set it async. CID #1419873 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=8bf807129ec2eef8cd18b80ba8a50e4a3987f677;p=thirdparty%2Ffreeradius-server.git fail connection if we can't set it async. CID #1419873 --- diff --git a/src/lib/ldap/connection.c b/src/lib/ldap/connection.c index f7104ceb559..82356cb9199 100644 --- a/src/lib/ldap/connection.c +++ b/src/lib/ldap/connection.c @@ -418,7 +418,10 @@ static fr_connection_state_t _ldap_connection_init(int *fd_out, void *uctx) */ if (fr_ldap_connection_configure(c, c->config) < 0) return FR_CONNECTION_STATE_FAILED; - ldap_set_option(c->handle, LDAP_OPT_CONNECT_ASYNC, LDAP_OPT_ON); /* Don't block */ + /* Don't block */ + if (ldap_set_option(c->handle, LDAP_OPT_CONNECT_ASYNC, LDAP_OPT_ON) != LDAP_OPT_SUCCESS) { + return FR_CONNECTION_STATE_FAILED; + } fr_ldap_connection_timeout_set(c, &to); /* Forces LDAP_X_CONNECTING */ state = fr_ldap_state_next(c);