From owner-svn-src-head@FreeBSD.ORG Wed Feb 29 22:35:10 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 2B1D6106564A; Wed, 29 Feb 2012 22:35:10 +0000 (UTC) (envelope-from cognet@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 1A2C88FC08; Wed, 29 Feb 2012 22:35:10 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q1TMZ9AY048115; Wed, 29 Feb 2012 22:35:09 GMT (envelope-from cognet@svn.freebsd.org) Received: (from cognet@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q1TMZ9oe048113; Wed, 29 Feb 2012 22:35:09 GMT (envelope-from cognet@svn.freebsd.org) Message-Id: <201202292235.q1TMZ9oe048113@svn.freebsd.org> From: Olivier Houchard Date: Wed, 29 Feb 2012 22:35:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r232320 - head/usr.bin/csup X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 29 Feb 2012 22:35:10 -0000 Author: cognet Date: Wed Feb 29 22:35:09 2012 New Revision: 232320 URL: http://svn.freebsd.org/changeset/base/232320 Log: Use srandom() to init the PRNG, not srand(), since we use random(). This is harmless because srandom() is called somewhere else, with time(NULL) as a seed, but this is more correct. Obtained from: https://bitbucket.org/mux/csup Pointyhat to: not mux, somebody else MFC after: 1 week Modified: head/usr.bin/csup/auth.c Modified: head/usr.bin/csup/auth.c ============================================================================== --- head/usr.bin/csup/auth.c Wed Feb 29 22:21:58 2012 (r232319) +++ head/usr.bin/csup/auth.c Wed Feb 29 22:35:09 2012 (r232320) @@ -293,7 +293,7 @@ auth_makechallenge(struct config *config gettimeofday(&tv, NULL); pid = getpid(); ppid = getppid(); - srand(tv.tv_usec ^ tv.tv_sec ^ pid); + srandom(tv.tv_usec ^ tv.tv_sec ^ pid); addrlen = sizeof(laddr); error = getsockname(config->socket, (struct sockaddr *)&laddr, &addrlen); if (error < 0) {