updating avp lists with unlang and operators

Stephan Jaeger stephan.jaeger at ewetel.de
Wed Aug 1 17:06:42 CEST 2007


Am Mittwoch, den 01.08.2007, 10:36 -0400 schrieb Alan DeKok:
> Stephan Jaeger wrote:
> > and i have a "detail" instance in the acct section, the line that is
> > written to the detail log is 
> > 
> > "User-Name := foobar" 
> 
>   Yeah, the operators aren't changed when the attributes are added to
> the list.  This is in 1.1.x, too.
> 
> > I guess the problem lies in my_pairmove() in evaluate.c (line 774). The
> > avp is copied from the src avp list to the dst avp list and the operator
> > is not touched. Maybe the operator in the dst list should default to "="
> > if the list is "reply" or "request"?
> 
>   Once the attribute has been moved to the destination list, the
> operator should be updated to '='.

It does work with the simple patch below, but what about control and
config lists? Shouldn't the old operator better be saved and re-set
afterwards?



--- evaluate.c.orig     2007-08-01 16:57:14.000000000 +0200
+++ evaluate.c  2007-08-01 16:58:09.000000000 +0200
@@ -776,6 +776,7 @@
                                       to_list[j]->name, i, j);
                                pairfree(&to_list[j]);
                                to_list[j] = from_list[i];
+                               to_list[j]->operator = T_OP_EQ;
                                from_list[i] = NULL;
                                edited[j] = TRUE;
                                break;

Stephan Jaeger
-- 
Stephan Jaeger <stephan.jaeger at ewetel.de>
EWE TEL GmbH




More information about the Freeradius-Devel mailing list