Re: fix mktemp (remove mktemp ;)
- From
- Herbert Xu <herbert@gondor.apana.org.au>
- Date
- Apr 18, 2005, 03:01 UTC
- Message-ID
- <E1DNMVX-00013d-00@gondolin.me.apana.org.au>
- In-Reply-To
- <20050416170221.38b3e66c.pj@sgi.com>
Paul Jackson <pj@sgi.com> wrote:
> > Even mktemp(1) can collide, in theory, since there is no practical way > in shell scripts to hold open and locked the file from the instant of it > is determined to be a unique name.
mktemp(1) creates the file before exiting. Other instances of mktemp(1) cannot successfully create the same file (they all use O_EXCL). Therefore this race does not exist, even in theory :)
--
Visit Openswan at http://www.openswan.org/
Email: Herbert Xu ~{PmV>HI~} <herbert@gondor.apana.org.au>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt