From owner-freebsd-current Sun Feb 16 22:31:30 2003 Delivered-To: freebsd-current@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id DA83337B401; Sun, 16 Feb 2003 22:31:28 -0800 (PST) Received: from HAL9000.homeunix.com (12-233-57-224.client.attbi.com [12.233.57.224]) by mx1.FreeBSD.org (Postfix) with ESMTP id 6247543FBD; Sun, 16 Feb 2003 22:31:27 -0800 (PST) (envelope-from dschultz@uclink.Berkeley.EDU) Received: from HAL9000.homeunix.com (localhost [127.0.0.1]) by HAL9000.homeunix.com (8.12.6/8.12.5) with ESMTP id h1H6VPQb006328; Sun, 16 Feb 2003 22:31:25 -0800 (PST) (envelope-from dschultz@uclink.Berkeley.EDU) Received: (from das@localhost) by HAL9000.homeunix.com (8.12.6/8.12.5/Submit) id h1H6VPBi006327; Sun, 16 Feb 2003 22:31:25 -0800 (PST) (envelope-from dschultz@uclink.Berkeley.EDU) Date: Sun, 16 Feb 2003 22:31:25 -0800 From: David Schultz To: Kris Kennaway Cc: Tim Robbins , "Andrey A. Chernov" , current@FreeBSD.ORG Subject: Re: cvs commit: src/lib/libc/stdlib rand.c Message-ID: <20030217063125.GA6292@HAL9000.homeunix.com> Mail-Followup-To: Kris Kennaway , Tim Robbins , "Andrey A. Chernov" , current@FreeBSD.ORG References: <200302170352.h1H3qawJ062671@repoman.freebsd.org> <20030217045729.GA68471@rot13.obsecurity.org> <20030217164048.A28273@dilbert.robbins.dropbear.id.au> <20030217060810.GA68835@rot13.obsecurity.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20030217060810.GA68835@rot13.obsecurity.org> Sender: owner-freebsd-current@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG Thus spake Kris Kennaway : > On Mon, Feb 17, 2003 at 04:40:48PM +1100, Tim Robbins wrote: > > > I disagree. It's safe to use rand() in games and in certain kinds of > > simulations when you don't care that the distribution isn't quite > > uniform, or when you prefer speed over quality. I don't think rand() > > needs a warning message like gets() &c. because it's not as dangerous. > > The problem is that there are a number of applications that use it > when they should not. I've given examples of two of them, and there > are probably lots of others I haven't noticed. For example, I just > checked, and libICE appears to use rand() for cookie generation. This > is completely bogus, and insecure. > > Note that I was only suggesting this patch be committed to -current > for purposes of finding out what these applications are, and fixing > them as appropriate. Then how about wrapping the warning in an #ifdef, so people who want to find inappropriate uses of rand() can do so for as long as they want, and everyone else who uses -CURRENT is not affected? To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-current" in the body of the message