for (modref = cf_item_find_next(cs, NULL);
modref != NULL;
modref = cf_item_find_next(cs, modref)) {
+ CONF_PAIR *cp = NULL;
+ CONF_SECTION *scs = NULL;
+
/*
* Look for Auth-Type foo {}, which are special
* cases of named sections, and allowable ONLY
*/
if (cf_item_is_section(modref)) {
const char *sec_name;
- CONF_SECTION *scs;
scs = cf_itemtosection(modref);
sec_name = cf_section_name1(scs);
}
continue;
}
+ cp = NULL;
} else {
- CONF_PAIR *cp;
cp = cf_itemtopair(modref);
}
if (comp == RLM_COMPONENT_AUTH) {
DICT_VALUE *dval;
+ const char *modrefname = NULL;
+
+ if (cp) {
+ modrefname = cf_pair_attr(cp);
+ } else {
+ modrefname = cf_section_name2(scs);
+ if (!modrefname) {
+ radlog(L_ERR|L_CONS,
+ "%s[%d] Failed to parse %s sub-section.\n",
+ filename, cf_section_lineno(scs),
+ cf_section_name1(scs));
+ return -1;
+ }
+ }
- dval = dict_valbyname(PW_AUTH_TYPE, modname);
+ dval = dict_valbyname(PW_AUTH_TYPE, modrefname);
if (!dval) {
/*
* It's a section, but nothing we
* recognize. Die!
*/
- radlog(L_ERR|L_CONS, "%s[%d] Unknown Auth-Type \"%s\" in %s section.",
- filename, cf_section_lineno(cs),
- modname, section_type_value[comp].section);
+ radlog(L_ERR|L_CONS, "%s[%d] Unknown Auth-Type \"%s\" in %s sub-section.",
+ filename, cf_section_lineno(scs),
+ modrefname, section_type_value[comp].section);
return -1;
}
idx = dval->value;
/*
* Initialize the components.
*/
- for (comp = 0; comp < RLM_COMPONENT_COUNT; comp++) {
- components[comp] = NULL;
- }
+ memset(components, 0, sizeof(components));
/*
* Set up the internal module struct.