%{rand} in recent versions

Stefan Winter stefan.winter at restena.lu
Mon Jul 15 08:41:02 CEST 2013


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 :-(

I didn't go back to 2.1.12. I'm "fairly sure" it worked back in the day.

(Yes, I also want a %s insatead of %S in my config, got it. But the
%{rand:} is really a bit more important than that. )

Stefan

-- 
Stefan WINTER
Ingenieur de Recherche
Fondation RESTENA - Réseau Téléinformatique de l'Education Nationale et
de la Recherche
6, rue Richard Coudenhove-Kalergi
L-1359 Luxembourg

Tel: +352 424409 1
Fax: +352 422473

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 263 bytes
Desc: OpenPGP digital signature
URL: <http://lists.freeradius.org/pipermail/freeradius-devel/attachments/20130715/485c2366/attachment-0001.pgp>


More information about the Freeradius-Devel mailing list