diff options
author | Přemysl Janouch <p.janouch@gmail.com> | 2016-02-09 13:52:56 +0100 |
---|---|---|
committer | Přemysl Janouch <p.janouch@gmail.com> | 2016-02-09 13:52:56 +0100 |
commit | 03d5b273982406593b976c1487e81f6401acba26 (patch) | |
tree | c7b9c3cfbd0545e634ff91489a00316e72b2631a | |
parent | 3315b16f79a98d43d0335f22558ff78cc4e73564 (diff) | |
download | xK-03d5b273982406593b976c1487e81f6401acba26.tar.gz xK-03d5b273982406593b976c1487e81f6401acba26.tar.xz xK-03d5b273982406593b976c1487e81f6401acba26.zip |
degesch: use mkstemp() with a safe umask
-rw-r--r-- | degesch.c | 3 |
1 files changed, 3 insertions, 0 deletions
@@ -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)); |