acct_unique with more than one Class attribute

Andrea Gabellini andrea.gabellini at telecomitalia.sm
Mon Mar 27 13:15:43 CEST 2017



Il 27/03/2017 12:43, Brian Candler ha scritto:
> On 27/03/2017 11:10, Brian Candler wrote:
>> The underlying issue is that 'Class' is not a string attribute, so
>> it's hard to treat it as such.
>
> Ah now I see, that's probably why &Class =~ /.../ may not work.
>
> You could try (<string>&Class[*] =~ /.../).

This doesn't work:
Mon Mar 27 12:52:18 2017 : Error:
/usr/local/freeradius/etc/raddb/policy.d/accounting[55]: Parse error in
condition
Mon Mar 27 12:52:18 2017 : Error:
/usr/local/freeradius/etc/raddb/policy.d/accounting[55]:
(<string>&Class[*] =~ /(.*)/) {
Mon Mar 27 12:52:18 2017 : Error:
/usr/local/freeradius/etc/raddb/policy.d/accounting[55]:  ^ Cannot use
cast with regex comparison

>
> Or you could try copying &Class to &Tmp-String-0 first. I believe
> there is a syntax for copying all the values of one attribute to
> another attribute, but I can't remember what that is right now.

Any clue on this :-)

Defining the Class attribute as string works. Thanks.

I would like to trying again without this workaround....


>
> Also there is the filtering version of update you can try:
>
> update request {
>
>     &Class =~ /.../
>
> }
>
> which only keeps instances matching the regexp. Again, not sure how
> the binary Class attribute will interact with that.
>
> Sorry, I'm not being very specific here, you'll have to test the
> various options.
>
> Regards,
>
> Brian.

-- 
----------------------------------------------------------------
Never trust anything that bleeds for five days and doesn't die.

----------------------------------------------------------------

Ing. Andrea Gabellini
Email: andrea.gabellini at telecomitalia.sm
Skype: andreagabellini
Tel: (+378) 0549 886111
Fax: (+378) 0549 886188

Telecom Italia San Marino S.p.A.
Via XXVIII Luglio, 212 - Piano -2
47893 Borgo Maggiore
Republic of San Marino

http://www.telecomitalia.sm



More information about the Freeradius-Users mailing list