diff options
| author | Martin Matuska <mm@FreeBSD.org> | 2020-12-01 10:36:46 +0000 |
|---|---|---|
| committer | Martin Matuska <mm@FreeBSD.org> | 2020-12-01 10:36:46 +0000 |
| commit | d5f2a5ff11474589cccacfc8e153d437f48530e2 (patch) | |
| tree | aeb7e201bfb2d629755c396db8001e39d116e852 /libarchive/archive_util.c | |
| parent | 4dd2ae60c22045bc4e4f53a0cf45028322168ec0 (diff) | |
Diffstat (limited to 'libarchive/archive_util.c')
| -rw-r--r-- | libarchive/archive_util.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/libarchive/archive_util.c b/libarchive/archive_util.c index c76ecc5b05b1..b1582edbe308 100644 --- a/libarchive/archive_util.c +++ b/libarchive/archive_util.c @@ -433,6 +433,11 @@ __archive_mktemp(const char *tmpdir) if (temp_name.s[temp_name.length-1] != '/') archive_strappend_char(&temp_name, '/'); } +#ifdef O_TMPFILE + fd = open(temp_name.s, O_RDWR|O_CLOEXEC|O_TMPFILE|O_EXCL, 0600); + if(fd >= 0) + goto exit_tmpfile; +#endif archive_strcat(&temp_name, "libarchive_XXXXXX"); fd = mkstemp(temp_name.s); if (fd < 0) |
