From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 24879 invoked from network); 5 May 1998 03:02:40 -0000 Received: from math.gatech.edu (list@130.207.146.50) by ns1.primenet.com.au with SMTP; 5 May 1998 03:02:40 -0000 Received: (from list@localhost) by math.gatech.edu (8.8.5/8.8.5) id WAA12692; Mon, 4 May 1998 22:59:06 -0400 (EDT) Resent-Date: Mon, 4 May 1998 22:59:06 -0400 (EDT) To: zsh-workers@math.gatech.edu Path: mason From: mason@primenet.com.au (Geoff Wing) Newsgroups: lists.zsh.workers Subject: Re: ``mktemp() possibly used unsafely'' Date: 5 May 1998 02:59:16 GMT Organization: PrimeNet Computer Consultants Message-ID: References: <199805050231.WAA27346@luomat.peak.org> Reply-To: mason@primenet.com.au NNTP-Posting-Host: coral.primenet.com.au X-Trace: coral.primenet.com.au 894337156 24725 (None) 203.24.36.33 X-Complaints-To: usenet@coral.primenet.com.au X-Newsreader: slrn (0.9.5.1 UNIX) Resent-Message-ID: <"p1i4r2.0.F63.v1eJr"@math> Resent-From: zsh-workers@math.gatech.edu X-Mailing-List: archive/latest/3927 X-Loop: zsh-workers@math.gatech.edu Precedence: list Resent-Sender: zsh-workers-request@math.gatech.edu Timothy J Luoma 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 Mobile : 0412 162 441 Work URL: http://www.primenet.com.au/ Ego URL: http://pobox.com/~gcw/