]> git.ipfire.org Git - thirdparty/freeradius-server.git/commitdiff
warn on not removing immutable attribute
authorAlan T. DeKok <aland@freeradius.org>
Tue, 22 Aug 2023 19:55:01 +0000 (15:55 -0400)
committerAlan T. DeKok <aland@freeradius.org>
Wed, 23 Aug 2023 01:36:39 +0000 (21:36 -0400)
src/lib/unlang/edit.c

index c1bde652ad18bcb281d5f34c901062d819527f67..f6cff52921221677705a342bc7c5034fc3f5822c 100644 (file)
@@ -365,7 +365,14 @@ static int apply_edits_to_list(request_t *request, unlang_frame_state_edit_t *st
                        list = fr_pair_parent_list(vp);
                        fr_assert(list != NULL);
 
-                       if (fr_pair_immutable(vp)) continue;
+                       /*
+                        *      @todo - if this attribute is structural, then remove all children which aren't
+                        *      immutable.  For now, this is good enough.
+                        */
+                       if (fr_pair_immutable(vp)) {
+                               RWDEBUG("Not removing immitable %pP", vp);
+                               continue;
+                       }
 
                        if (fr_edit_list_pair_delete(current->el, list, vp) < 0) {
                                tmpl_dcursor_clear(&cc);