summaryrefslogtreecommitdiff
path: root/conf/cf-lex.l
diff options
context:
space:
mode:
authorMikael Magnusson <mikma@users.sourceforge.net>2023-11-25 17:49:15 +0100
committerMikael Magnusson <mikma@users.sourceforge.net>2023-11-25 17:49:15 +0100
commit2bb5b0cc7d20501d0d0afcf8998bf9b0dccb13bc (patch)
tree84bf6e96d50a74944f0b85d1565bed542f606536 /conf/cf-lex.l
parent772b80cc1392a52c9275c2290cc8b0c08cd9fdfa (diff)
parent6b95353ebdaa724252492f941ebe75f80e9e545a (diff)
Merge commit '6b95353ebdaa724252492f941ebe75f80e9e545a' into wireguard-next-tmp7-1
Diffstat (limited to 'conf/cf-lex.l')
-rw-r--r--conf/cf-lex.l5
1 files changed, 5 insertions, 0 deletions
diff --git a/conf/cf-lex.l b/conf/cf-lex.l
index 1054f33f..4ff28579 100644
--- a/conf/cf-lex.l
+++ b/conf/cf-lex.l
@@ -616,6 +616,9 @@ static inline void cf_swap_soft_scope(struct config *conf);
static struct symbol *
cf_new_symbol(struct sym_scope *scope, pool *p, struct linpool *lp, const byte *c)
{
+ if (scope->readonly)
+ cf_error("Unknown symbol %s", c);
+
struct symbol *s;
uint l = strlen(c);
@@ -769,6 +772,8 @@ cf_lex_init(int is_cli, struct config *c)
sym->class = SYM_KEYWORD;
sym->keyword = k;
}
+
+ global_root_scope->readonly = 1;
}
ifs_head = ifs = push_ifs(NULL);