module_instance_t *find_module_instance(CONF_SECTION *modules,
const char *instname, int do_link)
{
+ int check_config_safe = FALSE;
CONF_SECTION *cs;
const char *name1, *name2;
module_instance_t *node, myNode;
if (check_config && (node->entry->module->instantiate) &&
(node->entry->module->type & RLM_TYPE_CHECK_CONFIG_SAFE) == 0) {
+ const char *value = NULL;
+ CONF_PAIR *cp;
+
+ cp = cf_pair_find(cs, "force_check_config");
+ if (cp) value = cf_pair_value(cp);
+
+ if (value && (strcmp(value, "yes") == 0)) goto print_inst;
+
cf_log_module(cs, "Skipping instantiation of %s", instname);
} else {
+ print_inst:
+ check_config_safe = TRUE;
cf_log_module(cs, "Instantiating %s", instname);
}
* Call the module's instantiation routine.
*/
if ((node->entry->module->instantiate) &&
- (!check_config ||
- ((node->entry->module->type & RLM_TYPE_CHECK_CONFIG_SAFE) != 0)) &&
+ (!check_config || check_config_safe) &&
((node->entry->module->instantiate)(cs, &node->insthandle) < 0)) {
cf_log_err(cf_sectiontoitem(cs),
"Instantiation failed for module \"%s\"",