From: Alan T. DeKok Date: Fri, 18 Nov 2022 13:29:31 +0000 (-0500) Subject: give parse error for behavior differences X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=b1812e609189e53d5f7f1515313216126a60dc88;p=thirdparty%2Ffreeradius-server.git give parse error for behavior differences and give helpful suggestion for how to fix it --- diff --git a/src/lib/unlang/compile.c b/src/lib/unlang/compile.c index 43f25b10c70..d2ca9b85c3c 100644 --- a/src/lib/unlang/compile.c +++ b/src/lib/unlang/compile.c @@ -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