/*
* See which unlang keywords are allowed
- *
- * Note that the "modules" section now allows virtual
- * modules. See module_rlm.c.
- *
- * - group
- * - redundant
- * - redundant-load-balance
- * - load-balance
*/
if (parent->unlang != CF_UNLANG_ALLOW) {
if ((strcmp(buff[1], "if") == 0) ||
if (strcmp(css->name1, "server") == 0) css->unlang = CF_UNLANG_SERVER;
if (strcmp(css->name1, "policy") == 0) css->unlang = CF_UNLANG_POLICY;
+ if (strcmp(css->name1, "modules") == 0) css->unlang = CF_UNLANG_MODULES;
} else if (parent->unlang == CF_UNLANG_POLICY) {
/*
css->allow_locals = false;
}
+ } else if (parent->unlang == CF_UNLANG_MODULES) {
+ /*
+ * Virtual modules in the "modules" section can have unlang.
+ */
+ if ((strcmp(css->name1, "group") == 0) ||
+ (strcmp(css->name1, "load-balance") == 0) ||
+ (strcmp(css->name1, "redundant") == 0) ||
+ (strcmp(css->name1, "redundant-load-balance") == 0)) {
+ css->unlang = CF_UNLANG_ALLOW;
+ css->allow_locals = true;
+
+ } else {
+ css->unlang = CF_UNLANG_NONE;
+ css->allow_locals = false;
+ }
+
} else if (parent->unlang == CF_UNLANG_EDIT) {
/*
* Edit sections canb only have children
CF_UNLANG_ALLOW, //!< allow unlang in this section
CF_UNLANG_SERVER, //!< this section is a virtual server, allow unlang 2 down
CF_UNLANG_POLICY, //!< this section is a policy, allow unlang 2 down
+ CF_UNLANG_MODULES, //!< this section is in "modules", allow unlang 2 down
CF_UNLANG_EDIT, //!< only edit assignments
} cf_unlang_t;