From: Alan T. DeKok Date: Mon, 21 Aug 2023 00:56:49 +0000 (-0400) Subject: notes on immutable children of temporary attibutes X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=76816565aee52996c6873a06ff503d3dee2891d8;p=thirdparty%2Ffreeradius-server.git notes on immutable children of temporary attibutes --- diff --git a/src/lib/util/edit.c b/src/lib/util/edit.c index 08284f7ee89..eb77d456e54 100644 --- a/src/lib/util/edit.c +++ b/src/lib/util/edit.c @@ -265,10 +265,12 @@ static int edit_record(fr_edit_list_t *el, fr_edit_op_t op, fr_pair_t *vp, fr_pa case FR_EDIT_CLEAR: if (!fr_type_is_structural(vp->vp_type)) return 0; - if (fr_pair_immutable(vp)) { - fr_strerror_printf("Cannot modify immutable value for %s", vp->da->name); - return -1; - } + /* + * The VP is a child of an attribute which was previously inserted as part of + * this edit. We therefore allow the "clear" to clear it, even if it contains + * immutable children. Because this operation is equivalent to just never + * creating the children. + */ fr_pair_list_free(&vp->vp_group); return 0;