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 1391f77..4c1da75 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 467a6d6..35067b4 100644 (file)
@@ -1014,6 +1014,14 @@ void radius_pairmove(REQUEST *request, VALUE_PAIR **to, VALUE_PAIR *from)
                        }
 
                        /*
+                        *      Delete every attribute, independent
+                        *      of its value.
+                        */
+                       if (from_list[i]->operator == T_OP_CMP_FALSE) {
+                               goto delete;
+                       }
+
+                       /*
                         *      Delete all matching attributes from
                         *      "to"
                         */