]> git.ipfire.org Git - thirdparty/freeradius-server.git/commitdiff
better error messages for inline attribute editing
authorAlan T. DeKok <aland@freeradius.org>
Sun, 14 Nov 2021 13:58:40 +0000 (08:58 -0500)
committerAlan T. DeKok <aland@freeradius.org>
Sun, 14 Nov 2021 14:08:09 +0000 (09:08 -0500)
src/lib/unlang/compile.c

index 7daa0c1d5430c84e11078d90d5528f045b348170..1a72811b665ce204d51516678e76eab52b16294d 100644 (file)
@@ -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.
                         */