zsh-workers
 help / color / mirror / code / Atom feed
From: mason@primenet.com.au (Geoff Wing)
To: zsh-workers@math.gatech.edu
Subject: Re: ``mktemp() possibly used unsafely''
Date: 5 May 1998 02:59:16 GMT	[thread overview]
Message-ID: <slrn6kt044.o4k.mason@coral.primenet.com.au> (raw)
In-Reply-To: <199805050231.WAA27346@luomat.peak.org>

Timothy J Luoma <luomat+Lists/Zsh/workers@luomat.peak.org> typed:
:I just compiled 3.05 on a NetBSD 1.3 machine and saw this warning:
:utils.o: warning: mktemp() possibly used unsafely, consider using mkstemp ()
:What is the danger here?  How do I change to mkstemp ?

mkstemp() atomically creates the temporary file, whereas when using mktemp()
someone could create a file of the same name between calling mktemp() and
creating that file.

When zsh uses mktemp() it open()s those files with flags O_CREAT and O_EXCL
or runs mkfifo()/mknod() on it, and it's not a problem for us since we
properly check the return values (I believe), so we don't need to change
anything here.
-- 
Geoff Wing   <gcw@pobox.com>            Mobile : 0412 162 441
Work URL: http://www.primenet.com.au/   Ego URL: http://pobox.com/~gcw/


  reply	other threads:[~1998-05-05  3:02 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1998-05-05  2:31 Timothy J Luoma
1998-05-05  2:59 ` Geoff Wing [this message]
1998-05-05  5:06 ` Zoltan Hidvegi

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=slrn6kt044.o4k.mason@coral.primenet.com.au \
    --to=mason@primenet.com.au \
    --cc=zsh-workers@math.gatech.edu \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).