From: Alan T. DeKok Date: Sun, 21 Mar 2021 13:58:49 +0000 (-0400) Subject: failure to load a process module is an error X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=818fd2e2323b8043f92c7a83e51db97405302b1c;p=thirdparty%2Ffreeradius-server.git failure to load a process module is an error 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. --- diff --git a/src/lib/server/virtual_servers.c b/src/lib/server/virtual_servers.c index 4593b6ad20f..3f11d832c2d 100644 --- a/src/lib/server/virtual_servers.c +++ b/src/lib/server/virtual_servers.c @@ -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;