]>
git.ipfire.org Git - thirdparty/libarchive.git/log
Adam Korczynski [Sat, 25 Apr 2020 16:19:29 +0000 (17:19 +0100)]
Moved the corpus file to the contrib dir
Adam Korczynski [Tue, 21 Apr 2020 17:23:53 +0000 (18:23 +0100)]
Added seed corpus
Martin Matuška [Thu, 16 Apr 2020 00:20:24 +0000 (02:20 +0200)]
Merge pull request #1348 from mikhailnov/rh-selinux
Support RHT.security.selinux from GNU tar
Martin Matuška [Thu, 16 Apr 2020 00:07:23 +0000 (02:07 +0200)]
Merge pull request #1359 from hjmallon/pr.neg_zstd_2
zstd: Improve version checking
Harry Mallon [Tue, 14 Apr 2020 13:37:28 +0000 (14:37 +0100)]
zstd: Improve version checking
Martin Matuška [Fri, 10 Apr 2020 00:50:53 +0000 (02:50 +0200)]
Merge pull request #1352 from hjmallon/pr.negative_zstd
zstd: Support negative compression-levels
Martin Matuška [Fri, 10 Apr 2020 00:48:24 +0000 (02:48 +0200)]
Merge pull request #1356 from robUx4/svfs-variable
Fix stavfs variable name
Harry Mallon [Wed, 11 Mar 2020 12:47:49 +0000 (12:47 +0000)]
zstd: Support negative compression-levels
Steve Lhomme [Mon, 6 Apr 2020 06:19:44 +0000 (08:19 +0200)]
consistently use svfs for statvfs variables
So it cannot be misinterpreted as a statfs which uses the sfs variable name.
Martin Matuška [Fri, 3 Apr 2020 21:32:04 +0000 (23:32 +0200)]
Merge pull request #1354 from robUx4/local-mode_t-fix
archive_entry: use the proper define for mode_t
Steve Lhomme [Fri, 27 Mar 2020 15:26:07 +0000 (16:26 +0100)]
archive_entry: use the proper define for mode_t
This is the define set in archive_entry.h to use the right mode_t type per
platform. "mode_t" may not be available at all.
This is also how these functions are declared in archive_entry.h
Martin Matuška [Sat, 28 Mar 2020 07:49:04 +0000 (08:49 +0100)]
Merge pull request #1350 from josch/master
libarchive/archive_entry_stat.3: typo nlinks -> nlink
Martin Matuška [Sat, 28 Mar 2020 07:45:36 +0000 (08:45 +0100)]
Merge pull request #1342 from hjmallon/pr.fix_high_zstd
Fixes for using zstd binary
Martin Matuska [Sat, 28 Mar 2020 07:23:28 +0000 (08:23 +0100)]
CI: build Windows version with xz 5.2.5
Johannes 'josch' Schauer [Mon, 23 Mar 2020 10:21:55 +0000 (11:21 +0100)]
libarchive/archive_entry_stat.3: typo nlinks -> nlink
Mikhail Novosyolov [Thu, 19 Mar 2020 22:13:23 +0000 (01:13 +0300)]
Support RHT.security.selinux from GNU tar
Harry Mallon [Wed, 11 Mar 2020 12:14:36 +0000 (12:14 +0000)]
zstd: Fix support for compression-level>=20 when using binary
* Requires '--ultra' argument
Harry Mallon [Wed, 11 Mar 2020 12:06:51 +0000 (12:06 +0000)]
zstd: Use --no-check with binary to match library default
Martin Matuska [Mon, 2 Mar 2020 07:55:44 +0000 (08:55 +0100)]
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.
Martin Matuska [Mon, 2 Mar 2020 01:58:57 +0000 (02:58 +0100)]
Add archive_write_disk_windows.c counterpart to previous commit
Martin Matuska [Mon, 2 Mar 2020 01:45:50 +0000 (02:45 +0100)]
Store errno when unlinking after rename on safe write failed
Martin Matuska [Mon, 2 Mar 2020 01:40:10 +0000 (02:40 +0100)]
cpio/cpio.c: Fix off-by-one in previous commit
Martin Matuska [Sun, 1 Mar 2020 23:48:47 +0000 (00:48 +0100)]
cpio/cpio.c: avoid calling strlen() for destdir twice
Martin Matuska [Sat, 29 Feb 2020 01:10:00 +0000 (02:10 +0100)]
Safe writes: delete temporary file if rename fails
Change error message to "Failed to safe write"
Fixes #1341
Martin Matuska [Fri, 28 Feb 2020 10:37:55 +0000 (11:37 +0100)]
CI: GitHub Actions: use C:\windows\system32\tar.exe as tar on Windows
Martin Matuska [Thu, 27 Feb 2020 09:42:27 +0000 (10:42 +0100)]
bsdcpio_test: from_hex() needs to be an uint32_t
Fixes #1339
Martin Matuska [Thu, 27 Feb 2020 00:54:19 +0000 (01:54 +0100)]
XAR reader: initialize file_queue with 0 and memcpy() if allocated only
Fixes #1338
Martin Matuska [Tue, 25 Feb 2020 23:09:27 +0000 (00:09 +0100)]
CI: use static CMake build of liblzma
Martin Matuska [Mon, 24 Feb 2020 22:30:20 +0000 (23:30 +0100)]
CI: various adjustments
Always bootstrap pkg on FreeBSD
Remove unnecessary dependency on libzip-dev
Remove Cirrus CI Fedora builds for now
Kamil Rytarowski [Mon, 24 Feb 2020 21:58:00 +0000 (22:58 +0100)]
archive_read.c: silence UBSan warning about undefined behavior
Fixes #1335
Martin Matuška [Sun, 23 Feb 2020 22:02:10 +0000 (23:02 +0100)]
Merge pull request #1331 from cure/patch-1
New ASCII format: fix hard link description
Ward Vandewege [Fri, 14 Feb 2020 02:56:09 +0000 (21:56 -0500)]
New ASCII format: fix hard link description
The description of how hard links are handled in the 'new ASCII format' is wrong. Cpio stores the *first*, not *last* copy of the file with its entire contents, followed by entries with filesize set to zero for each subsequent entry that is hard linked. While creating the archive, how would it ever know it was processing the last one!
Martin Matuska [Thu, 13 Feb 2020 00:23:08 +0000 (01:23 +0100)]
XAR writer: initialize size with 0 in xar_write_data()
Martin Matuska [Thu, 13 Feb 2020 00:20:18 +0000 (01:20 +0100)]
Solve warning by excluding more code to _WIN32 in file_open()
Martin Matuska [Wed, 12 Feb 2020 23:45:16 +0000 (00:45 +0100)]
Add testcase for ZIPX files with LZMA_STREAM_END marker
Testcase for issue #1257 (PR #1297)
Martin Matuska [Wed, 12 Feb 2020 13:38:45 +0000 (14:38 +0100)]
CI: add external binary static xz to Windows build
Martin Matuska [Wed, 12 Feb 2020 00:11:18 +0000 (01:11 +0100)]
Constify name in __archive_write_entry_filetype_unsupported()
Martin Matuska [Tue, 11 Feb 2020 23:09:00 +0000 (00:09 +0100)]
Libarchive 3.4.3dev
Martin Matuska [Tue, 11 Feb 2020 21:49:11 +0000 (22:49 +0100)]
Libarchive 3.4.2
Martin Matuska [Tue, 11 Feb 2020 17:40:54 +0000 (18:40 +0100)]
Add script to generate release files with Docker.
Martin Matuska [Tue, 11 Feb 2020 17:34:45 +0000 (18:34 +0100)]
Unlink before creating a hardlink on Windows
when using ARCHIVE_EXTRACT_SAFE_WRITES.
Completes #1330 for Windows.
Martin Matuška [Tue, 11 Feb 2020 17:24:37 +0000 (18:24 +0100)]
Merge pull request #1330 from zoulasc/master
Fix ARCHIVE_EXTRACT_SAFE_WRITES for existing symlinks
zoulasc [Tue, 11 Feb 2020 00:43:32 +0000 (19:43 -0500)]
Just like the hard link case, for symlinks we need to remove first
for ARCHIVE_EXTRACT_SAFE_WRITES.
Martin Matuska [Mon, 10 Feb 2020 13:46:15 +0000 (14:46 +0100)]
Update NEWS
Martin Matuska [Mon, 10 Feb 2020 13:26:17 +0000 (14:26 +0100)]
RAR5 reader: use %zu to sprintf() size_t
Martin Matuska [Sun, 9 Feb 2020 07:15:58 +0000 (08:15 +0100)]
CI Windows: download zlib and bzip2 from cloned repositories
Martin Matuska [Sat, 8 Feb 2020 22:02:53 +0000 (23:02 +0100)]
CI: generate and publish build artifacts on GitHub actions
Fixes #1313
Martin Matuska [Fri, 7 Feb 2020 13:50:37 +0000 (14:50 +0100)]
CI: build and use bzip2 on Windows from GiLab repository
Use static versions of zlib and bzip2 on Windows.
Simplify ci.cmd for GitHub Actions.
Martin Matuška [Fri, 7 Feb 2020 13:16:58 +0000 (14:16 +0100)]
Merge pull request #1329 from bradking/string-append-wcs-overflow
Fix possible heap-buffer-overflow in archive_string_append_from_wcs on Windows
Martin Matuska [Thu, 6 Feb 2020 21:52:36 +0000 (22:52 +0100)]
RAR5 reader: do not mutate a global variable
Read RAR5 signature with a function instead.
Fixes #1303
Martin Matuska [Fri, 7 Feb 2020 09:45:15 +0000 (10:45 +0100)]
CI: exit with error on failure in Visual Studio stages
Martin Matuska [Thu, 6 Feb 2020 20:44:30 +0000 (21:44 +0100)]
7z reader: support Delta filter with values 2-256
Fixes #987
Brad King [Thu, 6 Feb 2020 19:28:02 +0000 (14:28 -0500)]
Fix possible heap-buffer-overflow in archive_string_append_from_wcs on Windows
Fix `archive_string_append_from_wcs_in_codepage` to account for the
already-used portion of the buffer when computing the size of the
remaining buffer for `WideCharToMultiByte` output.
Martin Matuška [Sun, 2 Feb 2020 21:48:34 +0000 (22:48 +0100)]
Merge pull request #1326 from antekone/rar5_ossfuzz_20459
RAR5 reader: reject files that declare invalid header flags
Grzegorz Antoniak [Sun, 2 Feb 2020 07:04:41 +0000 (08:04 +0100)]
RAR5 reader: reject files that declare invalid header flags
One of the fields in RAR5's base block structure is the size of the
header. Some invalid files declare a 0 header size setting, which can
confuse the unpacker. Minimum header size for RAR5 base blocks is 7
bytes (4 bytes for CRC, and 3 bytes for the rest), so block size of 0
bytes should be rejected at header parsing stage.
The fix adds an error condition if header size of 0 bytes is detected.
In this case, the unpacker will not attempt to unpack the file, as the
header is corrupted.
The commit also adds OSSFuzz #20459 sample to test further regressions
in this area.
Martin Matuška [Sat, 1 Feb 2020 18:38:16 +0000 (19:38 +0100)]
Merge pull request #1324 from bradking/solaris-11.4
libarchive: Fix detection of 'major' on Solaris 11.4
Martin Matuska [Fri, 31 Jan 2020 23:58:03 +0000 (00:58 +0100)]
Fix use after free in ISO9660 and XAR writer
Remove rbtree nodes before freeing them.
For better code readability import new rbtree macros from NetBSD.
Fixes #1325
Martin Matuska [Thu, 30 Jan 2020 23:30:34 +0000 (00:30 +0100)]
Update filter and format options in manual pages.
The list of format and filter options in bsdtar(1) is incomplete.
Add reference to manual pages archive_write_set_options(3) and
archive_read_set_options(3) for a complete list of supported options.
Fixes #1323
Martin Matuska [Thu, 30 Jan 2020 23:29:35 +0000 (00:29 +0100)]
mtree reader: initialize checkfs with 0
Brad King [Thu, 30 Jan 2020 14:49:22 +0000 (09:49 -0500)]
libarchive: Fix detection of 'major' on Solaris 11.4
In `archive_pack_dev.c` there is code checking the `HAVE_MAJOR` macro,
but it is not computed. Port the equivalent logic from
`archive_entry.c` to define the macro.
Martin Matuska [Mon, 27 Jan 2020 23:25:53 +0000 (00:25 +0100)]
Cmake MSVC: replace warning C4061 with C4062
Fixes #1322
Martin Matuska [Sun, 26 Jan 2020 00:20:36 +0000 (01:20 +0100)]
test_write_format_xar: add "none" options to test
Martin Matuska [Sun, 26 Jan 2020 00:01:25 +0000 (01:01 +0100)]
PAX writer: fix return-on-error memory leaks in archive_write_pax_header()
Martin Matuska [Sat, 25 Jan 2020 23:35:50 +0000 (00:35 +0100)]
PAX writer: fix entry uname or gname longer than 32 characters
Fixes #1319
Martin Matuska [Sat, 25 Jan 2020 13:26:59 +0000 (14:26 +0100)]
Unify unsupported entry file type error message in writer
Closes #1320
Martin Matuska [Thu, 23 Jan 2020 15:13:19 +0000 (16:13 +0100)]
XAR writer: fix compression output buffer handling
Add "none" as acceptable value to xar:checksum and xar:toc-checksum
Document XAR options in bsdtar(1)
Fixes #1317
Martin Matuska [Wed, 22 Jan 2020 22:30:32 +0000 (23:30 +0100)]
CI: make mingw32-make verbose
zoulasc [Tue, 21 Jan 2020 18:34:18 +0000 (13:34 -0500)]
Add printf attributes to the printflike functions used in tests and fix
the format errors.
Closes #1318
Grzegorz Antoniak [Wed, 1 Jan 2020 06:29:34 +0000 (07:29 +0100)]
RAR5 reader: refactored parse_tables() a little bit
Some if/continue constructs could be changed to if/elseif/else blocks.
This allows elimination of superfluous 'continue' directives.
Closes #1280
MonkeybreadSoftware [Fri, 22 Nov 2019 11:17:37 +0000 (12:17 +0100)]
Update archive_read_support_format_rar5.c
A patch to make this compile in older Visual Studio.
Moving variable declaration up for C89 standard.
Martin Matuska [Wed, 22 Jan 2020 16:35:34 +0000 (17:35 +0100)]
CI: raise error if MinGW tests fail
Martin Matuska [Wed, 22 Jan 2020 16:13:43 +0000 (17:13 +0100)]
Fix error when overwriting files on Windows
Introduced in
467d193dd61ca7669a5ba8d38e09836babf64e58
Martin Matuska [Wed, 22 Jan 2020 15:07:12 +0000 (16:07 +0100)]
Fix 7zip_packinfo_digests test when LZMA is not supported
Martin Matuska [Wed, 22 Jan 2020 15:06:25 +0000 (16:06 +0100)]
contrib/archivetest: fix compilation under MinGW
Martin Matuska [Wed, 22 Jan 2020 14:28:08 +0000 (15:28 +0100)]
7zip reader tests: fixes when LZMA is unsupported
Martin Matuska [Mon, 20 Jan 2020 14:59:25 +0000 (15:59 +0100)]
bsdtar.1: --exclude-vcs sort version control systems and add git
Fixes #1314
Martin Matuska [Mon, 20 Jan 2020 13:23:08 +0000 (14:23 +0100)]
Add test_option_safe_writes to tar tests
Martin Matuska [Mon, 20 Jan 2020 10:41:18 +0000 (11:41 +0100)]
Implement ARCHIVE_EXTRACT_SAFE_WRITES on Windows
As Windows does not support atomic rename/_wrename
we have to unlink the file right before calling _wrename
leaving a short unsafe window where a different file with the
same name can be created and make the rename operation fail.
zoulasc [Mon, 20 Jan 2020 12:20:42 +0000 (13:20 +0100)]
Introduce archive_write_disk(3) flag ARCHIVE_EXTRACT_SAFE_WRITES
This flag changes the way that regular files are extracted:
Instead of removing existing files first and re-creating them in
order to replace their contents, a temporary file is created and
when writing to the temporary file is completed, the file is
rename(2)d to the final destination name.
This has the effect of presenting a consistent view of the file to
the system (either the file with the new contents or the file with
the old contents). Removing and overwriting the file has the
undesired side effect that the the system can either not see the
file at all (from the time it is being removed till the time it is
being re-created), or worse it can see partial file contents. This
is problematic when extracting system files (for example shared
libraries).
If the existing file that is going to be overwritten is a hard link,
for now we unlink it before calling rename(2). This can be done
correctly by creating a hardlink to a tmpnam(3) generated file
and then use rename(2), but that is fairly intrusive and requires
refactoring.
Fixes #1289
Martin Matuska [Sat, 18 Jan 2020 00:18:43 +0000 (01:18 +0100)]
RAR5 reader: fix unsafe sign check of a bitwise operation.
This has no but code correctness effect as cdeque_init() is static
and max_capacity_power_of_2 in our code is always 8192.
Found by LGTM.com code analysis
Martin Matuska [Thu, 16 Jan 2020 23:31:07 +0000 (00:31 +0100)]
archive_read.c: remove unnecessary comparsion (iindex is unsigned int)
Found by LGTM.com code analysis
Martin Matuška [Thu, 16 Jan 2020 21:10:04 +0000 (22:10 +0100)]
Merge pull request #1316 from zoulasc/tests
Various test improvements
zoulasc [Thu, 16 Jan 2020 20:34:32 +0000 (15:34 -0500)]
ANSI-C prototypes
zoulasc [Thu, 16 Jan 2020 20:34:16 +0000 (15:34 -0500)]
Add missing const
zoulasc [Thu, 16 Jan 2020 20:33:58 +0000 (15:33 -0500)]
Add missing const
zoulasc [Thu, 16 Jan 2020 20:33:39 +0000 (15:33 -0500)]
Add missing const
zoulasc [Thu, 16 Jan 2020 20:29:57 +0000 (15:29 -0500)]
- Add the NetBSD-specific config.h
- Use --help instead of -V when -V exits with non-zero code
- Double the string size to prevent truncation
Martin Matuska [Thu, 16 Jan 2020 15:13:40 +0000 (16:13 +0100)]
RAR5 and WARC readers: move unnecessary comparsion into a comment
RAR5 reader: comment out unreachable code
Found by LGTM.com code analysis
Martin Matuska [Tue, 14 Jan 2020 15:35:31 +0000 (16:35 +0100)]
archive_ppmd7.c: avoid possible integer overflow (security)
Found by LGTM.com code analysis
Martin Matuska [Tue, 14 Jan 2020 13:40:11 +0000 (14:40 +0100)]
Multiple code fixes and optimizations
archive_read_support_format_rar5.c:
Bitfield int -> signed int
Archive_write_set_format_iso9660.c:
Bitfield int -> signed int
archive_write_set_format_xar.c:
Bitfield int -> signed int
archive_write_set_format_7zip.c:
Bitfield int -> signed int
archive_read_support_format_xar.c
Remove useless comparsion
archive_read_support_format_rar.c:
Fix invalid nested loop break.
Comment out dead code sections.
Simplify size comparsions of lensymbol and offsymbol.
archive_read_support_filter_uu.c:
Remove useless comparsions
archive_read_disk_posix.c:
Remove useless do-while-zero
Found by LGTM.com code analysis
Martin Matuska [Mon, 13 Jan 2020 13:23:00 +0000 (14:23 +0100)]
Windows: use _localtime64_s and _gmtime64_s where appropriate
Martin Matuska [Mon, 13 Jan 2020 12:28:26 +0000 (13:28 +0100)]
Unify header style, header guard comes first
Found by LGTM.com code analysis
Martin Matuska [Mon, 13 Jan 2020 11:37:32 +0000 (12:37 +0100)]
Use localtime_r and gmtime_r if supported
Found by LGTM.com code analysis
Martin Matuska [Sun, 12 Jan 2020 07:52:33 +0000 (08:52 +0100)]
Fix erroneous use of archive_string_empty() macro
Found by LGTM.com code analysis
Martin Matuska [Thu, 9 Jan 2020 11:36:59 +0000 (12:36 +0100)]
LHA reader UTF16: dirSep must match machine endianess
Martin Matuska [Thu, 9 Jan 2020 09:51:34 +0000 (10:51 +0100)]
LHA reader UTF-16: Encode directory separator with archive_le16enc()
Wrap to 80 characters.
Fixes #1307
Martin Matuška [Tue, 7 Jan 2020 20:20:23 +0000 (21:20 +0100)]
Merge pull request #1308 from Claybird/fix_lha_endian
Fixed endian problem in lha UTF-16 encoding.
Fixes #1307
Claybird [Tue, 7 Jan 2020 13:07:52 +0000 (22:07 +0900)]
Fixed endian problem in lha UTF-16 encoding.
A patch to fix #1307
Martin Matuska [Mon, 6 Jan 2020 02:08:17 +0000 (03:08 +0100)]
Redo fix for #1302 in a way that archive_write_client_open()
correctly frees its allocations in an error case.
Reverts
5e270715b51d199467195b56f77e21cb8bb1d642
Martin Matuska [Sun, 5 Jan 2020 02:09:34 +0000 (03:09 +0100)]
Minor style newline consistency fixes