if (strcmp(css->name1, "server") == 0) css->allow_unlang = 2;
if (strcmp(css->name1, "policy") == 0) css->allow_unlang = 2;
- } else if ((parent->allow_unlang == 2) && (strcmp(css->name1, "listen") == 0)) { /* hacks for listeners */
- css->allow_unlang = css->allow_locals = false;
-
+ } else if (parent->allow_unlang == 2) {
+ //
+ // git grep SECTION_NAME src/process/ src/lib/server/process.h | sed 's/.*SECTION_NAME("//;s/",.*//' | sort -u
+ //
+ if ((strcmp(css->name1, "accounting") == 0) ||
+ (strcmp(css->name1, "add") == 0) ||
+ (strcmp(css->name1, "authenticate") == 0) ||
+ (strcmp(css->name1, "clear") == 0) ||
+ (strcmp(css->name1, "deny") == 0) ||
+ (strcmp(css->name1, "error") == 0) ||
+ (strcmp(css->name1, "load") == 0) ||
+ (strcmp(css->name1, "new") == 0) ||
+ (strcmp(css->name1, "recv") == 0) ||
+ (strcmp(css->name1, "send") == 0) ||
+ (strcmp(css->name1, "store") == 0) ||
+ (strcmp(css->name1, "verify") == 0)) {
+ css->allow_unlang = css->allow_locals = true;
+
+ } else if (strcmp(css->name1, "listen") == 0) {
+ css->allow_unlang = css->allow_locals = false;
+
+ } else {
+ goto check_unlang;
+ }
+
} else {
+ check_unlang:
/*
* Allow unlang if the parent allows it, but don't allow
* unlang in list assignment sections.
if (!compile_list) return 0;
for (i = 0; list[i].section; i++) {
- if (list[i].section->name1 == CF_IDENT_ANY) continue;
+#ifndef NDEBUG
+ /*
+ * We can't have a wildcard for name1. It MUST be a real name.
+ *
+ * The wildcard was allowed previously for ideas which later didn't turn out.
+ */
+ if (list[i].section->name1 == CF_IDENT_ANY) {
+ fr_assert(0);
+ continue;
+ }
+#endif
if (virtual_server_section_register(vs, &list[i]) < 0) {
cf_log_err(cs, "Failed registering processing section name %s for %s",
list[i].section->name1, name);