From: Alan T. DeKok Date: Wed, 1 Jun 2022 00:08:29 +0000 (-0400) Subject: expose xlat_purify_list() for use in node->func.purify() callbacks X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=212dd731432a6f7d61a19254076702482afb7493;p=thirdparty%2Ffreeradius-server.git expose xlat_purify_list() for use in node->func.purify() callbacks --- diff --git a/src/lib/unlang/xlat_priv.h b/src/lib/unlang/xlat_priv.h index bbe946df94e..e35c8ceceeb 100644 --- a/src/lib/unlang/xlat_priv.h +++ b/src/lib/unlang/xlat_priv.h @@ -40,7 +40,7 @@ extern "C" { typedef fr_slen_t (*xlat_print_t)(fr_sbuff_t *in, xlat_exp_t const *self, void *inst, fr_sbuff_escape_rules_t const *e_rules); typedef int (*xlat_resolve_t)(xlat_exp_t *self, void *inst, xlat_res_rules_t const *xr_rules); -typedef int (*xlat_purify_t)(xlat_exp_t *self, void *inst); +typedef int (*xlat_purify_t)(xlat_exp_t *self, void *inst, request_t *request); typedef struct xlat_s { fr_rb_node_t node; //!< Entry in the xlat function tree. @@ -293,6 +293,10 @@ static inline void xlat_purify_set(xlat_t *xlat, xlat_purify_t func) xlat->purify = func; } +/* + * xlat_purify.c + */ +int xlat_purify_list(xlat_exp_head_t *head, request_t *request); /** Walker callback for xlat_walk() * diff --git a/src/lib/unlang/xlat_purify.c b/src/lib/unlang/xlat_purify.c index 33882f5fdb4..31cace61652 100644 --- a/src/lib/unlang/xlat_purify.c +++ b/src/lib/unlang/xlat_purify.c @@ -54,7 +54,7 @@ static void xlat_value_list_to_xlat(xlat_exp_head_t *head, fr_value_box_list_t * } -static int xlat_purify_list(xlat_exp_head_t *head, request_t *request) +int xlat_purify_list(xlat_exp_head_t *head, request_t *request) { int rcode; bool success; @@ -117,7 +117,7 @@ static int xlat_purify_list(xlat_exp_head_t *head, request_t *request) */ if (!node->flags.pure) { if (node->call.func->purify) { - if (node->call.func->purify(node, node->call.inst->data) < 0) return -1; + if (node->call.func->purify(node, node->call.inst->data, request) < 0) return -1; } else { if (xlat_purify_list(node->call.args, request) < 0) return -1;