%{rand} in recent versions

Arran Cudbard-Bell a.cudbardb at freeradius.org
Mon Jul 15 09:20:35 CEST 2013


On 15 Jul 2013, at 07:41, Stefan Winter <stefan.winter at restena.lu> wrote:

> Hi,
> 
> while I've been staring at debug output of 2.x.x I noticed that%{rand:x}
> doesn't seem to do what it should:
> 
> ++? if (true ) -> TRUE
> ++- entering if (true ) {...}
>        expand: %{rand:1000000}%Y%m%d%H%M%S -> 201307150802013-07-15
> 08:17:08
>        expand: %{rand:1000000}%Y%m%d%H%M%S -> 201307150802013-07-15
> 08:17:08
>        expand: %{rand:1000000}%Y%m%d%H%M%S -> 201307150802013-07-15
> 08:17:08
> 
> As you see, the expression %{rand:1000000} gets expanded into an empty
> string. In my particular case, this leads to a lot less entropy than I
> thought. The expansion is there three times alright, that's as per
> config, but I would have expected the results to be different.
> 
> Now that I knew where to look, I went back to 2.2.0 mainstream release
> code - and saw the same :-(

Works in 3.0.0, but yes, broken in v2.x.x HEAD. Odd seeing as the xlat code is very similar.

-Arran 


More information about the Freeradius-Devel mailing list