so we add the namespace to the module configuration, and then
check for it when we compile the reference to the module.
We also add a reference to the online documentation, so the user
knows what to do in order to fix the issue
DL_MODULE_COMMON; //!< Common fields for all loadable modules.
conf_parser_t const *config; //!< How to convert a CONF_SECTION to a module instance.
+ fr_dict_t const **dict; //!< _required_ dictionary for this module.
size_t boot_size; //!< Size of the module's bootstrap data.
char const *boot_type; //!< talloc type to assign to bootstrap data.
return NULL;
}
+ if (m->mmc.rlm->common.dict &&
+ !fr_dict_compatible(*m->mmc.rlm->common.dict, unlang_ctx->rules->attr.dict_def)) {
+ cf_log_err(ci, "The '%s' module can only be used within a '%s' namespace.",
+ m->mmc.rlm->common.name, fr_dict_root(*m->mmc.rlm->common.dict)->name);
+ cf_log_err(ci, "Please use the 'subrequest' keyword to change namespaces");
+ cf_log_err(ci, DOC_KEYWORD_REF(subrequest));
+ talloc_free(m);
+ return NULL;
+ }
+
c = unlang_module_to_generic(m);
c->parent = parent;
c->next = NULL;
.name = "radius",
.inst_size = sizeof(rlm_radius_t),
.config = module_config,
+ .dict = &dict_radius,
.onload = mod_load,
.unload = mod_unload,
.name = "tacacs",
.inst_size = sizeof(rlm_tacacs_t),
.config = module_config,
+ .dict = &dict_tacacs,
.onload = mod_load,
.unload = mod_unload,