]> git.ipfire.org Git - thirdparty/freeradius-server.git/commitdiff
push event list down to ephemeral expressions
authorAlan T. DeKok <aland@freeradius.org>
Fri, 6 Oct 2023 12:58:25 +0000 (08:58 -0400)
committerAlan T. DeKok <aland@freeradius.org>
Fri, 6 Oct 2023 12:58:25 +0000 (08:58 -0400)
src/lib/unlang/xlat_priv.h
src/lib/unlang/xlat_tokenize.c

index 4a0ea8061a73b077bb914a57654789ef3661ba8c..7361ed01afa33e96a0fb8f401b0a7c5b721c87b7 100644 (file)
@@ -186,6 +186,8 @@ 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 c43023fc3e87884cec1ce4d7a3139d516d7bc895..2899537fe3694c4f2756f3843093bb7b178659ec 100644 (file)
@@ -995,7 +995,11 @@ 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));
 
-               ret = xlat_tokenize_expression(node->vpt, &child, in, &attr_p_rules, t_rules);
+               if (head->el) {
+                       ret = xlat_tokenize_ephemeral_expression(node->vpt, &child, head->el, in, &attr_p_rules, t_rules);
+               } else {
+                       ret = xlat_tokenize_expression(node->vpt, &child, in, &attr_p_rules, t_rules);
+               }
                if (ret <= 0) {
                        talloc_free(node);
                        return ret;
@@ -1656,6 +1660,7 @@ 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;