From owner-freebsd-current Fri Jun 9 23:46:38 2000 Delivered-To: freebsd-current@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 542) id 8F3EE37B66E; Fri, 9 Jun 2000 23:46:34 -0700 (PDT) Date: Fri, 9 Jun 2000 23:46:34 -0700 From: "Andrey A. Chernov" To: "Jeroen C. van Gelderen" Cc: Mark Murray , Kris Kennaway , current@FreeBSD.ORG Subject: Re: mktemp() patch Message-ID: <20000609234634.A50676@freebsd.org> References: <394124C3.221E61BC@vangelderen.org> <200006092002.WAA00773@grimreaper.grondar.za> <20000609155342.B33329@freebsd.org> <39417FA5.F260EAA8@vangelderen.org> <20000609232358.A38967@freebsd.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Mailer: Mutt 0.95.4i In-Reply-To: <20000609232358.A38967@freebsd.org>; from ache@freebsd.org on Fri, Jun 09, 2000 at 11:23:58PM -0700 Organization: Biomechanoid Sender: owner-freebsd-current@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG On Fri, Jun 09, 2000 at 11:23:58PM -0700, Andrey A. Chernov wrote: > > would be the way to go: 64^6 = 2^36 possibilities which is nice... > > 1) Just totally opposite: mixing random with non-random sources you'll get > into collision much faster then with random source only. 2) Yet, of course, > the code handles collisions. Part 2) need to be clarified too. The code _attempt_ to handle collision, but collision race can occurse between two processes checking for collision, so getpid() insertion prevents this. I am not against of removing getpid() code totally, just against of "randomization" of it, suggested in the patch, which increase collision chance. -- Andrey A. Chernov http://ache.pp.ru/ To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-current" in the body of the message