]> git.ipfire.org Git - thirdparty/freeradius-server.git/commitdiff
Add support for !* filtering.
authorAlan T. DeKok <aland@freeradius.org>
Sun, 29 Mar 2009 20:52:15 +0000 (13:52 -0700)
committerAlan T. DeKok <aland@freeradius.org>
Sun, 29 Mar 2009 20:52:15 +0000 (13:52 -0700)
All attributes will be deleted

man/man5/unlang.5
src/main/evaluate.c

index 1391f77ed33a951aef722b26b4e802ec4f34f2a4..4c1da751aa488fbe3968ac63c44dc02344f97c11 100644 (file)
@@ -559,32 +559,28 @@ Remove all matching attributes from the list.  Both the attribute name
 and value have to match in order for the attribute to be removed from
 the list.
 .IP ==
-Remove all non-matching attributes from the list.  Both the attribute
-name and value have to match in order for the attribute to remain in
-the list.
+Keep all matching attributes.  Both the attribute name and value have
+to match in order for the attribute to remain in the list.
 
 Note that this operator is very different than the '=' operator listed
 above!
 .IP <=
-Enforce that the integer value of the attribute is less than or equal
-to the value given here.  If there is no attribute of the same name in
-the list, the attribute is added with the given value, is with "+=".
-If an attribute in the list exists, and has value less than given
-here, it's value is unchanged.  If an attribute in the list exists,
-and has a value greater than given here, then that value is replaced
-with the one given here.
+Keep all attributes having values less than, or equal to, the value
+given here.  Any larger value is replaced by the value given here.  If
+no attribute exists, it is added with the value given here, as with
+"+=".
 
 This operator is valid only for attributes of integer type.
 .IP >=
-Enforce that the integer value of the attribute is greater than or
-equal to the value given here.  If there is no attribute of the same
-name in the list, the attribute is added with the given value, is with
-"+=".  If an attribute in the list exists, and has value greater than
-given here, it's value is unchanged.  If an attribute in the list
-exists, and has value less than given here, then that value is
-replaced with the one given here.
+Keep all attributes having values greater than, or equal to, the value
+given here.  Any larger value is replaced by the value given here.  If
+no attribute exists, it is added with the value given here, as with
+"+=".
 
 This operator is valid only for attributes of integer type.
+.IP !*
+Delete all occurances of the named attribute, no matter what the
+value.
 .RE
 .IP Values
 .br
index 467a6d6b41e9d2974ce0599d512d9f53b36a7ac0..35067b4bc53d3b837692d4b211fa16d46a94c510 100644 (file)
@@ -1013,6 +1013,14 @@ void radius_pairmove(REQUEST *request, VALUE_PAIR **to, VALUE_PAIR *from)
                                break;
                        }
 
+                       /*
+                        *      Delete every attribute, independent
+                        *      of its value.
+                        */
+                       if (from_list[i]->operator == T_OP_CMP_FALSE) {
+                               goto delete;
+                       }
+
                        /*
                         *      Delete all matching attributes from
                         *      "to"