degesch: use mkstemp() with a safe umask
This commit is contained in:
parent
3315b16f79
commit
03d5b27398
|
@ -11251,7 +11251,10 @@ display_full_log (struct app_context *ctx)
|
||||||
static bool
|
static bool
|
||||||
dump_input_to_file (struct app_context *ctx, char *template, struct error **e)
|
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);
|
int fd = mkstemp (template);
|
||||||
|
(void) umask (mask);
|
||||||
|
|
||||||
if (fd < 0)
|
if (fd < 0)
|
||||||
FAIL ("%s", strerror (errno));
|
FAIL ("%s", strerror (errno));
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue