]> git.ipfire.org Git - thirdparty/freeradius-server.git/commitdiff
failure to load a process module is an error
authorAlan T. DeKok <aland@freeradius.org>
Sun, 21 Mar 2021 13:58:49 +0000 (09:58 -0400)
committerArran Cudbard-Bell <a.cudbardb@freeradius.org>
Wed, 31 Mar 2021 15:07:34 +0000 (16:07 +0100)
so we'll need one for the "control" virtual server.

Also don't push the config rules manually, dl_module_instance()
has already done that for us.

src/lib/server/virtual_servers.c

index 4593b6ad20f13d9c650509ee85fec03b61198f90..3f11d832c2dcc60c68b01859431a4e5d87a50cf9 100644 (file)
@@ -406,24 +406,23 @@ static int namespace_parse(TALLOC_CTX *ctx, void *out, UNUSED void *parent, CONF
 
        if (DEBUG_ENABLED4) cf_log_debug(ci, "Loading process %s into %p", namespace, out);
 
+       /*
+        *      Enforce that the protocol process configuration is in
+        *      a subsection named for the protocol.
+        */
        process_cs = cf_section_find(server_cs, namespace, NULL);
        if (!process_cs) {
                process_cs = cf_section_alloc(server_cs, server_cs, namespace, NULL);
        }
 
-       if (dl_module_instance(ctx, &server->process_module, process_cs, NULL, namespace, DL_MODULE_TYPE_PROCESS) < 0) {
-               cf_log_warn(server_cs, "Failed loading process module");
-               return 0;
-       }
-
        /*
-        *      Push rules to parse the protocol-specific configuration section.
+        *      We now require a process module for everything.
+        *
+        *      @todo - add one for the "control" virtual server!
         */
-       if (server->process_module->module->common->config) {
-               if (cf_section_rule_push(process_cs, server->process_module->module->common->config) < 0) {
-                       cf_log_err(process_cs, "Failed saving configuration for process_%s", namespace);
-                       return -1;
-               };
+       if (dl_module_instance(ctx, &server->process_module, process_cs, NULL, namespace, DL_MODULE_TYPE_PROCESS) < 0) {
+               cf_log_warn(server_cs, "Failed loading process module");
+               return -1;
        }
 
        return 0;