Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 23 Nov 2000 13:44:36 -0800
From:      Kris Kennaway <kris@FreeBSD.ORG>
To:        Sheldon Hearn <sheldonh@uunet.co.za>
Cc:        audit@FreeBSD.ORG
Subject:   Re: makedevops.pl and makeobjops.pl tmpfiles
Message-ID:  <20001123134436.A36337@citusc17.usc.edu>
In-Reply-To: <14242.974995366@axl.fw.uunet.co.za>; from sheldonh@uunet.co.za on Thu, Nov 23, 2000 at 06:02:46PM %2B0200
References:  <14242.974995366@axl.fw.uunet.co.za>

next in thread | previous in thread | raw e-mail | index | archive | help

--Q68bSM7Ycu6FN28Q
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline

On Thu, Nov 23, 2000 at 06:02:46PM +0200, Sheldon Hearn wrote:

> It seems to me that, unless we import the File::Temp perl5 module into
> the base system (as NetBSD have done), we should use something like the
> following patch to makeobjops.pl and makedevops.pl, less they be abused.

Thanks for the patch, Sheldon. This one has been annoying me for a
while. However, I think I prefer the above option as a more generic
solution. I presume it includes functionality similar to mkstemp().

> The perl5.6.0's srand() subroutine seeds the PRNG from /dev/urandom,
> so we don't have to worry too much about a guessable seed.  In fact,
> the call to srand() shouldn't be required at all, since perl5.6.0
> automatically calls srand() if it has not yet been called by the time
> rand() is first called.

What libc function does rand() call? random(), by the sounds of it.

> +   $ctmpname = "$tmpdir/ctmp." . rand(9999);
> +   $htmpname = "$tmpdir/htmp." . rand(9999);

Any particular reason for not using rand(999999999) or so? :-)

Kris
--Q68bSM7Ycu6FN28Q
Content-Type: application/pgp-signature
Content-Disposition: inline

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.0.4 (FreeBSD)
Comment: For info see http://www.gnupg.org

iEYEARECAAYFAjodj8QACgkQWry0BWjoQKVhXQCeJBH6UauK0pA5K1WGI8X09tCz
pSkAnRh8N8YcodsrfdxwbRsiY5C0EJS5
=w6Il
-----END PGP SIGNATURE-----

--Q68bSM7Ycu6FN28Q--


To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-audit" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20001123134436.A36337>