From: Alan T. DeKok Date: Sat, 17 Sep 2022 13:27:18 +0000 (-0400) Subject: save node->fmt as the name of the attribute we're looking for X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=6dfe7e385d1e92c01a827333b10fe9cc0763ca83;p=thirdparty%2Ffreeradius-server.git save node->fmt as the name of the attribute we're looking for 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. --- diff --git a/src/lib/unlang/xlat_expr.c b/src/lib/unlang/xlat_expr.c index e69a7eae847..987263ee73d 100644 --- a/src/lib/unlang/xlat_expr.c +++ b/src/lib/unlang/xlat_expr.c @@ -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;