summaryrefslogtreecommitdiff
path: root/libarchive/archive_util.c
diff options
context:
space:
mode:
authorMartin Matuska <martin@matuska.org>2020-03-02 08:55:44 +0100
committerMartin Matuska <martin@matuska.org>2020-03-02 09:00:00 +0100
commitf001f3b0e6a66a7eb989ed3783791c0316831202 (patch)
treefe9e1f43b1d58daabe5255a8b37467d1885c74c8 /libarchive/archive_util.c
parent85b9f665b6a2d4397fdd38992152d011265e374b (diff)
downloadlibarchive-f001f3b0e6a66a7eb989ed3783791c0316831202.tar.gz
Safe writes: improve error handling
Print message if creation of temporary file fails. When rename of temporary file fails, exit with ARCHIVE_FAILED. Reword message on failed rename. Revert d84ec3f and 85b9f66, call archive_set_error()w before unlinking.
Diffstat (limited to 'libarchive/archive_util.c')
-rw-r--r--libarchive/archive_util.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/libarchive/archive_util.c b/libarchive/archive_util.c
index 288a4428..c76ecc5b 100644
--- a/libarchive/archive_util.c
+++ b/libarchive/archive_util.c
@@ -365,6 +365,7 @@ __archive_mktempx(const char *tmpdir, wchar_t *template)
}
fd = _open_osfhandle((intptr_t)h, _O_BINARY | _O_RDWR);
if (fd == -1) {
+ la_dosmaperr(GetLastError());
CloseHandle(h);
goto exit_tmpfile;
} else