]> git.ipfire.org Git - thirdparty/freeradius-server.git/commitdiff
add p_result to unlang_tmpl_push()
authorAlan T. DeKok <aland@freeradius.org>
Thu, 10 Jul 2025 19:35:06 +0000 (15:35 -0400)
committerAlan T. DeKok <aland@freeradius.org>
Mon, 14 Jul 2025 11:22:08 +0000 (07:22 -0400)
16 files changed:
src/lib/server/trigger.c
src/lib/unlang/call_env.c
src/lib/unlang/edit.c
src/lib/unlang/limit.c
src/lib/unlang/map.c
src/lib/unlang/module.c
src/lib/unlang/timeout.c
src/lib/unlang/tmpl.c
src/lib/unlang/tmpl.h
src/lib/unlang/xlat.c
src/lib/unlang/xlat_eval.c
src/modules/rlm_ldap/groups.c
src/modules/rlm_ldap/rlm_ldap.c
src/modules/rlm_mschap/rlm_mschap.c
src/modules/rlm_sql/rlm_sql.c
src/modules/rlm_sqlippool/rlm_sqlippool.c

index 7270645e97d8b30d3689aa52354c1f9b75edf1a9..e2d56eed5d1c72da909b00448efe91f9b7271c46 100644 (file)
@@ -391,7 +391,7 @@ int trigger_exec(unlang_interpret_t *intp,
                MEM(vpt = tmpl_alloc(trigger, TMPL_TYPE_EXEC, quote, value, talloc_array_length(value)));
                tmpl_set_xlat(vpt, xlat);
 
-               if (unlang_tmpl_push(trigger, &trigger->out, request, vpt,
+               if (unlang_tmpl_push(trigger, NULL, &trigger->out, request, vpt,
                                     &(unlang_tmpl_args_t) {
                                             .type = UNLANG_TMPL_ARGS_TYPE_EXEC,
                                             .exec = {
index a7705a53a124e63cab665e458b9768e4f5fdf3c2..614a5891fbb9f66ac948d6e1b2a99dfe69e8ff63 100644 (file)
@@ -232,7 +232,8 @@ static unlang_action_t call_env_expand_start(UNUSED unlang_result_t *p_result, r
                ctx = *out;
        }
 
-       if (unlang_tmpl_push(ctx, &call_env_rctx->tmpl_expanded, request, call_env_rctx->last_expanded->data.tmpl,
+       if (unlang_tmpl_push(ctx, &call_env_rctx->expansion_result, &call_env_rctx->tmpl_expanded, request,
+                            call_env_rctx->last_expanded->data.tmpl,
                             NULL) < 0) return UNLANG_ACTION_FAIL;
 
        return UNLANG_ACTION_PUSHED_CHILD;
index 4abe1e624e483ebf07f354f8ac3af98cc7d284b7..c02e1fedaf546a17ec195a825b3c237286b2e6f0 100644 (file)
@@ -162,7 +162,7 @@ static int tmpl_to_values(TALLOC_CTX *ctx, edit_result_t *out, request_t *reques
                return 0;
 
        case TMPL_TYPE_EXEC:
-               if (unlang_tmpl_push(ctx, &out->result, request, vpt, NULL) < 0) return -1;
+               if (unlang_tmpl_push(ctx, &out->success, &out->result, request, vpt, NULL) < 0) return -1;
                return 1;
 
        case TMPL_TYPE_XLAT:
index 1dc6c90031ff15552b997a0e4bb7d58624d321fd..e20ee88e246592d438542f1434371b1eab3a69fc 100644 (file)
@@ -115,7 +115,7 @@ static unlang_action_t unlang_limit(unlang_result_t *p_result, request_t *reques
 
        fr_value_box_list_init(&state->result);
 
-       if (unlang_tmpl_push(state, &state->result, request, gext->vpt, NULL) < 0) return UNLANG_ACTION_FAIL;
+       if (unlang_tmpl_push(state, NULL, &state->result, request, gext->vpt, NULL) < 0) return UNLANG_ACTION_FAIL;
 
        frame_repeat(frame, unlang_limit_xlat_done);
 
index 71c1fd0575b77d4e0ead29180cef29de2807ffd9..5b298157a12515b834e38c79886f4aa298e0bfb8 100644 (file)
@@ -157,7 +157,7 @@ static unlang_action_t list_mod_create(unlang_result_t *p_result, request_t *req
                                break;
 
                        case TMPL_TYPE_EXEC:
-                               if (unlang_tmpl_push(update_state, &update_state->lhs_result,
+                               if (unlang_tmpl_push(update_state, NULL, &update_state->lhs_result,
                                                     request, map->lhs,
                                                     NULL) < 0) {
                                        return UNLANG_ACTION_STOP_PROCESSING;
@@ -197,7 +197,7 @@ static unlang_action_t list_mod_create(unlang_result_t *p_result, request_t *req
                                break;
 
                        case TMPL_TYPE_EXEC:
-                               if (unlang_tmpl_push(update_state, &update_state->rhs_result,
+                               if (unlang_tmpl_push(update_state, NULL, &update_state->rhs_result,
                                                     request, map->rhs, NULL) < 0) {
                                        return UNLANG_ACTION_STOP_PROCESSING;
                                }
@@ -418,7 +418,7 @@ static unlang_action_t unlang_map_state_init(unlang_result_t *p_result, request_
                break;
        }
        case TMPL_TYPE_EXEC:
-               if (unlang_tmpl_push(map_proc_state, &map_proc_state->src_result,
+               if (unlang_tmpl_push(map_proc_state, NULL, &map_proc_state->src_result,
                                     request, inst->src, NULL) < 0) {
                        return UNLANG_ACTION_STOP_PROCESSING;
                }
index 48f24cb643f25902d2fe2364efebc5d0da21a704..25854e53fcf904894a3ec24b78d946c0c76249e5 100644 (file)
@@ -241,7 +241,7 @@ unlang_action_t unlang_module_yield_to_tmpl(TALLOC_CTX *ctx, fr_value_box_list_t
        /*
         *      Push the xlat function
         */
-       if (unlang_tmpl_push(ctx, out, request, vpt, args) < 0) return UNLANG_ACTION_FAIL;
+       if (unlang_tmpl_push(ctx, NULL, out, request, vpt, args) < 0) return UNLANG_ACTION_FAIL;
 
        return UNLANG_ACTION_PUSHED_CHILD;
 }
index bdc07ef5282bf445410591536b2900242529c2e9..d7fcdb50745832a3c555a42b4936d25332009abd 100644 (file)
@@ -175,7 +175,7 @@ static unlang_action_t unlang_timeout(unlang_result_t *p_result, request_t *requ
 
        fr_value_box_list_init(&state->result);
 
-       if (unlang_tmpl_push(state, &state->result, request, gext->vpt, NULL) < 0) return UNLANG_ACTION_FAIL;
+       if (unlang_tmpl_push(state, NULL, &state->result, request, gext->vpt, NULL) < 0) return UNLANG_ACTION_FAIL;
 
        frame_repeat(frame, unlang_timeout_done);
 
index 0325958cd4f1d35fc7521ad3270c7e928e28905d..c005709578a4e4c550cc078c1dd584e1ae75dc39 100644 (file)
@@ -28,6 +28,7 @@ RCSID("$Id$")
 #include <freeradius-devel/unlang/tmpl.h>
 #include <freeradius-devel/server/exec.h>
 #include <freeradius-devel/util/syserror.h>
+#include <freeradius-devel/unlang/mod_action.h>
 #include "tmpl_priv.h"
 #include <signal.h>
 
@@ -247,7 +248,7 @@ static unlang_action_t unlang_tmpl(unlang_result_t *p_result, request_t *request
         */
        frame_repeat(frame, unlang_tmpl_exec_wait_resume);
 push:
-       if (unlang_xlat_push(state->ctx, &state->xlat_result, &state->list, request, tmpl_xlat(ut->tmpl), false) < 0) {
+       if (unlang_xlat_push(state->ctx, &state->xlat_result, &state->list, request, tmpl_xlat(ut->tmpl), UNLANG_SUB_FRAME) < 0) {
        fail:
                return UNLANG_ACTION_STOP_PROCESSING;
        }
@@ -258,6 +259,7 @@ push:
 /** Push a tmpl onto the stack for evaluation
  *
  * @param[in] ctx              To allocate value boxes and values in.
+ * @param[out] p_result                The frame result
  * @param[out] out             The value_box created from the tmpl.  May be NULL,
  *                             in which case the result is discarded.
  * @param[in] request          The current request.
@@ -268,7 +270,7 @@ push:
  *     - 0 on success
  *     - -1 on failure
  */
-int unlang_tmpl_push(TALLOC_CTX *ctx, fr_value_box_list_t *out, request_t *request,
+int unlang_tmpl_push(TALLOC_CTX *ctx, unlang_result_t *p_result, fr_value_box_list_t *out, request_t *request,
                     tmpl_t const *tmpl, unlang_tmpl_args_t *args)
 {
        unlang_stack_t                  *stack = request->stack;
@@ -277,7 +279,7 @@ int unlang_tmpl_push(TALLOC_CTX *ctx, fr_value_box_list_t *out, request_t *reque
 
        unlang_tmpl_t                   *ut;
 
-       static unlang_t tmpl_instruction = {
+       static unlang_t const tmpl_instruction_return = {
                .type = UNLANG_TYPE_TMPL,
                .name = "tmpl",
                .debug_name = "tmpl",
@@ -297,23 +299,38 @@ int unlang_tmpl_push(TALLOC_CTX *ctx, fr_value_box_list_t *out, request_t *reque
                },
        };
 
+       static const unlang_t tmpl_instruction_fail = {
+               .type = UNLANG_TYPE_TMPL,
+               .name = "tmpl",
+               .debug_name = "tmpl",
+               .actions = DEFAULT_MOD_ACTIONS,
+       };
+
        if (tmpl_needs_resolving(tmpl)) {
                REDEBUG("Expansion \"%pV\" needs to be resolved before it is used", fr_box_strvalue_len(tmpl->name, tmpl->len));
                return -1;
        }
 
+       /*
+        *      Avoid an extra stack frame and more work.  But only if the caller hands us a result.
+        *      Otherwise, we have to return UNLANG_FAIL.
+        */
+       if (p_result && (tmpl_rules_cast(tmpl) == FR_TYPE_NULL) && tmpl_is_xlat(tmpl)) {
+               return unlang_xlat_push(ctx, p_result, out, request, tmpl_xlat(tmpl), UNLANG_SUB_FRAME);
+       }
+
        fr_assert(!tmpl_contains_regex(tmpl));
 
        MEM(ut = talloc(stack, unlang_tmpl_t));
        *ut = (unlang_tmpl_t){
-               .self = tmpl_instruction,
+               .self =  p_result ? tmpl_instruction_fail : tmpl_instruction_return,
                .tmpl = tmpl
        };
 
        /*
         *      Push a new tmpl frame onto the stack
         */
-       if (unlang_interpret_push(NULL, request, unlang_tmpl_to_generic(ut),
+       if (unlang_interpret_push(p_result, request, unlang_tmpl_to_generic(ut),
                                  FRAME_CONF(RLM_MODULE_NOT_SET, false), UNLANG_NEXT_STOP) < 0) return -1;
 
        frame = &stack->frame[stack->depth];
index 05c8de3f00602b954cf287e3d1d62fed343d103f..5ba222c720e32305a14e29fa5093e56b05f647cb 100644 (file)
@@ -108,7 +108,7 @@ typedef void (*fr_unlang_tmpl_signal_t)(request_t *request, void *rctx, fr_signa
  */
 typedef unlang_action_t (*fr_unlang_tmpl_resume_t)(unlang_result_t *p_result, request_t *request, void *rctx);
 
-int            unlang_tmpl_push(TALLOC_CTX *ctx, fr_value_box_list_t *out,
+int            unlang_tmpl_push(TALLOC_CTX *ctx, unlang_result_t *p_result, fr_value_box_list_t *out,
                                 request_t *request, tmpl_t const *tmpl, unlang_tmpl_args_t *args)
                CC_HINT(warn_unused_result);
 
index 658480d0fc6a5767f252c60da1a3dda97c526d52..defa3b2bcf4bc9debedfa68b678a378e65a34f76 100644 (file)
@@ -270,6 +270,7 @@ static int unlang_xlat_push_internal(TALLOC_CTX *ctx, unlang_result_t *p_result,
 /** Push a pre-compiled xlat onto the stack for evaluation
  *
  * @param[in] ctx              To allocate value boxes and values in.
+ * @param[out] p_result                The frame result
  * @param[out] out             Where to write the result of the expansion.
  * @param[in] request          to push xlat onto.
  * @param[in] xlat             to evaluate.
index 126900c325f5e9d9271823bbbdaa410450cf38f8..fa7935403e8fb55b5c12b7765bc6b7363be5c7a1 100644 (file)
@@ -1453,7 +1453,7 @@ xlat_action_t xlat_frame_eval(TALLOC_CTX *ctx, fr_dcursor_t *out, xlat_exp_head_
 
                                if (unlang_xlat_yield(request, xlat_exec_resume, NULL, 0, rctx) != XLAT_ACTION_YIELD) goto fail;
 
-                               if (unlang_tmpl_push(ctx, &rctx->list, request, node->vpt,
+                               if (unlang_tmpl_push(ctx, NULL, &rctx->list, request, node->vpt,
                                                     TMPL_ARGS_EXEC(NULL, fr_time_delta_from_sec(EXEC_TIMEOUT),
                                                                    false, &rctx->status)) < 0) goto fail;
 
index b54d231a8a0017a0de5f691866cfaaf127b49f2d..a3050a5d690cd00816e5c78029bbdf2e647f19dd 100644 (file)
@@ -728,7 +728,7 @@ unlang_action_t rlm_ldap_cacheable_groupobj(unlang_result_t *p_result, request_t
                RETURN_UNLANG_FAIL;
        }
 
-       if (unlang_tmpl_push(group_ctx, &group_ctx->expanded_filter, request, autz_ctx->call_env->group_filter, NULL) < 0) goto error;
+       if (unlang_tmpl_push(group_ctx, NULL, &group_ctx->expanded_filter, request, autz_ctx->call_env->group_filter, NULL) < 0) goto error;
 
        return UNLANG_ACTION_PUSHED_CHILD;
 }
@@ -855,7 +855,7 @@ unlang_action_t rlm_ldap_check_groupobj_dynamic(unlang_result_t *p_result, reque
                RETURN_UNLANG_FAIL;
        }
 
-       if (unlang_tmpl_push(group_ctx, &group_ctx->expanded_filter, request, group_ctx->filter_tmpl, NULL) < 0) goto error;
+       if (unlang_tmpl_push(group_ctx, NULL, &group_ctx->expanded_filter, request, group_ctx->filter_tmpl, NULL) < 0) goto error;
 
        return UNLANG_ACTION_PUSHED_CHILD;
 }
index 238019feee0452afdfcac87b9d5225baa6232f6f..bbfd2d1a4ef229a185cc3a05b58564659338b1b0 100644 (file)
@@ -2172,7 +2172,7 @@ next:
         */
        if (usermod_ctx->current_mod < usermod_ctx->num_mods) {
                if (unlang_module_yield(request, user_modify_mod_build_resume, NULL, 0, usermod_ctx) == UNLANG_ACTION_FAIL) RETURN_UNLANG_FAIL;
-               if (unlang_tmpl_push(usermod_ctx, &usermod_ctx->expanded, request,
+               if (unlang_tmpl_push(usermod_ctx, NULL, &usermod_ctx->expanded, request,
                                     usermod_ctx->call_env->mod[usermod_ctx->current_mod]->tmpl, NULL) < 0) RETURN_UNLANG_FAIL;
                return UNLANG_ACTION_PUSHED_CHILD;
        }
@@ -2213,7 +2213,7 @@ static unlang_action_t CC_HINT(nonnull) user_modify_resume(unlang_result_t *p_re
 
        if (unlang_module_yield(request, user_modify_mod_build_resume, NULL, 0, usermod_ctx) == UNLANG_ACTION_FAIL) goto fail;
 ;
-       if (unlang_tmpl_push(usermod_ctx, &usermod_ctx->expanded, request,
+       if (unlang_tmpl_push(usermod_ctx, NULL, &usermod_ctx->expanded, request,
                             usermod_ctx->call_env->mod[0]->tmpl, NULL) < 0) goto fail;
 
        return UNLANG_ACTION_PUSHED_CHILD;
index ac6ae5af39783e4aa4ab2bb60f9bdb77e913f5e5..825c81fb2067ac7c926cfd57fdf25d668d234060 100644 (file)
@@ -2310,7 +2310,7 @@ static unlang_action_t CC_HINT(nonnull) mod_authenticate(unlang_result_t *p_resu
                        }
 
                        fr_value_box_list_init(&auth_ctx->cpw_ctx->local_cpw_result);
-                       if (unlang_tmpl_push(auth_ctx, &auth_ctx->cpw_ctx->local_cpw_result, request,
+                       if (unlang_tmpl_push(auth_ctx, NULL, &auth_ctx->cpw_ctx->local_cpw_result, request,
                                             env_data->local_cpw, NULL) < 0) RETURN_UNLANG_FAIL;
                        break;
 #else
@@ -2336,7 +2336,7 @@ static unlang_action_t CC_HINT(nonnull) mod_authenticate(unlang_result_t *p_resu
                         */
                        if (env_data->ntlm_cpw_domain) {
                                fr_value_box_list_init(&auth_ctx->cpw_ctx->cpw_domain);
-                               if (unlang_tmpl_push(auth_ctx, &auth_ctx->cpw_ctx->cpw_domain, request,
+                               if (unlang_tmpl_push(auth_ctx, NULL, &auth_ctx->cpw_ctx->cpw_domain, request,
                                                env_data->ntlm_cpw_domain, NULL) < 0) RETURN_UNLANG_FAIL;
                        }
 
@@ -2345,7 +2345,7 @@ static unlang_action_t CC_HINT(nonnull) mod_authenticate(unlang_result_t *p_resu
                        /*
                         *      b) Expanding the username
                         */
-                       if (unlang_tmpl_push(auth_ctx, &auth_ctx->cpw_ctx->cpw_user, request,
+                       if (unlang_tmpl_push(auth_ctx, NULL, &auth_ctx->cpw_ctx->cpw_user, request,
                                             env_data->ntlm_cpw_username, NULL) < 0) RETURN_UNLANG_FAIL;
                        break;
                }
index 2f22a01fc589fd3b504db08102c5dc250c7a7868..91887bf8db9ff5f04581921021917cb29ce610f5 100644 (file)
@@ -1221,7 +1221,7 @@ static xlat_action_t sql_group_xlat(UNUSED TALLOC_CTX *ctx, UNUSED fr_dcursor_t
        fr_value_box_list_init(&xlat_ctx->query);
 
        if (unlang_xlat_yield(request, sql_group_xlat_resume, NULL, 0, xlat_ctx) != XLAT_ACTION_YIELD) return XLAT_ACTION_FAIL;
-       if (unlang_tmpl_push(xlat_ctx, &xlat_ctx->query, request, call_env->membership_query, NULL) < 0) return XLAT_ACTION_FAIL;
+       if (unlang_tmpl_push(xlat_ctx, NULL, &xlat_ctx->query, request, call_env->membership_query, NULL) < 0) return XLAT_ACTION_FAIL;
        return XLAT_ACTION_PUSH_UNLANG;
 }
 
@@ -1373,7 +1373,7 @@ static unlang_action_t CC_HINT(nonnull)  mod_autz_group_resume(unlang_result_t *
 
                if (call_env->group_check_query) {
                        if (unlang_module_yield(request, mod_autz_group_resume, NULL, 0, mctx->rctx) == UNLANG_ACTION_FAIL) RETURN_UNLANG_FAIL;
-                       if (unlang_tmpl_push(autz_ctx, &autz_ctx->query, request,
+                       if (unlang_tmpl_push(autz_ctx, NULL, &autz_ctx->query, request,
                                             call_env->group_check_query, NULL) < 0) RETURN_UNLANG_FAIL;
                        return UNLANG_ACTION_PUSHED_CHILD;
                }
@@ -1428,7 +1428,7 @@ static unlang_action_t CC_HINT(nonnull)  mod_autz_group_resume(unlang_result_t *
                if (call_env->group_reply_query) {
                group_reply_push:
                        if (unlang_module_yield(request, mod_autz_group_resume, NULL, 0, mctx->rctx) == UNLANG_ACTION_FAIL) RETURN_UNLANG_FAIL;
-                       if (unlang_tmpl_push(autz_ctx, &autz_ctx->query, request,
+                       if (unlang_tmpl_push(autz_ctx, NULL, &autz_ctx->query, request,
                                             call_env->group_reply_query, NULL) < 0) RETURN_UNLANG_FAIL;
                        autz_ctx->status = autz_ctx->status & SQL_AUTZ_STAGE_GROUP ? SQL_AUTZ_GROUP_REPLY : SQL_AUTZ_PROFILE_REPLY;
                        return UNLANG_ACTION_PUSHED_CHILD;
@@ -1593,7 +1593,7 @@ static unlang_action_t CC_HINT(nonnull) mod_authorize_resume(unlang_result_t *p_
                if (!call_env->reply_query) goto skip_reply;
 
                if (unlang_module_yield(request, mod_authorize_resume, NULL, 0, autz_ctx) == UNLANG_ACTION_FAIL) RETURN_UNLANG_FAIL;
-               if (unlang_tmpl_push(autz_ctx, &autz_ctx->query, request, call_env->reply_query, NULL) < 0) RETURN_UNLANG_FAIL;
+               if (unlang_tmpl_push(autz_ctx, NULL, &autz_ctx->query, request, call_env->reply_query, NULL) < 0) RETURN_UNLANG_FAIL;
                autz_ctx->status = SQL_AUTZ_REPLY;
                return UNLANG_ACTION_PUSHED_CHILD;
 
@@ -1656,7 +1656,7 @@ static unlang_action_t CC_HINT(nonnull) mod_authorize_resume(unlang_result_t *p_
                        }
 
                        if (unlang_module_yield(request, mod_autz_group_resume, NULL, 0, autz_ctx) == UNLANG_ACTION_FAIL) RETURN_UNLANG_FAIL;
-                       if (unlang_tmpl_push(autz_ctx, &autz_ctx->query, request,
+                       if (unlang_tmpl_push(autz_ctx, NULL, &autz_ctx->query, request,
                                             call_env->membership_query, NULL) < 0) RETURN_UNLANG_FAIL;
                        autz_ctx->status = SQL_AUTZ_GROUP_MEMB;
                        return UNLANG_ACTION_PUSHED_CHILD;
@@ -1739,13 +1739,13 @@ static unlang_action_t CC_HINT(nonnull) mod_authorize(unlang_result_t *p_result,
         *      Query the check table to find any conditions associated with this user/realm/whatever...
         */
        if (call_env->check_query) {
-               if (unlang_tmpl_push(autz_ctx, &autz_ctx->query, request, call_env->check_query, NULL) < 0) goto error;
+               if (unlang_tmpl_push(autz_ctx, NULL, &autz_ctx->query, request, call_env->check_query, NULL) < 0) goto error;
                autz_ctx->status = SQL_AUTZ_CHECK;
                return UNLANG_ACTION_PUSHED_CHILD;
        }
 
        if (call_env->reply_query) {
-               if (unlang_tmpl_push(autz_ctx, &autz_ctx->query, request, call_env->reply_query, NULL) < 0) goto error;
+               if (unlang_tmpl_push(autz_ctx, NULL, &autz_ctx->query, request, call_env->reply_query, NULL) < 0) goto error;
                autz_ctx->status = SQL_AUTZ_REPLY;
                return UNLANG_ACTION_PUSHED_CHILD;
        }
@@ -1753,7 +1753,7 @@ static unlang_action_t CC_HINT(nonnull) mod_authorize(unlang_result_t *p_result,
        /*
         *      Neither check nor reply queries were set, so we must be doing group stuff
         */
-       if (unlang_tmpl_push(autz_ctx, &autz_ctx->query, request, call_env->membership_query, NULL) < 0) goto error;
+       if (unlang_tmpl_push(autz_ctx, NULL, &autz_ctx->query, request, call_env->membership_query, NULL) < 0) goto error;
        autz_ctx->status = SQL_AUTZ_GROUP_MEMB;
        return UNLANG_ACTION_PUSHED_CHILD;
 }
@@ -1850,7 +1850,7 @@ next:
        redundant_ctx->query_no++;
        if (redundant_ctx->query_no >= talloc_array_length(call_env->query)) RETURN_UNLANG_NOOP;
        if (unlang_module_yield(request, mod_sql_redundant_resume, NULL, 0, redundant_ctx) == UNLANG_ACTION_FAIL) RETURN_UNLANG_FAIL;
-       if (unlang_tmpl_push(redundant_ctx, &redundant_ctx->query, request, call_env->query[redundant_ctx->query_no], NULL) < 0) RETURN_UNLANG_FAIL;
+       if (unlang_tmpl_push(redundant_ctx, NULL, &redundant_ctx->query, request, call_env->query[redundant_ctx->query_no], NULL) < 0) RETURN_UNLANG_FAIL;
 
        RDEBUG2("Trying next query...");
 
index 7fb966304e840837943cbe0f784c8df5a3fd46a2..bbbca456aa73dfd3bb2081bb4d52c5aecc7103bd 100644 (file)
@@ -283,7 +283,7 @@ static unlang_action_t mod_alloc_resume(unlang_result_t *p_result, module_ctx_t
                if (env->existing) {
                        alloc_ctx->status = IPPOOL_ALLOC_EXISTING;
                        REPEAT_MOD_ALLOC_RESUME;
-                       if (unlang_tmpl_push(alloc_ctx, &alloc_ctx->values, request, env->existing, NULL) < 0) {
+                       if (unlang_tmpl_push(alloc_ctx, NULL, &alloc_ctx->values, request, env->existing, NULL) < 0) {
                        error:
                                talloc_free(alloc_ctx);
                                RETURN_UNLANG_FAIL;
@@ -310,7 +310,7 @@ static unlang_action_t mod_alloc_resume(unlang_result_t *p_result, module_ctx_t
                if (env->requested && (env->requested_address.type != FR_TYPE_NULL)) {
                        alloc_ctx->status = IPPOOL_ALLOC_REQUESTED;
                        REPEAT_MOD_ALLOC_RESUME;
-                       if (unlang_tmpl_push(alloc_ctx, &alloc_ctx->values, request, env->requested, NULL) < 0) goto error;
+                       if (unlang_tmpl_push(alloc_ctx, NULL, &alloc_ctx->values, request, env->requested, NULL) < 0) goto error;
                        return UNLANG_ACTION_PUSHED_CHILD;
                }
                goto expand_find;
@@ -333,7 +333,7 @@ static unlang_action_t mod_alloc_resume(unlang_result_t *p_result, module_ctx_t
                 */
                alloc_ctx->status = IPPOOL_ALLOC_FIND;
                REPEAT_MOD_ALLOC_RESUME;
-               if (unlang_tmpl_push(alloc_ctx, &alloc_ctx->values, request, env->find, NULL) < 0) goto error;
+               if (unlang_tmpl_push(alloc_ctx, NULL, &alloc_ctx->values, request, env->find, NULL) < 0) goto error;
                return UNLANG_ACTION_PUSHED_CHILD;
 
        case IPPOOL_ALLOC_FIND:
@@ -364,7 +364,7 @@ static unlang_action_t mod_alloc_resume(unlang_result_t *p_result, module_ctx_t
                if (env->pool_check) {
                        alloc_ctx->status = IPPOOL_ALLOC_POOL_CHECK;
                        REPEAT_MOD_ALLOC_RESUME;
-                       if (unlang_tmpl_push(alloc_ctx, &alloc_ctx->values, request, env->pool_check, NULL) < 0) goto error;
+                       if (unlang_tmpl_push(alloc_ctx, NULL, &alloc_ctx->values, request, env->pool_check, NULL) < 0) goto error;
                        return UNLANG_ACTION_PUSHED_CHILD;
                }
        no_address:
@@ -405,7 +405,7 @@ static unlang_action_t mod_alloc_resume(unlang_result_t *p_result, module_ctx_t
                if (env->update) {
                        alloc_ctx->status = IPPOOL_ALLOC_UPDATE;
                        REPEAT_MOD_ALLOC_RESUME;
-                       if (unlang_tmpl_push(alloc_ctx, &alloc_ctx->values, request, env->update, NULL) < 0) goto error;
+                       if (unlang_tmpl_push(alloc_ctx, NULL, &alloc_ctx->values, request, env->update, NULL) < 0) goto error;
                        return UNLANG_ACTION_PUSHED_CHILD;
                }