]> git.ipfire.org Git - thirdparty/freeradius-server.git/commitdiff
expose xlat_purify_list() for use in node->func.purify() callbacks
authorAlan T. DeKok <aland@freeradius.org>
Wed, 1 Jun 2022 00:08:29 +0000 (20:08 -0400)
committerAlan T. DeKok <aland@freeradius.org>
Fri, 3 Jun 2022 11:15:52 +0000 (07:15 -0400)
src/lib/unlang/xlat_priv.h
src/lib/unlang/xlat_purify.c

index bbe946df94efce1607b79e05ca89785649be85cd..e35c8ceceeb9bf74073e5e12e53a9d9c033c6b3c 100644 (file)
@@ -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()
  *
index 33882f5fdb4b58d73898f2acd465f0ef8a3dbbe5..31cace61652cbf34c72ef3948c273db1ccab3e63 100644 (file)
@@ -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;