From: Alan T. DeKok Date: Mon, 24 Oct 2022 21:30:19 +0000 (-0400) Subject: register function arguments if available X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=f8b8fd7a72ec0ae718f0f1abb4dc6b1ab01695d6;p=thirdparty%2Ffreeradius-server.git register function arguments if available so that the parser can do the correct thing --- diff --git a/src/lib/unlang/xlat_builtin.c b/src/lib/unlang/xlat_builtin.c index e6aa4f423a0..702c8dd5d47 100644 --- a/src/lib/unlang/xlat_builtin.c +++ b/src/lib/unlang/xlat_builtin.c @@ -826,8 +826,9 @@ int xlat_register_redundant(CONF_SECTION *cs) xlat_redundant_type_t xr_type; xlat_redundant_t *xr; xlat_flags_t flags = {}; + xlat_arg_parser_t const *args = NULL; - xlat_t const *xlat; + xlat_t *xlat; CONF_ITEM *ci = NULL; name1 = cf_section_name1(cs); @@ -893,6 +894,12 @@ int xlat_register_redundant(CONF_SECTION *cs) return 1; } + if (!args) { + args = mod_func->args; + } else { + fr_assert(args = mod_func->args); + } + MEM(xrf = talloc_zero(xr, xlat_redundant_func_t)); xrf->func = mod_func; fr_dlist_insert_tail(&xr->funcs, xrf); @@ -922,6 +929,7 @@ int xlat_register_redundant(CONF_SECTION *cs) return -1; } xlat_async_instantiate_set(xlat, xlat_redundant_instantiate, xlat_redundant_inst_t, NULL, xr); + if (args) xlat_func_args(xlat, args); return 0; }