From: Alan T. DeKok Date: Sun, 17 Sep 2023 14:29:13 +0000 (-0400) Subject: be a bit smarter about it X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=bf1a52c4857e75bec8c90be29a608ac820178ea2;p=thirdparty%2Ffreeradius-server.git be a bit smarter about it --- diff --git a/src/lib/unlang/compile.c b/src/lib/unlang/compile.c index 92300b11d7e..377a5d87d02 100644 --- a/src/lib/unlang/compile.c +++ b/src/lib/unlang/compile.c @@ -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 {