]> git.ipfire.org Git - thirdparty/freeradius-server.git/commitdiff
Pass module instance data to call env section custom parser
authorNick Porter <nick@portercomputing.co.uk>
Tue, 16 Apr 2024 16:42:10 +0000 (17:42 +0100)
committerNick Porter <nick@portercomputing.co.uk>
Wed, 17 Apr 2024 08:59:29 +0000 (09:59 +0100)
src/lib/unlang/call_env.c
src/lib/unlang/call_env.h
src/modules/rlm_cache/rlm_cache.c
src/modules/rlm_detail/rlm_detail.c
src/modules/rlm_ldap/rlm_ldap.c

index 42e8f7da68e6a3cfb79d2537074349cc7b80e31c..681794912920f0aad1dd1ae374c56d1ee63e815e 100644 (file)
@@ -422,7 +422,7 @@ static int call_env_parse(TALLOC_CTX *ctx, call_env_parsed_head_t *parsed, char
                                call_env_parsed_t *last = call_env_parsed_tail(parsed);
 
                                if (rule->section.func(ctx, parsed, t_rules, cf_section_to_item(subcs), section_name1,
-                                                      section_name2, rule) < 0) {
+                                                      section_name2, data, rule) < 0) {
                                        cf_log_perr(cs, "Failed parsing configuration section %s", rule->name);
                                        talloc_free(call_env_parsed);
                                        return -1;
index e90ccb10e6b6ddb1583d1f4916e00f0966cafa55..ed81d1834caead74c064d7f336d8439db2a9cf68 100644 (file)
@@ -158,7 +158,7 @@ typedef int (*call_env_parse_pair_t)(TALLOC_CTX *ctx, void *out, tmpl_rules_t co
  *     - 0 on success.
  *     - -1 on failure.
  */
-typedef int (*call_env_parse_section_t)(TALLOC_CTX *ctx, call_env_parsed_head_t *out, tmpl_rules_t const *t_rules, CONF_ITEM *ci, char const *section_name1, char const *section_name2, call_env_parser_t const *rule);
+typedef int (*call_env_parse_section_t)(TALLOC_CTX *ctx, call_env_parsed_head_t *out, tmpl_rules_t const *t_rules, CONF_ITEM *ci, char const *section_name1, char const *section_name2, void const *data, call_env_parser_t const *rule);
 
 /** Per method call config
  *
index d4b67f7887569b2ba1b6508565b7332666eb2d68..e2192ab223e0dcd3db0176a4f724983517120861 100644 (file)
@@ -43,7 +43,7 @@ RCSID("$Id$")
 extern module_rlm_t rlm_cache;
 
 static int cache_key_parse(TALLOC_CTX *ctx, void *out, tmpl_rules_t const *t_rules, CONF_ITEM *ci, char const *section_name1, char const *section_name2, void const *data, call_env_parser_t const *rule);
-static int cache_update_section_parse(TALLOC_CTX *ctx, call_env_parsed_head_t *out, tmpl_rules_t const *t_rules, CONF_ITEM *ci, UNUSED char const *section_name1, UNUSED char const *section_name2, UNUSED call_env_parser_t const *rule);
+static int cache_update_section_parse(TALLOC_CTX *ctx, call_env_parsed_head_t *out, tmpl_rules_t const *t_rules, CONF_ITEM *ci, char const *section_name1, char const *section_name2, void const *data, call_env_parser_t const *rule);
 
 static const conf_parser_t module_config[] = {
        { FR_CONF_OFFSET_TYPE_FLAGS("driver", FR_TYPE_VOID, 0, rlm_cache_t, driver_submodule), .dflt = "rbtree",
@@ -1404,7 +1404,7 @@ static int cache_verify(map_t *map, void *uctx)
 
 static int cache_update_section_parse(TALLOC_CTX *ctx, call_env_parsed_head_t *out, tmpl_rules_t const *t_rules,
                                      CONF_ITEM *ci, UNUSED char const *section_name1, UNUSED char const *section_name2,
-                                     UNUSED call_env_parser_t const *rule)
+                                     UNUSED void const *data, UNUSED call_env_parser_t const *rule)
 {
        CONF_SECTION            *update = cf_item_to_section(ci);
        call_env_parsed_t       *parsed;
index 08baccbd2d4c62f5fb9a84b2b27e22f88f774666..0c39266cde0a24c090a0698f92ce541dccd4fc07 100644 (file)
@@ -428,7 +428,7 @@ static int call_env_filename_parse(TALLOC_CTX *ctx, void *out, tmpl_rules_t cons
 
 static int call_env_suppress_parse(TALLOC_CTX *ctx, call_env_parsed_head_t *out, tmpl_rules_t const *t_rules,
                                   CONF_ITEM *ci, UNUSED char const *section_name1, UNUSED char const *section_name2,
-                                  UNUSED call_env_parser_t const *rule)
+                                  UNUSED void const *data, UNUSED call_env_parser_t const *rule)
 {
        CONF_SECTION const      *cs = cf_item_to_section(ci);
        CONF_SECTION const      *parent = cf_item_to_section(cf_parent(ci));
index 8485f79909be0585fbf6d83c397f95004e66c69e..fc789e2174ba69fff74e64324902c39ebeeafd2e 100644 (file)
@@ -72,7 +72,7 @@ typedef struct {
        map_list_t      *profile_map;                   //!< List of maps to apply to the profile.
 } ldap_xlat_profile_call_env_t;
 
-static int ldap_update_section_parse(TALLOC_CTX *ctx, call_env_parsed_head_t *out, tmpl_rules_t const *t_rules, CONF_ITEM *ci, UNUSED char const *section_name1, UNUSED char const *section_name2, UNUSED call_env_parser_t const *rule);
+static int ldap_update_section_parse(TALLOC_CTX *ctx, call_env_parsed_head_t *out, tmpl_rules_t const *t_rules, CONF_ITEM *ci, char const *section_name1, char const *section_name2, void const *data, call_env_parser_t const *rule);
 
 static int ldap_group_filter_parse(TALLOC_CTX *ctx, void *out, tmpl_rules_t const *t_rules, CONF_ITEM *ci, UNUSED char const *section_name1, UNUSED char const *section_name2, void const *data, UNUSED call_env_parser_t const *rule);
 
@@ -2380,7 +2380,7 @@ static int mod_bootstrap(module_inst_ctx_t const *mctx)
 
 static int ldap_update_section_parse(TALLOC_CTX *ctx, call_env_parsed_head_t *out, tmpl_rules_t const *t_rules,
                                     CONF_ITEM *ci, UNUSED char const *section_name1, UNUSED char const *section_name2,
-                                    call_env_parser_t const *rule)
+                                    UNUSED void const *data, call_env_parser_t const *rule)
 {
        map_list_t                      *maps;
        CONF_SECTION                    *update = cf_item_to_section(ci);