summaryrefslogtreecommitdiff
path: root/Makefile.am
diff options
context:
space:
mode:
authorOwen W. Taylor <otaylor@fishsoup.net>2021-05-12 16:26:24 -0400
committerOwen W. Taylor <otaylor@fishsoup.net>2021-05-14 10:13:40 -0400
commit3bc9bfc04e000f476a0634f18d640d9e9407e021 (patch)
tree31b5919a923ac9c313a4988647abbbc439d2094c /Makefile.am
parent942cd1a5e1ce4e1450cecafa2674f71aea0263a4 (diff)
downloadlibarchive-3bc9bfc04e000f476a0634f18d640d9e9407e021.tar.gz
On close, handle short writes from archive_write_callback
The archive_write_callback passed to archive_write_open() is documented as: "each call to the write callback function should translate to a single write(2) system call. On success, the write callback should return the number of bytes actually written" And in most places, the code repeatedly calls the write callback, but when flushing the buffer at close, the write callback was called once, assuming it would write everything. This could result in a truncated archive. A test is added to test short writes in different code paths.
Diffstat (limited to 'Makefile.am')
-rw-r--r--Makefile.am1
1 files changed, 1 insertions, 0 deletions
diff --git a/Makefile.am b/Makefile.am
index 1ead2813..e259a33b 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -550,6 +550,7 @@ libarchive_test_SOURCES= \
libarchive/test/test_read_too_many_filters.c \
libarchive/test/test_read_truncated.c \
libarchive/test/test_read_truncated_filter.c \
+ libarchive/test/test_short_writes.c \
libarchive/test/test_sparse_basic.c \
libarchive/test/test_tar_filenames.c \
libarchive/test/test_tar_large.c \