]> git.ipfire.org Git - thirdparty/freeradius-server.git/commitdiff
v4: Two amendments to existing LDAP functions to support LDAP sync (#4429)
authorNick Porter <nick@portercomputing.co.uk>
Thu, 24 Mar 2022 15:11:25 +0000 (15:11 +0000)
committerGitHub <noreply@github.com>
Thu, 24 Mar 2022 15:11:25 +0000 (09:11 -0600)
* Detect return of e-syncRefreshRequired LDAP result code

* Retrieve controls for LDAP search reference messages

src/lib/ldap/base.c

index 0d2740feb9dd2b5fe048ff50304fbaae7303dd08..6b8498545392053935af50705bb344157d37aab7 100644 (file)
@@ -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: