]> git.ipfire.org Git - thirdparty/freeradius-server.git/commitdiff
allow &request -= "Tmp-String-0 == 'foo'"
authorAlan T. DeKok <aland@freeradius.org>
Tue, 9 Aug 2022 16:35:23 +0000 (12:35 -0400)
committerAlan T. DeKok <aland@freeradius.org>
Tue, 9 Aug 2022 17:09:34 +0000 (13:09 -0400)
for getting rid of pairs via things like SQL queries

src/lib/unlang/edit.c
src/tests/keywords/edit-list-remove

index 42c33d95d1ecb971c3458cd30bcad2fc5fd03180..b0fad445deedfb29f9f0f1130282a7493b28d828 100644 (file)
@@ -313,14 +313,6 @@ static int apply_edits_to_list(request_t *request, edit_map_t *current, map_t co
 
                rhs_box = tmpl_value(current->rhs.vpt);
 
-               /*
-                *      @todo - just parse the data as a string, and remove it?
-                */
-               if (map->op == T_OP_SUB_EQ) {
-                       REDEBUG("%s[%d] Cannot remove data from a list", MAP_INFO);
-                       return -1;
-               }
-
                da = current->lhs.vp->da;
                if (fr_type_is_group(da->type)) da = fr_dict_root(request->dict);
 
index db29caed26a9eac720c96320a0211cd825681fe2..d7b57b0e2d88a7914bf8c7a7892633fb8878c626 100644 (file)
@@ -90,6 +90,16 @@ if (&Tmp-String-0[2]) {
        test_fail
 }
 
-%(debug_attr:request[*])
+#
+#  Remove via in-place list, too.
+#
+&request -= "Tmp-String-0 == 'foo'"
+if (&Tmp-String-0[0] != "baz") {
+       test_fail
+}
+
+if (&Tmp-String-0[1]) {
+       test_fail
+}
 
 success