Skip to content

Commit

Permalink
coverity: #1425770
Browse files Browse the repository at this point in the history
Insecure temporary file

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
  • Loading branch information
Christian Brauner committed Jun 15, 2018
1 parent 4250ef6 commit c3b818a
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/lxc/utils.c
Expand Up @@ -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;

Expand Down

0 comments on commit c3b818a

Please sign in to comment.