]> git.ipfire.org Git - thirdparty/freeradius-server.git/commitdiff
Fix order of yield and search in LDAP mod_modify
authorArran Cudbard-Bell <a.cudbardb@freeradius.org>
Mon, 2 Jun 2025 05:11:45 +0000 (23:11 -0600)
committerNick Porter <nick@portercomputing.co.uk>
Wed, 18 Jun 2025 12:53:16 +0000 (13:53 +0100)
src/modules/rlm_ldap/rlm_ldap.c

index ffdb1ff7c1aa9f477762dd8b34ec44274e4979c9..23e2c0c5c66e9f9ba9fa86fa66f5f192df115e96 100644 (file)
@@ -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;
        }