[exim-dev] [Bug 722] Need a random number generator

Startseite
Nachricht löschen
Nachricht beantworten
Autor: Roman Odaisky
Datum:  
To: exim-dev
Betreff: [exim-dev] [Bug 722] Need a random number generator
------- You are receiving this mail because: -------
You are on the CC list for the bug.

http://bugs.exim.org/show_bug.cgi?id=722




--- Comment #4 from Roman Odaisky <to.roma.from.eximbug@???> 2008-06-20 13:41:09 ---
Created an attachment (id=248)
--> (http://bugs.exim.org/attachment.cgi?id=248)
Patch to add $rand and $rand_max

This adds $rand and $rand_max. Uses rand_r(3) seeded by the number of
microseconds since the epoch given by gettimeofday(3). The "% UINT_MAX" should
be redundant, but can’t hurt. Of course, don’t expect the RNG to be
cryptographically strong. Everything should conform to POSIX.1-2001.

To apply, place the file to debian/patches and mention it in
debian/patches/00list; on non-Debian systems apply it manually to expand.c.

Any comments? Seems hard to make an error in such a simple patch.


--
Configure bugmail: http://bugs.exim.org/userprefs.cgi?tab=email