Fix mkstemp(3) creating files with an insecure mode.

This commit is contained in:
Jonas 'Sortie' Termansen 2014-08-20 01:15:24 +02:00
parent 74fbbb3c78
commit b75678bcab
1 changed files with 1 additions and 1 deletions

View File

@ -43,7 +43,7 @@ extern "C" int mkstemp(char* templ)
{
for ( size_t i = templ_length - 6; i < templ_length; i++ )
templ[i] = '0' + rand() % 10;
} while ( (fd = open(templ, O_RDWR | O_EXCL | O_CREAT, 0666)) < 0 &&
} while ( (fd = open(templ, O_RDWR | O_EXCL | O_CREAT, 0600)) < 0 &&
(errno == EEXIST) );
return fd;