From: Nick Porter Date: Tue, 7 May 2024 17:11:15 +0000 (+0100) Subject: Apply all returned LDAP profile objects X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=2d69a85c3d7303e8b1618354842c4242005f0d54;p=thirdparty%2Ffreeradius-server.git Apply all returned LDAP profile objects --- diff --git a/src/modules/rlm_ldap/profile.c b/src/modules/rlm_ldap/profile.c index 1ddbddd1404..46bd7340a37 100644 --- a/src/modules/rlm_ldap/profile.c +++ b/src/modules/rlm_ldap/profile.c @@ -59,6 +59,7 @@ static unlang_action_t ldap_map_profile_resume(UNUSED rlm_rcode_t *p_result, UNU LDAP *handle; LDAPMessage *entry = NULL; int ldap_errno; + char *dn = NULL; /* * Tell the caller what happened @@ -91,11 +92,20 @@ static unlang_action_t ldap_map_profile_resume(UNUSED rlm_rcode_t *p_result, UNU RDEBUG2("Processing profile attributes"); RINDENT(); - if (fr_ldap_map_do(request, profile_ctx->inst->valuepair_attr, - profile_ctx->expanded, entry) < 0) { - if (profile_ctx->ret) *profile_ctx->ret = LDAP_RESULT_ERROR; + while (entry) { + if (RDEBUG_ENABLED2) { + dn = ldap_get_dn(handle, entry); + RDEBUG2("Processing \"%s\"", dn); + ldap_memfree(dn); + } + RINDENT(); + if (fr_ldap_map_do(request, profile_ctx->inst->valuepair_attr, + profile_ctx->expanded, entry) < 0) { + if (profile_ctx->ret) *profile_ctx->ret = LDAP_RESULT_ERROR; + } + entry = ldap_next_entry(handle, entry); + REXDENT(); } - REXDENT(); finish: