from the man page:

       More generally, the POSIX specification of mkstemp() does not say  any-
       thing  about  file  modes, so the application should make sure its file
       mode creation mask (see umask(2)) is set appropriately  before  calling
       mkstemp()

perhaps a umask(0077) is missing ?

re,
 wh

Denys Vlasenko schrieb:
> On Thu, Oct 21, 2010 at 4:07 PM, Alexander Shishkin <[email protected]> 
> wrote:
>> +int FAST_FUNC xmkstemp(char *template)
>> +{
>> +       mode_t saved_umask;
>> +       int fd;
>> +
>> +       saved_umask = umask(0);
>> +       fd = mkstemp(template);
>> +       umask(saved_umask);
>> +
>> +       if (fd == -1)
>> +               bb_perror_msg_and_die("Can't create temp file %s", template);
>> +
>> +       return fd;
>> +}
> 
> Why do you save/restore umask?
_______________________________________________
busybox mailing list
[email protected]
http://lists.busybox.net/mailman/listinfo/busybox

Reply via email to