cvs commit: src/games/fortune/fortune fortune.c

Andrey Chernov ache at FreeBSD.ORG
Sat Jul 23 02:08:12 GMT 2005


On Sat, Jul 23, 2005 at 11:31:20AM +0930, Greg 'groggy' Lehey wrote:
> No, it was there:
> 
>         init_prob();
> -       srandomdev();
> +       gettimeofday (&now, NULL);
> +       srandom (now.tv_usec);
> 
> But for whatever reasons, many systems seem to have incorrect
> random(4) initialization.  You'll recall the debate about removing

If you care about many systems, please do not degrade our own FreeBSD 
system fortune randomness and use this workaround instead:

#ifdef __FreeBSD__
	srandomdev();
#else
	gettimeofday (&now, NULL);
	srandom (now.tv_usec);
#endif

> Rush Limbaugh fortunes recently because, for some reason related to
> this issue, his fortunes kept popping up.  This is the only place

It means something wrong with /dev/random initialization, probably not 
enough startup randomness. Use rc-embedded ability to keep randomness 
around boots and add more random sources instead.

You fix the problem in the wrong place. We have a _lots_ of places where 
srandomdev() or arc4random() used (which both use /dev/random)

-- 
http://ache.pp.ru/
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 305 bytes
Desc: not available
Url : http://lists.freebsd.org/pipermail/cvs-src/attachments/20050723/8c7a10f7/attachment.bin


More information about the cvs-src mailing list