summaryrefslogtreecommitdiff
path: root/lib/util/util.c
diff options
context:
space:
mode:
Diffstat (limited to 'lib/util/util.c')
-rw-r--r--lib/util/util.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/lib/util/util.c b/lib/util/util.c
index d49e20e6cd..464fc62e1f 100644
--- a/lib/util/util.c
+++ b/lib/util/util.c
@@ -63,6 +63,7 @@ int create_unlink_tmp(const char *dir)
{
char *fname;
int fd;
+ mode_t mask;
if (!dir) {
dir = tmpdir();
@@ -73,7 +74,9 @@ int create_unlink_tmp(const char *dir)
errno = ENOMEM;
return -1;
}
+ mask = umask(S_IRWXO | S_IRWXG);
fd = mkstemp(fname);
+ umask(mask);
if (fd == -1) {
TALLOC_FREE(fname);
return -1;