On 04/27/2011 04:37 PM, Bruno Haible wrote: > Eric Blake wrote: >>> +# On some hosts, mkstemp creates files with mode 0666, which is a security >>> +# problem. >> >> Also, it was valid in POSIX 2001, but violates POSIX 2008. > > What about mkstemps? Does it have the same problem as mkstemp?
In all my testing, I couldn't even find one of the "older platforms" where mkstemp used 0666 instead of 0600 - HP-UX 10.20 has broken mkstemp, but still had correct permissions. mkstemps is a newer interface, not yet standardized in POSIX - any platform new enough to implement it is already starting from a decent mkstemp interface. > The answer is fortunately "no". The platforms x symbols matrix shows that > mkstemps() is defined on MacOS X, FreeBSD, OpenBSD, Solaris 11, and Cygwin > 1.7. Which matches the fact that mkstemps is newer. -- Eric Blake ebl...@redhat.com +1-801-349-2682 Libvirt virtualization library http://libvirt.org
signature.asc
Description: OpenPGP digital signature