]> git.ipfire.org Git - thirdparty/freeradius-server.git/commitdiff
auto-merge edits only if explicitely put into a group
authorAlan T. DeKok <aland@freeradius.org>
Fri, 5 Aug 2022 13:29:40 +0000 (09:29 -0400)
committerAlan T. DeKok <aland@freeradius.org>
Fri, 5 Aug 2022 14:19:21 +0000 (10:19 -0400)
src/lib/unlang/compile.c

index 45ee7a63f8b45c2af3e125b57d59bb3de8072a72..d9b0662322d79d85a86fce39fa85fcc6ec639fb3 100644 (file)
@@ -1750,7 +1750,7 @@ static unlang_t *compile_edit_section(unlang_t *parent, unlang_compile_t *unlang
 static unlang_t *compile_edit_pair(unlang_t *parent, unlang_compile_t *unlang_ctx, unlang_t **prev, CONF_PAIR *cp)
 {
        unlang_edit_t           *edit, *edit_free;
-       unlang_t                *c, *out = UNLANG_IGNORE;
+       unlang_t                *c = NULL, *out = UNLANG_IGNORE;
        map_t                   *map;
 
        tmpl_rules_t            t_rules;
@@ -1763,7 +1763,10 @@ static unlang_t *compile_edit_pair(unlang_t *parent, unlang_compile_t *unlang_ct
        t_rules.attr.list_as_attr = true;
        RULES_VERIFY(&t_rules);
 
-       c = *prev;
+       /*
+        *      Auto-merge pairs only if they're all in a group.
+        */
+       if (unlang_ctx->all_edits) c = *prev;
        edit = edit_free = NULL;
 
        if (c && (c->type == UNLANG_TYPE_EDIT)) {