summaryrefslogtreecommitdiff
path: root/degesch.c
diff options
context:
space:
mode:
authorPřemysl Janouch <p.janouch@gmail.com>2016-02-09 13:52:56 +0100
committerPřemysl Janouch <p.janouch@gmail.com>2016-02-09 13:52:56 +0100
commit03d5b273982406593b976c1487e81f6401acba26 (patch)
treec7b9c3cfbd0545e634ff91489a00316e72b2631a /degesch.c
parent3315b16f79a98d43d0335f22558ff78cc4e73564 (diff)
downloadxK-03d5b273982406593b976c1487e81f6401acba26.tar.gz
xK-03d5b273982406593b976c1487e81f6401acba26.tar.xz
xK-03d5b273982406593b976c1487e81f6401acba26.zip
degesch: use mkstemp() with a safe umask
Diffstat (limited to 'degesch.c')
-rw-r--r--degesch.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/degesch.c b/degesch.c
index c509d96..7d01ef9 100644
--- a/degesch.c
+++ b/degesch.c
@@ -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));