mirror of
https://salsa.debian.org/freeipa-team/freeipa.git
synced 2025-02-25 18:55:28 -06:00
Don't error when find_base() fails if a base is not required
We always have to call find_base() in order to force libldap to open the socket. However, if no base is actually required then there is no reason to error out if find_base() fails. This condition can arise when anonymous binds are disabled. Reviewed-By: Martin Basti <mbasti@redhat.com>
This commit is contained in:
committed by
Martin Basti
parent
34b197afa4
commit
563bddce6d
@@ -175,12 +175,13 @@ static krb5_error_code setup_ldap(const char *uri, krb5_boolean bind,
|
|||||||
|
|
||||||
/* Always find the base since this forces open the socket. */
|
/* Always find the base since this forces open the socket. */
|
||||||
basetmp = find_base(ldp);
|
basetmp = find_base(ldp);
|
||||||
if (basetmp == NULL)
|
if (base != NULL) {
|
||||||
return ENOTCONN;
|
if (basetmp == NULL)
|
||||||
if (base != NULL)
|
return ENOTCONN;
|
||||||
*base = basetmp;
|
*base = basetmp;
|
||||||
else
|
} else {
|
||||||
free(basetmp);
|
free(basetmp);
|
||||||
|
}
|
||||||
|
|
||||||
/* Set default timeout to just return immediately for async requests. */
|
/* Set default timeout to just return immediately for async requests. */
|
||||||
memset(&timeout, 0, sizeof(timeout));
|
memset(&timeout, 0, sizeof(timeout));
|
||||||
|
|||||||
Reference in New Issue
Block a user