bug-gnulib
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Bug-gnulib] mkstemp


From: James Youngman
Subject: Re: [Bug-gnulib] mkstemp
Date: Fri, 22 Aug 2003 09:51:27 +0100
User-agent: Mutt/1.3.28i

On Tue, Aug 19, 2003 at 04:53:41PM -0400, Derek Robert Price wrote:
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
> 
> mkstemp.m4 currently checks via AC_TRY_RUN that mkstemp can create 30
> consecutive files.  Would it be reasonable to want to check that one has
> mode 0600?  This is the current comment and handling in CVS:
> 
> ~   . . .
> ~        if (fp == NULL) free (fn);
> ~    #if (__GLIBC__ - 0 < 2 || __GLIBC__ - 0 == 2 && __GLIBC_MINOR__ - 0
> == 0)
> ~        /* mkstemp is defined to open mode 0600 using glibc 2.0.7+ */
> ~        else chmod (fn, 0600);
> ~    #endif /* GLIBC API version <= 2.0 */

Does the affected version of mkstemp() use an initial mode which is
too lax, or one which is too restrictive?  If the former, you should
probably call ftruncate() on the file after calling chmod() just in
case the race condition has been taken advantage of.

> Has anyone heard of similar broken mkstemp implementations or is it only
> GLIBC?  I haven't found anything recent in the archives.

No, the only mkstemp() problem I know of is a bug in the previous
version of the POSIX standard where the example usage was wrong.

Other broken but not similar implementations inclulde :-
http://docs.freebsd.org/cgi/getmsg.cgi?fetch=496565+0+archive/2002/freebsd-bugs/20020526.freebsd-bugs

http://groups.yahoo.com/group/gnu-win32/message/3413?source=1

http://mail-index.netbsd.org/current-users/1996/07/17/0016.html



-- 
James Youngman.
CSSC Bug reporting page:       http://sf.net/tracker/?group_id=8064&atid=108064
GNU Findutils bug reporting page: http://savannah.gnu.org/bugs/?group=findutils




reply via email to

[Prev in Thread] Current Thread [Next in Thread]