From owner-cvs-all@FreeBSD.ORG  Sat Jul 23 02:08:12 2005
Return-Path: <owner-cvs-all@FreeBSD.ORG>
X-Original-To: cvs-all@FreeBSD.ORG
Delivered-To: cvs-all@FreeBSD.ORG
Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125])
	by hub.freebsd.org (Postfix) with ESMTP id 77C8D16A41F;
	Sat, 23 Jul 2005 02:08:12 +0000 (GMT)
	(envelope-from ache@nagual.pp.ru)
Received: from nagual.pp.ru (nagual.pp.ru [194.87.13.69])
	by mx1.FreeBSD.org (Postfix) with ESMTP id BDD8043D45;
	Sat, 23 Jul 2005 02:08:11 +0000 (GMT)
	(envelope-from ache@nagual.pp.ru)
Received: from nagual.pp.ru (ache@localhost [127.0.0.1])
	by nagual.pp.ru (8.13.4/8.13.4) with ESMTP id j6N28ApG028865;
	Sat, 23 Jul 2005 06:08:10 +0400 (MSD)
	(envelope-from ache@nagual.pp.ru)
Received: (from ache@localhost)
	by nagual.pp.ru (8.13.4/8.13.4/Submit) id j6N28AmY028864;
	Sat, 23 Jul 2005 06:08:10 +0400 (MSD) (envelope-from ache)
Date: Sat, 23 Jul 2005 06:08:10 +0400
From: Andrey Chernov <ache@FreeBSD.ORG>
To: "Greg 'groggy' Lehey" <grog@FreeBSD.ORG>
Message-ID: <20050723020810.GA28712@nagual.pp.ru>
Mail-Followup-To: Andrey Chernov <ache@freebsd.org>,
	Greg 'groggy' Lehey <grog@FreeBSD.ORG>, src-committers@FreeBSD.ORG,
	cvs-src@FreeBSD.ORG, cvs-all@FreeBSD.ORG
References: <200507230146.j6N1koqL061690@repoman.freebsd.org>
	<20050723015517.GA28428@nagual.pp.ru>
	<20050723020120.GV842@wantadilla.lemis.com>
Mime-Version: 1.0
Content-Type: multipart/signed; micalg=pgp-sha1;
	protocol="application/pgp-signature"; boundary="k1lZvvs/B4yU6o8G"
Content-Disposition: inline
In-Reply-To: <20050723020120.GV842@wantadilla.lemis.com>
User-Agent: Mutt/1.5.9i
Cc: cvs-src@FreeBSD.ORG, src-committers@FreeBSD.ORG, cvs-all@FreeBSD.ORG
Subject: Re: cvs commit: src/games/fortune/fortune fortune.c
X-BeenThere: cvs-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: CVS commit messages for the entire tree <cvs-all.freebsd.org>
List-Unsubscribe: <http://lists.freebsd.org/mailman/listinfo/cvs-all>,
	<mailto:cvs-all-request@freebsd.org?subject=unsubscribe>
List-Archive: <http://lists.freebsd.org/pipermail/cvs-all>
List-Post: <mailto:cvs-all@freebsd.org>
List-Help: <mailto:cvs-all-request@freebsd.org?subject=help>
List-Subscribe: <http://lists.freebsd.org/mailman/listinfo/cvs-all>,
	<mailto:cvs-all-request@freebsd.org?subject=subscribe>
X-List-Received-Date: Sat, 23 Jul 2005 02:08:12 -0000


--k1lZvvs/B4yU6o8G
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable

On Sat, Jul 23, 2005 at 11:31:20AM +0930, Greg 'groggy' Lehey wrote:
> No, it was there:
>=20
>         init_prob();
> -       srandomdev();
> +       gettimeofday (&now, NULL);
> +       srandom (now.tv_usec);
>=20
> 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=20
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=20
enough startup randomness. Use rc-embedded ability to keep randomness=20
around boots and add more random sources instead.

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

--=20
http://ache.pp.ru/

--k1lZvvs/B4yU6o8G
Content-Type: application/pgp-signature
Content-Disposition: inline

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.1 (FreeBSD)

iQCVAwUBQuGmiuJgpPLZnQjrAQIcwQP/f2ztCRF/GA7sVfoK8wE+UsQMxAT2fUiG
CNblXBYQU1H6nUKbn2fxIIhUz3h1+r+aXwV60mVL0BkiJyB1MWPHY1HPV1wdBdTJ
AiLLIh4eieToXyndooPzuGxxXkWZgZglFFEMMuGPO8bIdV8Dg2ChJRcaB8b86l6E
Jcy98R8yjZQ=
=1xEu
-----END PGP SIGNATURE-----

--k1lZvvs/B4yU6o8G--