Initial support of Multi Valued Attributes operators

Arran Cudbard-Bell a.cudbardb at freeradius.org
Mon Mar 25 22:05:07 CET 2013


On 25 Mar 2013, at 13:33, Phil Mayers <p.mayers at IMPERIAL.AC.UK> wrote:

> On 25/03/13 17:23, Olivier Beytrison wrote:
> 
>> People can have from one to 6-7 of those attributes. With normal unlang
>> operators it will only compare the first attribute it finds.
> 
> In which case the case, the behaviour differs between "users" files (which compare all) and "unlang". Le sigh.
> 
>>> Likewise, I thought == matches if one of several attributes match, but
>>> that's not behaviour I'm testing.
>> 
>> Nope, it only check the first attribute. Till now there was no looping
>> over all the possible same attribute-name in the list.
> 
> I wonder if that might not be a better solution; for the == and =~ operators, loop over all and match if any matches. This seems "least surprising" to me.
> 
> You would still then want a "match all" operator, which would need to be new.

Actually yes, this makes more sense. If you want to test specific instances of an attribute you can always use <attr>[<num>].  

&==		∀
==		∃

We still don't have a higlander operator (∃!), but i'm not sure that'd be useful. 

Honestly i'm not sure if &== is at all useful and adding features for perceived completeness just means additional code to maintain. &=~  OTOH could be very useful for validation purposes.

> But I don't feel strongly about it; I'm already abusing unlang way too much anyway, and if I get the time and energy I'm going to investigate alternative solutions (that don't involve rlm_perl).


Good plan. Do you have any interest in using Lua?

-Arran


More information about the Freeradius-Devel mailing list