From: Nick Porter Date: Thu, 24 Mar 2022 15:11:25 +0000 (+0000) Subject: v4: Two amendments to existing LDAP functions to support LDAP sync (#4429) X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=d3344aa82a036cda8c0275ba99e5fd078d8ba99c;p=thirdparty%2Ffreeradius-server.git v4: Two amendments to existing LDAP functions to support LDAP sync (#4429) * Detect return of e-syncRefreshRequired LDAP result code * Retrieve controls for LDAP search reference messages --- diff --git a/src/lib/ldap/base.c b/src/lib/ldap/base.c index 0d2740feb9d..6b849854539 100644 --- a/src/lib/ldap/base.c +++ b/src/lib/ldap/base.c @@ -238,6 +238,13 @@ fr_ldap_rcode_t fr_ldap_error_check(LDAPControl ***ctrls, fr_ldap_connection_t c if (ctrls) lib_errno = ldap_get_entry_controls(conn->handle, msg, ctrls); break; + /* + * Retrieve the controls if the message is a reference message + */ + case LDAP_RES_SEARCH_REFERENCE: + if (ctrls) lib_errno = ldap_parse_reference(conn->handle, msg, NULL, ctrls, 0); + break; + /* * An intermediate message updating us on the result of an operation */ @@ -330,6 +337,11 @@ process_error: status = LDAP_PROC_TIMEOUT; break; + case LDAP_SYNC_REFRESH_REQUIRED: + fr_strerror_const("Refresh required"); + status = LDAP_PROC_REFRESH_REQUIRED; + break; + case LDAP_BUSY: case LDAP_UNAVAILABLE: case LDAP_SERVER_DOWN: