rbtree_t *name2_tree; /* for sections of the same name2 */
rbtree_t *data_tree;
void *base;
+ int depth;
const CONF_PARSER *variables;
};
* Don't create the section tree here, it may not
* be needed.
*/
+
+ if (parent) cs->depth = parent->depth + 1;
+
return cs;
}
return rcode;
}
+static const char *parse_spaces = " ";
+
/*
* Parse a configuration section into user-supplied variables.
*/
void *data;
if (!cs->name2) {
- DEBUG2(" %s {", cs->name1);
+ DEBUG2("%.*s%s {", cs->depth, parse_spaces,
+ cs->name1);
} else {
- DEBUG2(" %s %s {", cs->name1, cs->name2);
+ DEBUG2("%.*s%s %s {", cs->depth, parse_spaces,
+ cs->name1, cs->name2);
}
/*
if (!variables[i].dflt) {
DEBUG2("Internal sanity check 1 failed in cf_section_parse");
- cf_section_parse_free(base, variables);
- DEBUG2(" }");
- return -1;
+ goto error;
}
if (cf_section_parse(subcs, base,
(const CONF_PARSER *) variables[i].dflt) < 0) {
- cf_section_parse_free(base, variables);
- DEBUG2(" }");
- return -1;
+ goto error;
}
continue;
} /* else it's a CONF_PAIR */
data = ((char *)base) + variables[i].offset;
} else {
DEBUG2("Internal sanity check 2 failed in cf_section_parse");
- cf_section_parse_free(base, variables);
- DEBUG2(" }");
- return -1;
+ goto error;
}
/*
*/
if (cf_item_parse(cs, variables[i].name, variables[i].type,
data, variables[i].dflt) < 0) {
- cf_section_parse_free(base, variables);
- DEBUG2(" }");
- return -1;
+ goto error;
}
} /* for all variables in the configuration section */
- DEBUG2(" }");
+ DEBUG2("%.*s}", cs->depth, parse_spaces);
cs->base = base;
cs->variables = variables;
return 0;
+
+ error:
+ DEBUG2("%.*s}", cs->depth, parse_spaces);
+ cf_section_parse_free(base, variables);
+ return -1;
}
node->module = module;
node->handle = handle;
- DEBUG("Module: Linked to module %s", module_name);
+ DEBUG(" Module: Linked to module %s", module_name);
/*
* Add the module as "rlm_foo-version" to the configuration
return NULL;
}
- DEBUG2("Module: Instantiating %s", instname);
+ DEBUG2(" Module: Instantiating %s", instname);
/*
* Call the module's instantiation routine.
*/
lt_dlsetsearchpath(radlib_dir);
- DEBUG2("Module: Library search path is %s",
- lt_dlgetsearchpath());
+ DEBUG2("radiusd: Library search path is %s",
+ lt_dlgetsearchpath());
/*
* Set up the internal module struct.
module_instance_t *module;
const char *name;
+ DEBUG2(" instantiate {");
+
/*
* Loop over the items in the 'instantiate' section.
*/
return -1;
}
} /* loop over items in the subsection */
+
+ DEBUG2(" }");
} /* if there's an 'instantiate' section. */
+ DEBUG2(" modules {");
+
/*
* Loop over all of the known components, finding their
* configuration section, and loading it.
continue;
}
+ if (cf_item_find_next(cs, NULL) == NULL) {
+ continue; /* section is empty */
+ }
+
+ DEBUG2(" Module: Instantiating section %s", section_type_value[comp].section);
+
if (load_component_section(NULL, cs, comp, mainconfig.radiusd_conf) < 0) {
return -1;
}
}
+ DEBUG2(" }");
+
return 0;
}
free(node);
return -1;
}
- DEBUG("eap: Linked to sub-module %s", buffer);
+ DEBUG(" eap: Linked to sub-module %s", buffer);
- DEBUG("eap: Instantiating eap-%s", eaptype_name);
+ DEBUG(" eap: Instantiating eap-%s", eaptype_name);
if ((node->type->attach) &&
((node->type->attach)(node->cs, &(node->type_data)) < 0)) {