Reuben Thomas wrote:
> From mkstemp(3):
> 
>        More generally, the POSIX specification of mkstemp() does not
> say anything about file modes,
>        so the application should make sure its file mode creation mask
> (see umask(2)) is set
>        appropriately before calling mkstemp() (and mkostemp()).

... or the application should call chmod() after mkstemp() or mkostemp().

> Does setting a 0600 umask (as glibc does) sound like a good thing to
> add to the mkstemp-safer functions?

The application can call chmod() on its own. Why push this into mkstemp-safer?

Programmers who use mkstemp / mkstemps / etc. also need to care about
cleanup in case of Ctrl-C or SIGHUP, otherwise /tmp fills up. (Cf. module
'clean-temp'.) How do you want to deal with this extra requirement?

Bruno
-- 
In memoriam Heinrich Conradi <http://de.wikipedia.org/wiki/Heinrich_Conradi>

Reply via email to