From: Alan T. DeKok Date: Fri, 14 Mar 2025 09:40:39 +0000 (+0200) Subject: only re-parse data if it's a bare word X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=879245ca5f79e0784da94039b00504dad67b1780;p=thirdparty%2Ffreeradius-server.git only re-parse data if it's a bare word if we auto-convert XLAT_TMPL + TMPL_TYPE_DATA to XLAT_BOX when parsing expressions, then this code is likely no longer necessary --- diff --git a/src/lib/unlang/xlat_expr.c b/src/lib/unlang/xlat_expr.c index 3a184c4fa54..20a27062a2a 100644 --- a/src/lib/unlang/xlat_expr.c +++ b/src/lib/unlang/xlat_expr.c @@ -1427,7 +1427,7 @@ static xlat_action_t xlat_func_unary_complement(TALLOC_CTX *ctx, fr_dcursor_t *o return xlat_func_unary_op(ctx, out, xctx, request, in, T_COMPLEMENT); } -/** Convert XLAT_BOX arguments to XLAT_TMPL +/** Convert XLAT_BOX arguments to the correct data type. * * xlat_tokenize() just makes all unknown arguments into XLAT_BOX, of data type FR_TYPE_STRING. Whereas * xlat_tokenize_expr() calls tmpl_afrom_substr(), which tries hard to create a particular data type. @@ -1451,6 +1451,7 @@ static int xlat_function_args_to_tmpl(xlat_inst_ctx_t const *xctx) if (!node) continue; if (node->type != XLAT_BOX) continue; if (node->data.type != FR_TYPE_STRING) continue; + if (node->quote != T_BARE_WORD) continue; /* * Try to parse it. If we can't, leave it for a run-time error.