]> git.ipfire.org Git - thirdparty/freeradius-server.git/commitdiff
give parse error for behavior differences
authorAlan T. DeKok <aland@freeradius.org>
Fri, 18 Nov 2022 13:29:31 +0000 (08:29 -0500)
committerAlan T. DeKok <aland@freeradius.org>
Mon, 21 Nov 2022 15:51:06 +0000 (10:51 -0500)
and give helpful suggestion for how to fix it

src/lib/unlang/compile.c

index 43f25b10c70b842d8305495aebcecb6b9c82d8f5..d2ca9b85c3cd36bb1f2e835cb3ccc9ce348a4811 100644 (file)
@@ -1460,6 +1460,20 @@ static unlang_t *compile_update_to_edit(unlang_t *parent, unlang_compile_t *unla
                        }
                }
 
+               /*
+                *      Catch one more case where the behavior is different.
+                *
+                *      &request += &config[*]
+                */
+               if (!attr && (cf_pair_value_quote(cp) == T_BARE_WORD) && (*value == '&') &&
+                   (strchr(value, '.') == NULL) && (strchr(value, '[') != NULL)) {
+                       char const *p = strchr(value, '[');
+
+                       cf_log_err(cp, "Cannot do array assignments for lists.  Just use '%s %s %.*s'",
+                                  list, fr_tokens[op], (int) (p - value), value);
+                       return NULL;
+               }
+
                switch (op) {
                        /*
                         *      FOO !* ANY