degesch: use mkstemp() with a safe umask

This commit is contained in:
Přemysl Eric Janouch 2016-02-09 13:52:56 +01:00
parent 3315b16f79
commit 03d5b27398
1 changed files with 3 additions and 0 deletions

View File

@ -11251,7 +11251,10 @@ display_full_log (struct app_context *ctx)
static bool
dump_input_to_file (struct app_context *ctx, char *template, struct error **e)
{
mode_t mask = umask (S_IXUSR | S_IRWXG | S_IRWXO);
int fd = mkstemp (template);
(void) umask (mask);
if (fd < 0)
FAIL ("%s", strerror (errno));