unlang Question about evaluating unavailable attributes to FALSE

2011-05-17 Thread Stefan A.
Hi,

if I'm using an expression like

if (control:VSA1=~/something/ || control:VSA2 =~/something_else/)
{...}

I do get the information(Attribute control:VSA1 was not found) in case
the VSA is not in the control context.
As the condition is '||', I would expect, that FR tries the next option, but
it does not. It sets the hole Expression to FALSE.

If I exchange the Options, it works for me, because VSA2 is always
available.

if (control:VSA2=~/something/ || control:VSA1 =~/something_else/)
{...}

If I preset VSA1, it works too, but will add slightly more load.


Is there a solution for the missing Attribute to be ignored in '||'
conditions i.e. setting it discrete to FALSE, so tht FR is able to evaluate
the rest of the || expression? Would this be advisable?


Thank you.
Stefan







-
List info/subscribe/unsubscribe? See http://www.freeradius.org/list/users.html


Re: unlang Question about evaluating unavailable attributes to FALSE

2011-05-17 Thread Alan DeKok
Stefan A. wrote:
 if I'm using an expression like
 
   if (control:VSA1=~/something/ || control:VSA2 =~/something_else/)
 {...}
 
 I do get the information(Attribute control:VSA1 was not found) in case
 the VSA is not in the control context.
 As the condition is '||', I would expect, that FR tries the next option, but
 it does not. It sets the hole Expression to FALSE.

  I think that's fixed in the v2.1.x branch in git.  The fix will be in
2.1.11.

  Alan DeKok.
-
List info/subscribe/unsubscribe? See http://www.freeradius.org/list/users.html