]> git.ipfire.org Git - thirdparty/libarchive.git/log
thirdparty/libarchive.git
4 years agoLibarchive 3.4.1 v3.4.1
Martin Matuska [Mon, 30 Dec 2019 01:12:32 +0000 (02:12 +0100)] 
Libarchive 3.4.1

4 years agoFix possible off-by-one when dealing with readlink(2)
Pawel Jakub Dawidek [Sun, 22 Dec 2019 00:10:38 +0000 (01:10 +0100)] 
Fix possible off-by-one when dealing with readlink(2)

readlink(2) and readlinkat(2) don't append a null byte to the given buffer.

4 years agoFix a possible heap-buffer-overflow in archive_string_append_from_wcs()
Martin Matuska [Sat, 28 Dec 2019 21:58:08 +0000 (22:58 +0100)] 
Fix a possible heap-buffer-overflow in archive_string_append_from_wcs()

When we grow the archive_string buffer, we have to make sure it fits
at least one maximum-sized multibyte character in the current locale
and the null character.

Fixes #1298

4 years agoMerge pull request #1297 from antekone/bug/GH-1257
Martin Matuška [Sat, 28 Dec 2019 15:31:23 +0000 (16:31 +0100)] 
Merge pull request #1297 from antekone/bug/GH-1257

ZIP reader: support LZMA_STREAM_END marker in 'lzma alone' files

4 years agoZIP reader: support LZMA_STREAM_END marker in 'lzma alone' files 1297/head
Grzegorz Antoniak [Mon, 23 Dec 2019 07:20:28 +0000 (08:20 +0100)] 
ZIP reader: support LZMA_STREAM_END marker in 'lzma alone' files

It appears that ZIPX files with type 14 stream ('lzma alone') can
contain LZMA_STREAM_END markers at the end of the stream. The ZIP reader
was displaying an "unknown error 1" status after encountering such
marker.

The fix handles such case, and the reader doesn't return error status
anymore. Thus it should be possible to unpack files that contain the
LZMA_STREAM_END marker at the end of the stream.

Fixes #1257

4 years agoAdd test for reading 7z archives with Digests in PackInfo
Martin Matuska [Sat, 21 Dec 2019 22:10:37 +0000 (23:10 +0100)] 
Add test for reading 7z archives with Digests in PackInfo

Fixes #1295

4 years ago7z: PackInfo Digests are prefixed by kCRC, not kSize
cielavenir [Thu, 19 Dec 2019 04:10:04 +0000 (13:10 +0900)] 
7z: PackInfo Digests are prefixed by kCRC, not kSize

4 years agoMerge pull request #1296 from antekone/rar5_ossfuzz_19509
Martin Matuška [Sat, 21 Dec 2019 21:19:29 +0000 (22:19 +0100)] 
Merge pull request #1296 from antekone/rar5_ossfuzz_19509

RAR5 reader: verify window size for multivolume archives

4 years agoRAR5 reader: verify window size for multivolume archives 1296/head
Grzegorz Antoniak [Wed, 18 Dec 2019 18:28:12 +0000 (19:28 +0100)] 
RAR5 reader: verify window size for multivolume archives

RAR5 archives can contain files that span across multiple .rar files. If the
archive contains a big file that doesn't fit to first .rar file, then this file
is continued in another .rar file.

In this case, the RAR compressor first emits the FILE base block for this big
file in the first .rar file. Then, it finishes first .rar file, and creates the
new .rar file. In this new file, it emits the continuation FILE block that
marks start of the continuation data for the rest of the huge file.

The problem was that the RAR5 reader didn't ignore the window size declaration
when parsing through the continuation FILE base block. The malicious file could
declare a different window size inside the continuation base block than was
declared in the primary FILE base block in the previous volume. The window size
from continuation block was applied, but the actual window buffer was not
reallocated. This resulted in a potential SIGSEGV error, since bounary checks
for accessing the window buffer were working incorrectly (the window size
variable didn't match the actual window buffer size).

The commit fixes the issue by ignoring the window size declaration in the
continuation FILE base block when switching volumes.

The commit also contains a test case and OSSFuzz sample #19509.

4 years agoMerge pull request #1288 from mmatuska/configurable_xattr_headers
Martin Matuška [Sun, 15 Dec 2019 00:45:12 +0000 (01:45 +0100)] 
Merge pull request #1288 from mmatuska/configurable_xattr_headers

Add the "xattrhdr" option to pax write options.

4 years agoCI: upgrade FreeBSD Cirrus CI images to 12.1 and 11.3
Martin Matuska [Sat, 14 Dec 2019 23:20:51 +0000 (00:20 +0100)] 
CI: upgrade FreeBSD Cirrus CI images to 12.1 and 11.3

4 years agoLHA reader: plug two memory leaks on error
Martin Matuska [Sat, 14 Dec 2019 23:05:40 +0000 (00:05 +0100)] 
LHA reader: plug two memory leaks on error

Reported by: OSS-Fuzz issue 19360, 19362

4 years agoAdd the "xattrhdr" option to pax write options. 1288/head
Martin Matuska [Tue, 3 Dec 2019 00:09:42 +0000 (01:09 +0100)] 
Add the "xattrhdr" option to pax write options.

This allows us to control whether "SCHILY.xattr", "LIBARCHIVE.xattr" or
both headers (default) are written when storing extended attributes.

Document "hdrcharset" option for pax.

4 years agoImplement private state logic for write filters 1287/head
Martin Matuska [Fri, 6 Dec 2019 10:25:19 +0000 (11:25 +0100)] 
Implement private state logic for write filters

This ensures that filters may be opened and closed only once and
__archive_write_filter() may be called only on an open filter.

Refactor filter open code and move logic to archive_write.c

Fixes #351

4 years agoRemove remnants of archive_entry_acl_next_w
Joerg Sonnenberger [Sat, 30 Nov 2019 04:15:27 +0000 (05:15 +0100)] 
Remove remnants of archive_entry_acl_next_w

4 years agoRemove unused variables
Joerg Sonnenberger [Wed, 27 Nov 2019 21:15:11 +0000 (22:15 +0100)] 
Remove unused variables

4 years agoRemove unused variable
Joerg Sonnenberger [Wed, 27 Nov 2019 21:13:21 +0000 (22:13 +0100)] 
Remove unused variable

4 years agoWhen the initial archive open for write fails, explicitly free filters.
Joerg Sonnenberger [Sat, 19 Oct 2019 15:15:05 +0000 (17:15 +0200)] 
When the initial archive open for write fails, explicitly free filters.

This provides a defense-in-depth against programming errors due to the
partial state. Based on a report from Airbus Security - Vulnerability
Management.

4 years agoRefactor archive_write_close_filter logic
Joerg Sonnenberger [Sat, 19 Oct 2019 15:09:11 +0000 (17:09 +0200)] 
Refactor archive_write_close_filter logic

4 years agoarchive_write_filter_compress: free state in free handler
Joerg Sonnenberger [Sat, 19 Oct 2019 14:59:51 +0000 (16:59 +0200)] 
archive_write_filter_compress: free state in free handler

4 years agoLHA reader: ensure that UTF-16 input always has a multiple of 2 bytes
Martin Matuska [Tue, 26 Nov 2019 22:32:31 +0000 (23:32 +0100)] 
LHA reader: ensure that UTF-16 input always has a multiple of 2 bytes

Fixes #1284

4 years agoMerge pull request #1282 from kwojcicki/master
Tim Kientzle [Mon, 25 Nov 2019 22:22:22 +0000 (14:22 -0800)] 
Merge pull request #1282 from kwojcicki/master

Fixing resource cleanup in minitar

4 years agoFixing resource cleanup in minitar 1282/head
Krystian Wojcicki [Sat, 23 Nov 2019 03:42:43 +0000 (22:42 -0500)] 
Fixing resource cleanup in minitar

4 years agoCI: remove Fedora 30 distcheck at Cirrus CI
Martin Matuska [Thu, 21 Nov 2019 22:33:40 +0000 (23:33 +0100)] 
CI: remove Fedora 30 distcheck at Cirrus CI

4 years agoBugfix and optimize archive_wstring_append_from_mbs()
Martin Matuska [Thu, 21 Nov 2019 02:08:40 +0000 (03:08 +0100)] 
Bugfix and optimize archive_wstring_append_from_mbs()

The cal to mbrtowc() or mbtowc() should read up to mbs_length
bytes and not wcs_length. This avoids out-of-bounds reads.

mbrtowc() and mbtowc() return (size_t)-1 wit errno EILSEQ when
they encounter an invalid multibyte character and (size_t)-2 when
they they encounter an incomplete multibyte character. As we return
failure and all our callers error out it makes no sense to continue
parsing mbs.

As we allocate `len` wchars at the beginning and each wchar has
at least one byte, there will never be need to grow the buffer,
so the code can be left out. On the other hand, we are always
allocatng more memory than we need.

As long as wcs_length == mbs_length == len we can omit wcs_length.
We keep the old code commented if we decide to save memory and
use autoexpanding wcs_length in the future.

Fixes #1276

4 years agoHave "make dist" create .tar.gz, .tar.xz and .zip distribution files
Martin Matuska [Wed, 20 Nov 2019 00:42:22 +0000 (01:42 +0100)] 
Have "make dist" create .tar.gz, .tar.xz and .zip distribution files

Fixes #1277

4 years agoWhen opening directories, use O_EXEC flag only on FreeBSD
Martin Matuska [Tue, 19 Nov 2019 15:50:27 +0000 (16:50 +0100)] 
When opening directories, use O_EXEC flag only on FreeBSD

Fixes #1279

4 years agoCI: add distcheck and MacOS build to github actions
Martin Matuska [Mon, 18 Nov 2019 07:12:58 +0000 (08:12 +0100)] 
CI: add distcheck and MacOS build to github actions

4 years agoCI: move Windows MinGW and MSVC builds to GitHub Actions
Martin Matuska [Mon, 18 Nov 2019 01:11:03 +0000 (02:11 +0100)] 
CI: move Windows MinGW and MSVC builds to GitHub Actions

4 years agotest_open_fd: skip error test on GitHub Actions
Martin Matuska [Sun, 17 Nov 2019 23:11:37 +0000 (00:11 +0100)] 
test_open_fd: skip error test on GitHub Actions

4 years agotest_read_format_lha_filename_utf16.c: pass copyright with permission
Martin Matuska [Sun, 17 Nov 2019 23:00:54 +0000 (00:00 +0100)] 
test_read_format_lha_filename_utf16.c: pass copyright with permission

4 years agotest_read_format_lha_filename_utf16.c: add missing condition
Martin Matuska [Sun, 17 Nov 2019 21:57:24 +0000 (22:57 +0100)] 
test_read_format_lha_filename_utf16.c: add missing condition

4 years agoAdd missing testfile to Makefile.am
Martin Matuska [Sun, 17 Nov 2019 21:32:55 +0000 (22:32 +0100)] 
Add missing testfile to Makefile.am

4 years agoMerge pull request #1263 from Claybird/add_unicode_support_on_lha
Martin Matuška [Sun, 17 Nov 2019 21:09:11 +0000 (22:09 +0100)] 
Merge pull request #1263 from Claybird/add_unicode_support_on_lha

Adds UNICODE filename support for reading lha/lzh format

4 years agoFixed bugs in cases that dirname and fname have different codepages. 1263/head
Claybird [Thu, 7 Nov 2019 14:34:29 +0000 (23:34 +0900)] 
Fixed bugs in cases that dirname and fname have different codepages.

4 years agoUpdated test case.
Claybird [Thu, 7 Nov 2019 14:32:53 +0000 (23:32 +0900)] 
Updated test case.

This is to cover cases where dirname and filename have different codepages.

4 years agoFixed unicode escapes in NFD test case.
Claybird [Mon, 4 Nov 2019 08:05:43 +0000 (17:05 +0900)] 
Fixed unicode escapes in NFD test case.

4 years agoFixed test case to support NFD normalization
Claybird [Mon, 4 Nov 2019 07:21:01 +0000 (16:21 +0900)] 
Fixed test case to support NFD normalization

4 years agoAdded a test case on lha with UTF-16 filenames.
Claybird [Mon, 4 Nov 2019 06:01:26 +0000 (15:01 +0900)] 
Added a test case on lha with UTF-16 filenames.

4 years agoFixed broken UTF-16 support on *nix systems.
Claybird [Mon, 4 Nov 2019 05:58:37 +0000 (14:58 +0900)] 
Fixed broken UTF-16 support on *nix systems.

In the broken code, wchar_t was incorrectly assumed to be 16-bit.
This was not a portable way.

Fixed code uses archive_string and codepage information, instead of using archive_wstring.

4 years agoFixed memory leaks
Claybird [Wed, 16 Oct 2019 11:39:42 +0000 (20:39 +0900)] 
Fixed memory leaks

4 years agoThis adds UNICODE filename support for lha.
Claybird [Mon, 14 Oct 2019 13:32:54 +0000 (22:32 +0900)] 
This adds UNICODE filename support for lha.

The lastest lha format supports UNICODE filenames on its content, using extended headers(EXT_UTF16_FILENAME and EXT_UTF16_DIRECTORY).
However, currently libarchive ignores them.
This modification is to handle these extensions.

4 years agoMerge pull request #1260 from danielverkamp/sparse-32bit-overflow
Martin Matuška [Mon, 7 Oct 2019 13:05:53 +0000 (15:05 +0200)] 
Merge pull request #1260 from danielverkamp/sparse-32bit-overflow

Fix sparse file offset overflow on 32-bit systems

4 years agoMerge pull request #1253 from antekone/bug/uninitialized_variable_warnings
Martin Matuška [Mon, 7 Oct 2019 13:02:26 +0000 (15:02 +0200)] 
Merge pull request #1253 from antekone/bug/uninitialized_variable_warnings

RAR5 reader: remove compilation warnings ('uninitialized variable')

4 years agoMerge pull request #1252 from antekone/bug/recheck_solid_window_size2
Martin Matuška [Mon, 7 Oct 2019 13:01:48 +0000 (15:01 +0200)] 
Merge pull request #1252 from antekone/bug/recheck_solid_window_size2

RAR5 reader: verify window size for solid files

4 years agoFix sparse file offset overflow on 32-bit systems 1260/head
Daniel Verkamp [Fri, 4 Oct 2019 19:31:32 +0000 (12:31 -0700)] 
Fix sparse file offset overflow on 32-bit systems

On architectures where ssize_t is 32 bits but file offsets are 64 bits
(such as 32-bit Linux with _FILE_OFFSET_BITS=64), the POSIX disk reader
would incorrectly skip large sparse regions due to a 32-bit integer
overflow in _archive_read_data_block().  This can result in the reader
failing with "Encountered out-of-order sparse blocks", since the
overflowed value is interpreted as a signed number and added to the
current offset.

The bytes variable was used to store the difference between two 64-bit
integers, but bytes is a ssize_t.  Since this value of bytes was not
used after the block handling sparse offsets (it is always overwritten
in the block below), replace it with an int64_t sparse_bytes variable
that can always represent the difference without truncation.

Signed-off-by: Daniel Verkamp <dverkamp@chromium.org>
4 years agoLimit #pragma GCC to GCC-compatible cmopilers
Joerg Sonnenberger [Thu, 3 Oct 2019 17:32:44 +0000 (19:32 +0200)] 
Limit #pragma GCC to GCC-compatible cmopilers

4 years agozip writer: don't append unused NUL for directories
Joerg Sonnenberger [Wed, 2 Oct 2019 10:21:20 +0000 (12:21 +0200)] 
zip writer: don't append unused NUL for directories

This can result in a heap overflow dependening on the buffer allocation.
Simplify the path length calculation and avoid binary operands.

Based on PR #1255 from Will Wagner

4 years agoRAR5 reader: verify window size for solid files 1252/head
Grzegorz Antoniak [Fri, 27 Sep 2019 05:38:58 +0000 (07:38 +0200)] 
RAR5 reader: verify window size for solid files

RAR5 archives can contain files compressed independently of each other,
and files that share a common window buffer, so files which are
compressed using 'solid' method. In the latter case, all files
are required to use the same window buffer, so window size should also
be the same.

OSSFuzz sample #15482 declares a different window size for multiple
solid files. RAR5 reader doesn't reallocate window buffer when
decompressing solid files, so it was possible to perform an
out-of-bounds read by declaring two solid files, where the second solid
file declared the window size parameter that was bigger than window size
used in first solid file.

This commit introduces additional checks to ensure all solid files are
using the same window size.

The commit also adds a test case using OSSFuzz sample #15482 to hunt
down regressions in the future.

Some other test cases had to be adjusted as well, because other OSSFuzz
samples were also declaring different window sizes for solid files. So
this commit has changed the error reporting for those invalid sample files.

4 years agoRAR5 reader: remove compilation warnings ('uninitialized variable') 1253/head
Grzegorz Antoniak [Fri, 27 Sep 2019 05:48:21 +0000 (07:48 +0200)] 
RAR5 reader: remove compilation warnings ('uninitialized variable')

This commit makes the compiler happy by removing some uninitialized
variable warnings/errors in RAR5 reader.

4 years agoMerge pull request #1250 from ischwarze/ischwarze-mdoc
Martin Matuška [Tue, 24 Sep 2019 20:26:09 +0000 (22:26 +0200)] 
Merge pull request #1250 from ischwarze/ischwarze-mdoc

Minor corrections to the formatting of manual pages

4 years agoMinor corrections to the formatting of manual page. 1250/head
Ingo Schwarze [Fri, 13 Sep 2019 17:55:05 +0000 (19:55 +0200)] 
Minor corrections to the formatting of manual page.

Found with mandoc -Tlint; fixing the following messages:

WARNING: bad NAME section content
WARNING: missing comma before name
WARNING: new sentence, new line
WARNING: parenthesis in function name
WARNING: skipping no-space macro
WARNING: skipping paragraph macro
WARNING: unusual Xr order
WARNING: unusual Xr punctuation
STYLE: no blank before trailing delimiter
STYLE: possible typo in section name
STYLE: trailing delimiter
STYLE: whitespace at end of input line

For the meaning of the messages, see:
https://man.openbsd.org/mandoc#DIAGNOSTICS

4 years agoMerge pull request #1249 from ppentchev/roam-typos 1247/head
Martin Matuška [Sat, 21 Sep 2019 06:59:17 +0000 (08:59 +0200)] 
Merge pull request #1249 from ppentchev/roam-typos

Correct some typographical and grammatical errors.

4 years agoCorrect some typographical and grammatical errors. 1249/head
Peter Pentchev [Fri, 20 Sep 2019 22:33:19 +0000 (01:33 +0300)] 
Correct some typographical and grammatical errors.

4 years agoGithub Actions: update to matrix build with autotools and cmake
Martin Matuska [Tue, 10 Sep 2019 15:15:47 +0000 (17:15 +0200)] 
Github Actions: update to matrix build with autotools and cmake

4 years agoGithub Actions: add Ubuntu build
Martin Matuska [Tue, 10 Sep 2019 14:44:29 +0000 (16:44 +0200)] 
Github Actions: add Ubuntu build

4 years agoarchive_read_support_filter_lz4.c: use uint32_c for compressed
Martin Matuska [Tue, 3 Sep 2019 21:47:50 +0000 (23:47 +0200)] 
archive_read_support_filter_lz4.c: use uint32_c for compressed

Fixes #1237

4 years agotest_write_filter_zstd.c revert compression level to 7 (unbreaks zstd 1.3.x)
Martin Matuska [Tue, 3 Sep 2019 21:15:23 +0000 (23:15 +0200)] 
test_write_filter_zstd.c revert compression level to 7 (unbreaks zstd 1.3.x)

4 years agoMerge pull request #1230 from MaximeLM/clang_inttypes
Martin Matuška [Tue, 3 Sep 2019 20:25:06 +0000 (22:25 +0200)] 
Merge pull request #1230 from MaximeLM/clang_inttypes

Don't include inttypes if compiling for Mac/iOS

4 years agoMerge pull request #1221 from jrmarino/master
Martin Matuška [Tue, 3 Sep 2019 20:21:34 +0000 (22:21 +0200)] 
Merge pull request #1221 from jrmarino/master

Fix two tests when ZIP compression unsupported

4 years agoMerge pull request #1240 from ferdnyc/zstd-test-range
Martin Matuška [Tue, 3 Sep 2019 20:19:22 +0000 (22:19 +0200)] 
Merge pull request #1240 from ferdnyc/zstd-test-range

test_write_filter_zstd: Compare output sizes across wider range

4 years agotest_write_filter_zstd: size @ lvl=20 < default < lvl=1 1240/head
FeRD (Frank Dana) [Sun, 1 Sep 2019 06:46:55 +0000 (02:46 -0400)] 
test_write_filter_zstd: size @ lvl=20 < default < lvl=1

Raise compression on the second test to level=20, and perform a
third at level=1. Expect the output archive sizes to line up
based on compression level. Reduces test susceptibility to small
output size variations from different libzstd releases.

4 years agoCorrect invalid function call in la_opendirat()
Martin Matuska [Sun, 1 Sep 2019 08:48:33 +0000 (10:48 +0200)] 
Correct invalid function call in la_opendirat()

Fixes #1239

4 years agoDon't include inttypes if compiling for Mac/iOS 1230/head
Maxime Le Moine [Fri, 26 Jul 2019 21:05:13 +0000 (23:05 +0200)] 
Don't include inttypes if compiling for Mac/iOS

4 years agoAs there is no 11.3 FreeBSD image at Cirrus CI yet, revert to 11.2
Martin Matuska [Mon, 12 Aug 2019 10:35:44 +0000 (12:35 +0200)] 
As there is no 11.3 FreeBSD image at Cirrus CI yet, revert to 11.2

4 years agoCirrus CI: set CFLAGS and LDFLAGS for FreeBSD
Martin Matuska [Sun, 11 Aug 2019 22:20:31 +0000 (00:20 +0200)] 
Cirrus CI: set CFLAGS and LDFLAGS for FreeBSD

4 years agotest_write_filter_zstd: set compression level to 7
Martin Matuska [Sun, 11 Aug 2019 22:14:00 +0000 (00:14 +0200)] 
test_write_filter_zstd: set compression level to 7

Fixes #1226

4 years agoUpdate option documentation for 7zip and zip options.
Joerg Sonnenberger [Sat, 27 Jul 2019 21:18:57 +0000 (23:18 +0200)] 
Update option documentation for 7zip and zip options.

4 years agoFix two tests when ZIP compression unsupported 1221/head
John Marino [Sat, 6 Jul 2019 16:17:31 +0000 (11:17 -0500)] 
Fix two tests when ZIP compression unsupported

4 years agoUnbreak compilation without zlib
Martin Matuska [Fri, 28 Jun 2019 22:20:58 +0000 (00:20 +0200)] 
Unbreak compilation without zlib

Fixes #1214

4 years agoMerge pull request #1218 from dtor/fix-sparse-read
Martin Matuška [Thu, 27 Jun 2019 13:13:47 +0000 (15:13 +0200)] 
Merge pull request #1218 from dtor/fix-sparse-read

Fixes to handling sparse files

4 years agoMerge pull request #1217 from antekone/rar5_arm_filter_on_window_boundary
Martin Matuška [Thu, 27 Jun 2019 13:07:35 +0000 (15:07 +0200)] 
Merge pull request #1217 from antekone/rar5_arm_filter_on_window_boundary

RAR5 reader: fix ARM filter going beyond window buffer boundary

4 years agoarchive_read_next_header2: clean old entry data 1218/head
Dmitry Torokhov [Tue, 25 Jun 2019 22:17:52 +0000 (15:17 -0700)] 
archive_read_next_header2: clean old entry data

We need to clean old entry data in archive_read_next_header2 in Windows
and Posix disk readers to ensure consistent results. One possible
failure mode: sparse data from the previous entry is carried over to
next non-sparse file entry, causing it to be mishandled.

4 years agoarchive_read: fix handling of sparse files
Dmitry Torokhov [Tue, 25 Jun 2019 17:09:44 +0000 (10:09 -0700)] 
archive_read: fix handling of sparse files

If a file ends with a sparse "hole" that is larger than buffer supplied
to archive_read(), then archive_read() will return prematurely because
archive_read_data_block() will return ARHCIVE_EOF as there is no more
"real" data. We can fix that by not trying to refill data buffer until
we exhaust the hole range.

Fixes libarchive#1194

4 years agoRAR5 reader: fix ARM filter going beyond window buffer boundary 1217/head
Grzegorz Antoniak [Mon, 24 Jun 2019 05:07:02 +0000 (07:07 +0200)] 
RAR5 reader: fix ARM filter going beyond window buffer boundary

RAR5 uses filters in order to mutate data just before compression, to
achieve a better compression ratio. After decompression, this mutation
needs to be reversed by processing various filters that the compressor
uses.

One of such filters is an ARM executable file filter, which changes some
bytes in the input stream if the stream is recognized as an executable
file with ARM native code.

This commit fixes the situation when the decompressor using an ARM filter
was referencing a byte outside current window buffer. Such action is
invalid and can produce segmentation faults.

This commit also adds a test using OSSFuzz sample #15431.

4 years agoCI: upgrade Fedora from 29 to 30, remove unmaintained MacOS High Sierra
Martin Matuska [Mon, 17 Jun 2019 13:19:53 +0000 (15:19 +0200)] 
CI: upgrade Fedora from 29 to 30, remove unmaintained MacOS High Sierra

4 years agoMerge pull request #1212 from antekone/rar5_different_window_size
Martin Matuska [Mon, 17 Jun 2019 10:27:09 +0000 (12:27 +0200)] 
Merge pull request #1212 from antekone/rar5_different_window_size

RAR5 reader: window_mask was not updated correctly

4 years agoAdd test_read_format_rar5_different_window_size.rar.uu to Makefile.am
Martin Matuska [Mon, 17 Jun 2019 10:26:38 +0000 (12:26 +0200)] 
Add test_read_format_rar5_different_window_size.rar.uu to Makefile.am

4 years agoRAR5 reader: window_mask was not updated correctly 1212/head
Grzegorz Antoniak [Sun, 16 Jun 2019 07:49:05 +0000 (09:49 +0200)] 
RAR5 reader: window_mask was not updated correctly

The `window_mask` variable should be always in sync with the
`window_size` variable.

The commit fixes a bug in which there was one place that `window_size`
was modified, but `window_mask` wasn't updated. This was leading to a
SIGSEGV error, because by having wrong `window_mask`, RAR5 reader was
accessing the memory outsize current window buffer.

The commit also adds a test for this issue, together with OSSFuzz
sample #15278.

4 years agoAdd EOF test to test_read_format_rar_ppmd_use_after_free
Martin Matuska [Sat, 15 Jun 2019 21:00:51 +0000 (23:00 +0200)] 
Add EOF test to test_read_format_rar_ppmd_use_after_free
and test_read_format_rar_ppmd_use_after_free2

4 years agoRAR reader: extend fix user after free
Martin Matuska [Sat, 15 Jun 2019 20:32:35 +0000 (22:32 +0200)] 
RAR reader: extend fix user after free

If read_data_compressed() returns ARCHIVE_FAILED, the caller is allowed
to continue with next archive headers. In addition to
rar->start_new_table=1 we need to set rar->ppmd_valid=0.

Reported by: OSS-Fuzz issue 15120

4 years agoAdd HAVE_UNLINKAT to libarchive/config_freebsd.h
Martin Matuska [Tue, 11 Jun 2019 23:53:31 +0000 (01:53 +0200)] 
Add HAVE_UNLINKAT to libarchive/config_freebsd.h

4 years agoPartially revert 6aea568d87025b0a441388e9394d9084fa0a57c3
Martin Matuska [Tue, 11 Jun 2019 22:16:31 +0000 (00:16 +0200)] 
Partially revert 6aea568d87025b0a441388e9394d9084fa0a57c3

On most platforms it is impossible to open a fd on symbolic links.

4 years agoSet up 3.4.1dev
Martin Matuska [Tue, 11 Jun 2019 21:57:21 +0000 (23:57 +0200)] 
Set up 3.4.1dev

4 years ago3.4.0 v3.4.0
Martin Matuska [Tue, 11 Jun 2019 19:53:23 +0000 (21:53 +0200)] 
3.4.0

4 years agoRemove unused members of struct lafe_line_reader
Marc Espie [Tue, 11 Jun 2019 00:01:26 +0000 (02:01 +0200)] 
Remove unused members of struct lafe_line_reader

Fixes #1211

4 years agoUpdate specfile to a version usable on copr
Martin Matuska [Mon, 10 Jun 2019 21:27:33 +0000 (23:27 +0200)] 
Update specfile to a version usable on copr

4 years agoMerge lib/libc/gen/readpassphrase.c v 1.27 from OpenBSD
Martin Matuska [Sun, 9 Jun 2019 23:31:56 +0000 (01:31 +0200)] 
Merge lib/libc/gen/readpassphrase.c v 1.27 from OpenBSD

Fixes #1209

4 years agoarchive_write_disk_posix changes
Martin Matuska [Thu, 6 Jun 2019 13:12:11 +0000 (15:12 +0200)] 
archive_write_disk_posix changes
- private file descriptor in _archive_write_disk_close()
- use la_opendirat() in edit_deep_directories()

4 years agoFix typo in tar/bsdtar.1
Martin Matuska [Thu, 6 Jun 2019 12:58:25 +0000 (14:58 +0200)] 
Fix typo in tar/bsdtar.1

4 years agoMore bsdtar.1 manpage fixes
Martin Matuska [Mon, 3 Jun 2019 21:51:44 +0000 (23:51 +0200)] 
More bsdtar.1 manpage fixes

- use term "extended file attributes"
- use term "file attributes or file flags"

4 years agoMinor bsdtar.1 manpage fixes
Martin Matuska [Mon, 3 Jun 2019 21:33:49 +0000 (23:33 +0200)] 
Minor bsdtar.1 manpage fixes

- the -p option does not restore owner by default.
- the -n option was listed twice
- file flags are called file attributes on Linux and are platform-specific

Fixes #1204

4 years agoAdd missing HAVE_UNLINKAT to build/cmake/config.h.in
Martin Matuska [Mon, 3 Jun 2019 14:29:58 +0000 (16:29 +0200)] 
Add missing HAVE_UNLINKAT to build/cmake/config.h.in

4 years agoFix typo in CMakeLists.txt and build/ci/build.sh
Martin Matuska [Fri, 31 May 2019 22:49:48 +0000 (00:49 +0200)] 
Fix typo in CMakeLists.txt and build/ci/build.sh

4 years agoarchive_write_disk: remove some obsolete TODO comments
Martin Matuska [Sun, 26 May 2019 00:21:51 +0000 (02:21 +0200)] 
archive_write_disk: remove some obsolete TODO comments

4 years agoarchive_write_disk_posix: check_symlinks_fsobj() without chdir()
Martin Matuska [Sat, 25 May 2019 23:48:39 +0000 (01:48 +0200)] 
archive_write_disk_posix: check_symlinks_fsobj() without chdir()

only on platforms with openat(), fstatat() and unlinkat() support

4 years agoarchive_write_disk_posix: open a fd when processing fixup entries
Martin Matuska [Sat, 25 May 2019 21:46:59 +0000 (23:46 +0200)] 
archive_write_disk_posix: open a fd when processing fixup entries

4 years agoarchive_write_disk_posix: simplify set_mode()
Martin Matuska [Sat, 25 May 2019 21:20:21 +0000 (23:20 +0200)] 
archive_write_disk_posix: simplify set_mode()

Try fchmod() first when setting mode on links

4 years agoMerge pull request #1205 from vapier/master
Martin Matuška [Thu, 23 May 2019 13:20:01 +0000 (15:20 +0200)] 
Merge pull request #1205 from vapier/master

simplify gitignore a bit

4 years agosimplify gitignore a bit 1205/head
Mike Frysinger [Wed, 22 May 2019 04:04:35 +0000 (09:49 +0545)] 
simplify gitignore a bit

Lets ignore autotool generated files (.la .dirstamp .deps) everywhere
rather than hardcoded specific subdirs.  We'll never add files with
those names to the source repo, so that should be OK.

We're already ignoring CMakeFiles/ everywhere (since the rule lacks
a leading / anchor), so we can delete the redundant paths.

Rather than hardcode every possible unittest and related files, add
globs that ignore all *_test related paths in the topdir.  We won't
be adding paths like that to the source repo, so it should be OK.