From: Alan T. DeKok Date: Sun, 14 Nov 2021 13:58:40 +0000 (-0500) Subject: better error messages for inline attribute editing X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=f9ddd9e98a5f9e302aa1856d12f699671a1d4cba;p=thirdparty%2Ffreeradius-server.git better error messages for inline attribute editing --- diff --git a/src/lib/unlang/compile.c b/src/lib/unlang/compile.c index 7daa0c1d54..1a72811b66 100644 --- a/src/lib/unlang/compile.c +++ b/src/lib/unlang/compile.c @@ -1835,6 +1835,16 @@ static unlang_t *compile_children(unlang_group_t *g, unlang_compile_t *unlang_ct * It's not a subgroup. */ name = cf_section_name1(subcs); + + /* + * In-line attribute editing is not supported. + */ + if (*name == '&') { + cf_log_err(subcs, "Please use 'update' sections to add / modify / delete attributes"); + talloc_free(c); + return NULL; + } + if (strcmp(name, "actions") == 0) { if (!compile_action_subsection(c, g->cs, subcs)) { talloc_free(c); @@ -1890,6 +1900,15 @@ static unlang_t *compile_children(unlang_group_t *g, unlang_compile_t *unlang_ct attr = cf_pair_attr(cp); + /* + * In-line attribute editing is not supported. + */ + if (*attr == '&') { + cf_log_err(cp, "Please use 'update' sections to add / modify / delete attributes"); + talloc_free(c); + return NULL; + } + /* * Bare "foo = bar" is disallowed. */