]> git.ipfire.org Git - thirdparty/freeradius-server.git/commitdiff
save node->fmt as the name of the attribute we're looking for
authorAlan T. DeKok <aland@freeradius.org>
Sat, 17 Sep 2022 13:27:18 +0000 (09:27 -0400)
committerAlan T. DeKok <aland@freeradius.org>
Tue, 20 Sep 2022 19:55:33 +0000 (15:55 -0400)
we should arguably walk through the xlat after it's been parsed,
and replace node->fmt with the *printed* version of the node.
That way we don't have to resort to run-time walking through the
func+argc, etc. in order to print a name for the xlat we're
resolving.

src/lib/unlang/xlat_expr.c

index e69a7eae847368f074a44c5413acaebb28ea12b8..987263ee73d296435ef57041847dea1cdcf25e45 100644 (file)
@@ -122,6 +122,10 @@ static xlat_exp_t *xlat_exists_alloc(TALLOC_CTX *ctx, xlat_exp_t *child)
        fr_assert(node->call.func != NULL);
        node->flags = node->call.func->flags;
 
+       fr_assert(child->type == XLAT_TMPL);
+       fr_assert(tmpl_contains_attr(child->vpt));
+       node->fmt = child->vpt->name;
+
        xlat_func_append_arg(node, child, false);
 
        return node;