diff options
author | Eelco Dolstra <edolstra@gmail.com> | 2021-11-29 11:20:50 +0100 |
---|---|---|
committer | Eelco Dolstra <edolstra@gmail.com> | 2021-11-29 11:20:50 +0100 |
commit | 6e0cbc666b60515b5e201dd28855f5fe1de9a107 (patch) | |
tree | 3c575e934736b0e85a456b9ee4e042c89e3d969b | |
parent | e1420c66a4c76794bfe0b43425d6540bdcbe8e22 (diff) |
createTempFile(): Mark file as CLOEEXEC
Fixes #5674.
-rw-r--r-- | src/libutil/util.cc | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/src/libutil/util.cc b/src/libutil/util.cc index defb77a10..1b6467eb2 100644 --- a/src/libutil/util.cc +++ b/src/libutil/util.cc @@ -512,6 +512,7 @@ std::pair<AutoCloseFD, Path> createTempFile(const Path & prefix) AutoCloseFD fd(mkstemp((char *) tmpl.c_str())); if (!fd) throw SysError("creating temporary file '%s'", tmpl); + closeOnExec(fd.get()); return {std::move(fd), tmpl}; } |