]> git.ipfire.org Git - thirdparty/freeradius-server.git/commitdiff
add and compile "actions" in module configurations
authorAlan T. DeKok <aland@freeradius.org>
Mon, 30 Aug 2021 17:39:36 +0000 (13:39 -0400)
committerAlan T. DeKok <aland@freeradius.org>
Mon, 30 Aug 2021 17:39:36 +0000 (13:39 -0400)
src/lib/server/module.c
src/lib/server/module.h

index a7e5ee05a080298ff6946f3e925565f92cb5b278..c26544a7348c67ecf715ef4bbb7c6032f49beeef 100644 (file)
@@ -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;
 }
 
index 79a0a51f59a4f0fe76e89de02a3a01c8bf54e5c7..16289f67fc607e3f9e182b44a9a2e4f45fb6944b 100644 (file)
@@ -32,6 +32,7 @@ extern "C" {
 #include <freeradius-devel/server/cf_util.h>
 #include <freeradius-devel/server/request.h>
 #include <freeradius-devel/unlang/action.h>
+#include <freeradius-devel/unlang/compile.h>
 #include <freeradius-devel/util/event.h>
 
 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