Insecure temporary file

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
This commit is contained in:
Christian Brauner 2018-06-15 11:33:34 +02:00
parent 4250ef64b3
commit c3b818a0b3
No known key found for this signature in database
GPG Key ID: 8EB056D53EECB12D

View File

@ -2411,8 +2411,11 @@ bool lxc_nic_exists(char *nic)
int lxc_make_tmpfile(char *template, bool rm)
{
int fd, ret;
mode_t msk;
msk = umask(0022);
fd = mkstemp(template);
umask(msk);
if (fd < 0)
return -1;