]> git.ipfire.org Git - thirdparty/freeradius-server.git/commitdiff
better errors
authorAlan T. DeKok <aland@freeradius.org>
Fri, 5 Aug 2022 13:04:38 +0000 (09:04 -0400)
committerAlan T. DeKok <aland@freeradius.org>
Fri, 5 Aug 2022 14:19:20 +0000 (10:19 -0400)
foo.bar = baz

results in the config file parser creating

foo {
bar = baz
}

We should likely forbid that in the parser.  But for now, a better
error here is useful

src/lib/server/map.c

index ec5156c5bd98f4218bb1cc1ba2d2e200e050b10f..bfc116dd5c6cf6dffb46a4be6accbcde3f65e3e1 100644 (file)
@@ -798,6 +798,11 @@ do_children:
                        subcs = cf_item_to_section(ci);
                        token = cf_section_name2_quote(subcs);
 
+                       if (token == T_INVALID) {
+                               cf_log_err(ci, "Section '%s { ... }' is missing the '=' operator", cf_section_name1(subcs));
+                               goto error;
+                       }
+
                        if (!fr_assignment_op[token]) {
                                cf_log_err(ci, "Invalid operator '%s'", fr_tokens[token]);
                                goto error;