]> git.ipfire.org Git - thirdparty/freeradius-server.git/commitdiff
Also pass section_name1 and section_name2 to custom call env section parser
authorNick Porter <nick@portercomputing.co.uk>
Tue, 16 Apr 2024 09:35:35 +0000 (10:35 +0100)
committerNick Porter <nick@portercomputing.co.uk>
Wed, 17 Apr 2024 08:54:55 +0000 (09:54 +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 132656d8297f1a1adda7ac4b62426182198f6879..42e8f7da68e6a3cfb79d2537074349cc7b80e31c 100644 (file)
@@ -421,7 +421,8 @@ 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), rule) < 0) {
+                               if (rule->section.func(ctx, parsed, t_rules, cf_section_to_item(subcs), section_name1,
+                                                      section_name2, rule) < 0) {
                                        cf_log_perr(cs, "Failed parsing configuration section %s", rule->name);
                                        talloc_free(call_env_parsed);
                                        return -1;
index e39f62fb7ff7024307950539ed07db5cc02b4e5c..e90ccb10e6b6ddb1583d1f4916e00f0966cafa55 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, 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, call_env_parser_t const *rule);
 
 /** Per method call config
  *
index edbbaec0d12adbee0e5c219be578777f5e640081..d4b67f7887569b2ba1b6508565b7332666eb2d68 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 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 const conf_parser_t module_config[] = {
        { FR_CONF_OFFSET_TYPE_FLAGS("driver", FR_TYPE_VOID, 0, rlm_cache_t, driver_submodule), .dflt = "rbtree",
@@ -1402,7 +1402,9 @@ static int cache_verify(map_t *map, void *uctx)
        return 0;
 }
 
-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 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)
 {
        CONF_SECTION            *update = cf_item_to_section(ci);
        call_env_parsed_t       *parsed;
index 555b50dd1d958e79ebb13ec27a5b43698ad76141..08baccbd2d4c62f5fb9a84b2b27e22f88f774666 100644 (file)
@@ -427,7 +427,8 @@ 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 call_env_parser_t const *rule)
+                                  CONF_ITEM *ci, UNUSED char const *section_name1, UNUSED char const *section_name2,
+                                  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 5d048e90dd346c11426670324ce99fa376af3e1d..8485f79909be0585fbf6d83c397f95004e66c69e 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 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, UNUSED char const *section_name1, UNUSED char const *section_name2, UNUSED 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);
 
@@ -2378,7 +2378,9 @@ static int mod_bootstrap(module_inst_ctx_t const *mctx)
        return 0;
 }
 
-static int ldap_update_section_parse(TALLOC_CTX *ctx, call_env_parsed_head_t *out, tmpl_rules_t const *t_rules, CONF_ITEM *ci, 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, UNUSED char const *section_name1, UNUSED char const *section_name2,
+                                    call_env_parser_t const *rule)
 {
        map_list_t                      *maps;
        CONF_SECTION                    *update = cf_item_to_section(ci);