]> git.ipfire.org Git - thirdparty/freeradius-server.git/commitdiff
Use module name in custom call_env_parse functions
authorNick Porter <nick@portercomputing.co.uk>
Mon, 7 Jul 2025 15:12:53 +0000 (16:12 +0100)
committerNick Porter <nick@portercomputing.co.uk>
Mon, 7 Jul 2025 15:37:16 +0000 (16:37 +0100)
So call_env_parse() can be made public

src/modules/rlm_files/rlm_files.c
src/modules/rlm_sql/rlm_sql.c
src/modules/rlm_sqlippool/rlm_sqlippool.c

index f950811d549dc7a8dc26020acdbbe3aa1b906430..f8ffb90dc1c68e8f745b89355254c8b95e9dfbf2 100644 (file)
@@ -646,8 +646,8 @@ static unlang_action_t CC_HINT(nonnull) mod_files(UNUSED unlang_result_t *p_resu
 /** Custom call_env parser for loading files data
  *
  */
-static int call_env_parse(TALLOC_CTX *ctx, void *out, tmpl_rules_t const *t_rules, CONF_ITEM *ci,
-                         call_env_ctx_t const *cec, UNUSED call_env_parser_t const *rule)
+static int files_call_env_parse(TALLOC_CTX *ctx, void *out, tmpl_rules_t const *t_rules, CONF_ITEM *ci,
+                               call_env_ctx_t const *cec, UNUSED call_env_parser_t const *rule)
 {
        rlm_files_t const               *inst = talloc_get_type_abort_const(cec->mi->data, rlm_files_t);
        CONF_PAIR const                 *to_parse = cf_item_to_pair(ci);
@@ -686,7 +686,7 @@ static const call_env_method_t method_env = {
        .env = (call_env_parser_t[]){
                { FR_CALL_ENV_PARSE_ONLY_OFFSET("key", FR_TYPE_VOID, CALL_ENV_FLAG_PARSE_ONLY, rlm_files_env_t, data),
                                     .pair.dflt = "%{Stripped-User-Name || User-Name}", .pair.dflt_quote = T_DOUBLE_QUOTED_STRING,
-                                    .pair.func = call_env_parse },
+                                    .pair.func = files_call_env_parse },
                { FR_CALL_ENV_PARSE_ONLY_OFFSET("match_attr", FR_TYPE_VOID, CALL_ENV_FLAG_ATTRIBUTE, rlm_files_env_t, match_attr) },
                CALL_ENV_TERMINATOR
        },
index a26e89f3cf68946120a872fb85b5578291ee9f9c..2f22a01fc589fd3b504db08102c5dc250c7a7868 100644 (file)
@@ -2414,8 +2414,8 @@ static int mod_thread_detach(module_thread_inst_ctx_t const *mctx)
  *
  * Needed as the escape function needs to reference the correct SQL driver
  */
-static int call_env_parse(TALLOC_CTX *ctx, void *out, tmpl_rules_t const *t_rules, CONF_ITEM *ci,
-                         call_env_ctx_t const *cec, UNUSED call_env_parser_t const *rule)
+static int sql_call_env_parse(TALLOC_CTX *ctx, void *out, tmpl_rules_t const *t_rules, CONF_ITEM *ci,
+                             call_env_ctx_t const *cec, UNUSED call_env_parser_t const *rule)
 {
        rlm_sql_t const         *inst = talloc_get_type_abort_const(cec->mi->data, rlm_sql_t);
        tmpl_t                  *parsed_tmpl;
@@ -2445,7 +2445,7 @@ static int call_env_parse(TALLOC_CTX *ctx, void *out, tmpl_rules_t const *t_rule
 #define QUERY_ESCAPE .pair.escape = { \
        .mode = TMPL_ESCAPE_PRE_CONCAT, \
        .uctx = { .func = { .alloc = sql_escape_uctx_alloc }, .type = TMPL_ESCAPE_UCTX_ALLOC_FUNC }, \
-}, .pair.func = call_env_parse
+}, .pair.func = sql_call_env_parse
 
 static const call_env_method_t authorize_method_env = {
        FR_CALL_ENV_METHOD_OUT(sql_autz_call_env_t),
index c84f8ed4aeefdd4fa57f95d56a284ad2acebe72a..7fb966304e840837943cbe0f784c8df5a3fd46a2 100644 (file)
@@ -682,8 +682,8 @@ static int sqlippool_box_escape(fr_value_box_t *vb, void *uctx)
  * the correct instance of the SQL module since escaping functions
  * are dependent on the driver used by a given module instance.
  */
-static int call_env_parse(TALLOC_CTX *ctx, void *out, tmpl_rules_t const *t_rules, CONF_ITEM *ci,
-                         call_env_ctx_t const *cec, UNUSED call_env_parser_t const *rule)
+static int sqlippool_call_env_parse(TALLOC_CTX *ctx, void *out, tmpl_rules_t const *t_rules, CONF_ITEM *ci,
+                                   call_env_ctx_t const *cec, UNUSED call_env_parser_t const *rule)
 {
        rlm_sqlippool_t const   *inst = talloc_get_type_abort_const(cec->mi->data, rlm_sqlippool_t);
        module_instance_t const *sql_inst;
@@ -723,7 +723,7 @@ static int call_env_parse(TALLOC_CTX *ctx, void *out, tmpl_rules_t const *t_rule
        }, \
        .mode = TMPL_ESCAPE_PRE_CONCAT, \
        .uctx = { .func = { .alloc = sql_escape_uctx_alloc }, .type = TMPL_ESCAPE_UCTX_ALLOC_FUNC }, \
-}, .pair.func = call_env_parse
+}, .pair.func = sqlippool_call_env_parse
 
 static const call_env_method_t sqlippool_alloc_method_env = {
        FR_CALL_ENV_METHOD_OUT(ippool_alloc_call_env_t),