From: Arran Cudbard-Bell Date: Mon, 2 Jun 2025 05:11:45 +0000 (-0600) Subject: Fix order of yield and search in LDAP mod_modify X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=53756cc070569b8f4971f07954d330d97dea7abe;p=thirdparty%2Ffreeradius-server.git Fix order of yield and search in LDAP mod_modify --- diff --git a/src/modules/rlm_ldap/rlm_ldap.c b/src/modules/rlm_ldap/rlm_ldap.c index ffdb1ff7c1a..23e2c0c5c66 100644 --- a/src/modules/rlm_ldap/rlm_ldap.c +++ b/src/modules/rlm_ldap/rlm_ldap.c @@ -2258,6 +2258,11 @@ static unlang_action_t CC_HINT(nonnull) mod_modify(unlang_result_t *p_result, mo * Find the user first */ if (!usermod_ctx->dn) { + if (unlang_module_yield(request, user_modify_resume, NULL, 0, usermod_ctx) == UNLANG_ACTION_FAIL) { + talloc_free(usermod_ctx); + RETURN_UNLANG_FAIL; + } + /* Pushes a frame for user resolution */ if (rlm_ldap_find_user_async(usermod_ctx, p_result, @@ -2268,11 +2273,6 @@ static unlang_action_t CC_HINT(nonnull) mod_modify(unlang_result_t *p_result, mo RETURN_UNLANG_FAIL; } - if (unlang_module_yield(request, user_modify_resume, NULL, 0, usermod_ctx) == UNLANG_ACTION_FAIL) { - talloc_free(usermod_ctx); - RETURN_UNLANG_FAIL; - } - return UNLANG_ACTION_PUSHED_CHILD; }