mirror of
https://gitlab.com/sortix/sortix.git
synced 2023-02-13 20:55:38 -05:00
Fix mkstemp(3) creating files with an insecure mode.
This commit is contained in:
parent
74fbbb3c78
commit
b75678bcab
1 changed files with 1 additions and 1 deletions
|
@ -43,7 +43,7 @@ extern "C" int mkstemp(char* templ)
|
||||||
{
|
{
|
||||||
for ( size_t i = templ_length - 6; i < templ_length; i++ )
|
for ( size_t i = templ_length - 6; i < templ_length; i++ )
|
||||||
templ[i] = '0' + rand() % 10;
|
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) );
|
(errno == EEXIST) );
|
||||||
|
|
||||||
return fd;
|
return fd;
|
||||||
|
|
Loading…
Reference in a new issue