From: Alan T. DeKok Date: Mon, 30 Aug 2021 17:39:36 +0000 (-0400) Subject: add and compile "actions" in module configurations X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=71e936bec89ff2638d1c0486ed0758422aa94a7f;p=thirdparty%2Ffreeradius-server.git add and compile "actions" in module configurations --- diff --git a/src/lib/server/module.c b/src/lib/server/module.c index a7e5ee05a08..c26544a7348 100644 --- a/src/lib/server/module.c +++ b/src/lib/server/module.c @@ -1483,6 +1483,7 @@ module_instance_t *module_bootstrap(module_instance_t const *parent, CONF_SECTIO char *inst_name = NULL; module_instance_t *mi; char const *name1 = cf_section_name1(cs); + CONF_SECTION *actions; module_instance_name(NULL, &inst_name, parent, cs); @@ -1561,6 +1562,15 @@ module_instance_t *module_bootstrap(module_instance_t const *parent, CONF_SECTIO } } + /* + * Compile the default "actions" subsection, which includes retries. + */ + actions = cf_section_find(cs, "actions", NULL); + if (actions && !unlang_compile_actions(&mi->actions, actions)) { + talloc_free(mi); + return NULL; + } + return mi; } diff --git a/src/lib/server/module.h b/src/lib/server/module.h index 79a0a51f59a..16289f67fc6 100644 --- a/src/lib/server/module.h +++ b/src/lib/server/module.h @@ -32,6 +32,7 @@ extern "C" { #include #include #include +#include #include typedef struct module_s module_t; @@ -217,6 +218,9 @@ struct module_instance_s { rlm_rcode_t code; //!< Code module will return when 'force' has //!< has been set to true. + + unlang_actions_t actions; //!< default actions and retries. + /** @} */ /** @name Tree insertion tracking