]> git.ipfire.org Git - thirdparty/freeradius-server.git/commitdiff
be a bit smarter about it
authorAlan T. DeKok <aland@freeradius.org>
Sun, 17 Sep 2023 14:29:13 +0000 (10:29 -0400)
committerAlan T. DeKok <aland@freeradius.org>
Sun, 17 Sep 2023 14:29:13 +0000 (10:29 -0400)
src/lib/unlang/compile.c

index 92300b11d7eab0b9b5858621e5e5e9d15eae09ca..377a5d87d02023b3b0338f752bc458a46d2c5c7c 100644 (file)
@@ -1566,10 +1566,18 @@ static unlang_t *compile_edit_section(unlang_t *parent, unlang_compile_t *unlang
                                /*
                                 *      The edit code doesn't do this correctly, so we just forbid it.
                                 */
-                               if (strchr(child->lhs->name, '.') != NULL) {
+                               if ((tmpl_attr_num_elements(child->lhs) - tmpl_attr_num_elements(map->lhs)) > 1) {
                                        cf_log_err(child->ci, "List deletion must operate directly on the final child");
                                        goto fail;
                                }
+
+                               /*
+                                *      We don't do list comparisons either.
+                                */
+                               if (fr_type_is_structural(tmpl_attr_tail_da(child->lhs)->type)) {
+                                       cf_log_err(child->ci, "List deletion cannot operate on lists");
+                                       goto fail;
+                               }
                        }
                }
        } else {