summaryrefslogtreecommitdiff
path: root/lib/fileutils.c
diff options
context:
space:
mode:
authorKarel Zak <kzak@redhat.com>2013-04-03 16:13:06 +0200
committerKarel Zak <kzak@redhat.com>2013-04-03 16:13:06 +0200
commitb1fa3e2234fab95960eaa8499384000f189def13 (patch)
tree0db13933f5db07cb90cc40ff736829c11ad43509 /lib/fileutils.c
parent7e3729e7509ce25b2f9eb5a78f35232b6cd9b998 (diff)
downloadutil-linux-b1fa3e2234fab95960eaa8499384000f189def13.tar.gz
lib: use O_CLOEXEC in libcommon
Signed-off-by: Karel Zak <kzak@redhat.com>
Diffstat (limited to 'lib/fileutils.c')
-rw-r--r--lib/fileutils.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/fileutils.c b/lib/fileutils.c
index ff8bb8617..92b474cef 100644
--- a/lib/fileutils.c
+++ b/lib/fileutils.c
@@ -37,7 +37,7 @@ int xmkstemp(char **tmpname, char *dir)
xasprintf(&localtmp, "%s/%s.XXXXXX", _PATH_TMP,
program_invocation_short_name);
old_mode = umask(077);
- fd = mkstemp(localtmp);
+ fd = mkostemp(localtmp, O_RDWR|O_CREAT|O_EXCL|O_CLOEXEC);
umask(old_mode);
if (fd == -1) {
free(localtmp);