/*
* We must assign a numeric index to this subcomponent.
- * It is generated and placed in the dictionary by
- * setup_modules(), when it loads the sections. If it
- * isn't found, it's a serious error.
+ * It is generated and placed in the dictionary
+ * automatically. If it isn't found, it's a serious
+ * error.
*/
dval = dict_valbyname(section_type_value[comp].attr, name2);
if (!dval) {
return 1;
}
-static int load_component_section(modcallable *parent, CONF_SECTION *cs,
+static int load_component_section(CONF_SECTION *cs,
const char *server, int comp)
{
modcallable *this;
return -1;
}
- if (!load_subcomponent_section(parent, scs,
+ if (!load_subcomponent_section(NULL, scs,
server, comp)) {
return -1; /* FIXME: memleak? */
}
/*
* Try to compile one entry.
*/
- this = compile_modsingle(parent, comp, modref, &modname);
+ this = compile_modsingle(NULL, comp, modref, &modname);
if (!this) {
cf_log_err(cf_sectiontoitem(cs),
"Failed to parse %s section.\n",
return 0;
}
-static int load_byserver(CONF_SECTION *cs, const char *server,
- int *do_component)
+static int load_byserver(CONF_SECTION *cs, int *do_component)
{
int comp;
+ const char *server = cf_section_name2(cs);
DEBUG2(" modules {");
DEBUG2(" Module: Checking %s {...} for more modules to load",
section_type_value[comp].section);
- if (load_component_section(NULL, subcs, server, comp) < 0) {
+ if (load_component_section(subcs, server, comp) < 0) {
DEBUG2(" }");
return -1;
}
}
DEBUG2(" Module: Checking vmps {...} for more modules to load");
- if (load_component_section(NULL, cs, VMPS_SPACE,
+ if (load_component_section(cs, VMPS_SPACE,
RLM_COMPONENT_POST_AUTH) < 0) {
return -1;
}
DEBUG2("server {");
null_server = TRUE;
}
- if (load_byserver(cs, name2, do_component) < 0) {
+ if (load_byserver(cs, do_component) < 0) {
DEBUG2("}");
return -1;
}
if (!null_server) {
DEBUG2("WARNING: Please update your configuration to use virtual servers!");
DEBUG2("server {");
- if (load_byserver(config, NULL, do_component) < 0) {
+ if (load_byserver(config, do_component) < 0) {
DEBUG2("}");
return -1;
}