evaluated result is wrong

Arran Cudbard-Bell a.cudbard-bell at sussex.ac.uk
Sun Dec 20 18:53:38 CET 2009


On 20/12/2009 17:40, Stephan Kirsten wrote:
> Arran Cudbard-Bell schrieb:
>>> I have a question regarding this debug log output. I'm a bit confused
>>> about this logic operations and the boolean result:
>>>
>>> Sun Dec 20 15:44:46 2009 : Info: ++? if ("%{control:Tmp-Integer-4}" >=
>>> "%{control:Tmp-Integer-5}")
>>> Sun Dec 20 15:44:46 2009 : Info:        expand:
>>> %{control:Tmp-Integer-4} -> 32933844
>>> Sun Dec 20 15:44:46 2009 : Info:        expand:
>>> %{control:Tmp-Integer-5} -> 2785017856
>>> Sun Dec 20 15:44:46 2009 : Info: ? Evaluating
>>> ("%{control:Tmp-Integer-4}" >= "%{control:Tmp-Integer-5}") -> TRUE
>>>     
>> Hmm have you tried using direct references to the attributes? i.e.
>> if(control:Tmp-Integer-4 >= control:Tmp-Integer-5). The values of the
>> attributes will likely be converted to a strings before comparison,
>> might be causing the odd result...
>>   
> I tried your suggestion, but then the parsing breaks
>
> Sun Dec 20 17:20:33 2009 : Info: ++? if (control:Tmp-Integer-4 >=
> control:Tmp-Integer-5)
> Sun Dec 20 17:20:33 2009 : Info: Failed parsing
> "control:Tmp-Integer-5": Unknown value control:Tmp-Integer-5 for
> attribute Tmp-Integer-4
> Sun Dec 20 17:20:33 2009 : Info: ++? if (control:Tmp-Integer-4 <
> control:Tmp-Integer-5)
> Sun Dec 20 17:20:33 2009 : Info: Failed parsing
> "control:Tmp-Integer-5": Unknown value control:Tmp-Integer-5 for
> attribute Tmp-Integer-4
>
Hmm maybe the right operand has to be an integer or string value. Try a mix?
if (control:Tmp-Integer-4 < "%{control:Tmp-Integer-5}")

The logic being that the left operand is known to be an integer...

-Arran

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 258 bytes
Desc: OpenPGP digital signature
URL: <http://lists.freeradius.org/pipermail/freeradius-users/attachments/20091220/f23df056/attachment.pgp>


More information about the Freeradius-Users mailing list