]> git.ipfire.org Git - thirdparty/freeradius-server.git/commitdiff
use t_rules->xlat.runtime_el
authorAlan T. DeKok <aland@freeradius.org>
Sat, 7 Oct 2023 14:34:13 +0000 (10:34 -0400)
committerAlan T. DeKok <aland@freeradius.org>
Sat, 7 Oct 2023 14:34:13 +0000 (10:34 -0400)
src/lib/unlang/xlat_expr.c
src/lib/unlang/xlat_priv.h
src/lib/unlang/xlat_tokenize.c

index 94e09ea0c264b8c5a1077ccfdb86ab4a07834253..a51061f210fb8d1aec811f7d14c87a1dc90ec277 100644 (file)
@@ -2919,6 +2919,8 @@ static fr_slen_t xlat_tokenize_expression_internal(TALLOC_CTX *ctx, xlat_exp_hea
 fr_slen_t xlat_tokenize_expression(TALLOC_CTX *ctx, xlat_exp_head_t **out, fr_sbuff_t *in,
                                 fr_sbuff_parse_rules_t const *p_rules, tmpl_rules_t const *t_rules)
 {
+       fr_assert(!t_rules || !t_rules->xlat.runtime_el);
+
        return xlat_tokenize_expression_internal(ctx, out, in, p_rules, t_rules, false);
 }
 
@@ -2982,7 +2984,6 @@ fr_slen_t xlat_tokenize_ephemeral_expression(TALLOC_CTX *ctx, xlat_exp_head_t **
                                                                 terminal_rules->terminals,
                                                                 &bracket_terms));
        MEM(head = xlat_exp_head_alloc(ctx));
-       head->el = el;
 
        if (t_rules) {
                my_rules = *t_rules;
index 7361ed01afa33e96a0fb8f401b0a7c5b721c87b7..4a0ea8061a73b077bb914a57654789ef3661ba8c 100644 (file)
@@ -186,8 +186,6 @@ struct xlat_exp_head_s {
        bool                    instantiated;   //!< temporary flag until we fix more things
        fr_dict_t const         *dict;          //!< dictionary for this xlat
 
-       fr_event_list_t         *el;            //! for run-time xlats
-
 #ifndef NDEBUG
        char const * _CONST     file;           //!< File where the xlat was allocated.
        int                     line;           //!< Line where the xlat was alocated.
index 204445b9057ef3f55c6f74a0ae9d1cb1ee7b6d1e..3eb7972445e50a1ce0996a356978b901fc80daaa 100644 (file)
@@ -585,7 +585,6 @@ int xlat_tokenize_function_args(xlat_exp_head_t *head, fr_sbuff_t *in,
                goto error;
        }
        xlat_flags_merge(&node->flags, &node->call.args->flags);
-       node->call.args->el = head->el;
 
        /*
         *      Check we have all the required arguments
@@ -996,8 +995,8 @@ int xlat_tokenize_expansion(xlat_exp_head_t *head, fr_sbuff_t *in,
                MEM(node = xlat_exp_alloc(head, XLAT_TMPL, NULL, 0));
                MEM(node->vpt = tmpl_alloc(node, TMPL_TYPE_XLAT, T_BARE_WORD, "", 1));
 
-               if (head->el) {
-                       ret = xlat_tokenize_ephemeral_expression(node->vpt, &child, head->el, in, &attr_p_rules, t_rules);
+               if (t_rules->xlat.runtime_el) {
+                       ret = xlat_tokenize_ephemeral_expression(node->vpt, &child, t_rules->xlat.runtime_el, in, &attr_p_rules, t_rules);
                } else {
                        ret = xlat_tokenize_expression(node->vpt, &child, in, &attr_p_rules, t_rules);
                }
@@ -1661,7 +1660,6 @@ fr_slen_t xlat_tokenize_ephemeral(TALLOC_CTX *ctx, xlat_exp_head_t **out,
        xlat_exp_head_t *head;
 
        MEM(head = xlat_exp_head_alloc(ctx));
-       head->el = el;
 
        if (t_rules) {
                head->dict = t_rules->attr.dict_def;