]> git.ipfire.org Git - thirdparty/libarchive.git/log
thirdparty/libarchive.git
3 years agoOn close, handle short writes from archive_write_callback 1530/head
Owen W. Taylor [Wed, 12 May 2021 20:26:24 +0000 (16:26 -0400)] 
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.

3 years agoMerge pull request #1502 from tih/cpio-bin-formats
Martin Matuška [Mon, 10 May 2021 19:05:00 +0000 (21:05 +0200)] 
Merge pull request #1502 from tih/cpio-bin-formats

Support for PWB and v7 binary cpio formats

3 years agoMerge pull request #1519 from zoulasc/master
Martin Matuška [Mon, 10 May 2021 19:02:16 +0000 (21:02 +0200)] 
Merge pull request #1519 from zoulasc/master

Extract common transfer setting code for statfs and statvfs.

3 years agoMerge pull request #1520 from odubaj/master
Martin Matuška [Mon, 10 May 2021 19:00:53 +0000 (21:00 +0200)] 
Merge pull request #1520 from odubaj/master

Fixed double free when calling lzx_huffman_init frees pointer ds-

3 years agoCatch up with autoconf changes: 1519/head
Christos Zoulas [Sat, 8 May 2021 20:07:51 +0000 (16:07 -0400)] 
Catch up with autoconf changes:
    HAVE_STRUCT_STATFS
    HAVE_STRUCT_STATFS_F_IOSIZE

3 years agoCast isprint(3) argument to unsigned char to avoid undefined behavior.
Christos Zoulas [Sat, 8 May 2021 20:07:04 +0000 (16:07 -0400)] 
Cast isprint(3) argument to unsigned char to avoid undefined behavior.

3 years agoNetBSD provides a statfs symbol for binary compatibility but does not
Christos Zoulas [Sat, 8 May 2021 20:06:11 +0000 (16:06 -0400)] 
NetBSD provides a statfs symbol for binary compatibility but does not
provide a visible struct statfs. Check for that.

3 years agoMerge remote-tracking branch 'upstream/master'
Christos Zoulas [Sat, 8 May 2021 19:38:34 +0000 (15:38 -0400)] 
Merge remote-tracking branch 'upstream/master'

3 years agoMerge pull request #1504 from legnaleurc/fix-rar-header-skim
Martin Matuška [Sat, 8 May 2021 19:27:56 +0000 (21:27 +0200)] 
Merge pull request #1504 from legnaleurc/fix-rar-header-skim

fix rar header skiming

3 years agofix rar header skiming 1504/head
Wei-Cheng Pan [Tue, 9 Mar 2021 16:34:55 +0000 (16:34 +0000)] 
fix rar header skiming

The available size returned from `__archive_read_ahead` can be larger
then required size. Substract by available size may underflow `skip`,
which will reach EOF too soon.

3 years agoMerge pull request #1524 from DerDakon/cpio-ext
Martin Matuška [Fri, 7 May 2021 15:37:38 +0000 (17:37 +0200)] 
Merge pull request #1524 from DerDakon/cpio-ext

cpio test: add source file extension

3 years agoMerge pull request #1521 from odubaj/leak-fix-rar
Martin Matuška [Sun, 18 Apr 2021 22:36:06 +0000 (00:36 +0200)] 
Merge pull request #1521 from odubaj/leak-fix-rar

Fixed leak of rar before ending with error

3 years agoMerge pull request #1522 from bradking/no-u_char
Brad King [Tue, 6 Apr 2021 18:11:36 +0000 (14:11 -0400)] 
Merge pull request #1522 from bradking/no-u_char

Use uint8_t instead of u_char

3 years agocpio test: add source file extension 1524/head
Rolf Eike Beer [Tue, 6 Apr 2021 16:42:34 +0000 (18:42 +0200)] 
cpio test: add source file extension

Fixes CMake warnings regarding CMP0115.

3 years agoUse uint8_t instead of u_char 1522/head
Brad King [Mon, 5 Apr 2021 14:10:48 +0000 (10:10 -0400)] 
Use uint8_t instead of u_char

The latter is not a standard type.

3 years agoFixed leak of rar before ending with error 1521/head
Ondrej Dubaj [Wed, 31 Mar 2021 09:54:52 +0000 (11:54 +0200)] 
Fixed leak of rar before ending with error

3 years agoFixed double free when calling lzx_huffman_init frees pointer ds- 1520/head
Ondrej Dubaj [Wed, 31 Mar 2021 09:50:44 +0000 (11:50 +0200)] 
Fixed double free when calling lzx_huffman_init frees pointer ds-

3 years agoAdd __LA_UNUSED because clang warns for static inline functions that are
Christos Zoulas [Mon, 29 Mar 2021 21:55:43 +0000 (17:55 -0400)] 
Add __LA_UNUSED because clang warns for static inline functions that are
not used.

3 years agoNot all statfs's have f_iosize
Christos Zoulas [Mon, 29 Mar 2021 21:27:37 +0000 (17:27 -0400)] 
Not all statfs's have f_iosize

3 years agoMake setter functions inline
Christos Zoulas [Mon, 29 Mar 2021 21:14:01 +0000 (17:14 -0400)] 
Make setter functions inline

3 years agoFix FreeBSD which has both statfs and statvfs
Christos Zoulas [Mon, 29 Mar 2021 21:05:41 +0000 (17:05 -0400)] 
Fix FreeBSD which has both statfs and statvfs

3 years agoFix typo
Christos Zoulas [Mon, 29 Mar 2021 20:44:51 +0000 (16:44 -0400)] 
Fix typo

3 years agoPut the statvfs code in a separate block so that it can by shared by
Christos Zoulas [Mon, 29 Mar 2021 20:19:21 +0000 (16:19 -0400)] 
Put the statvfs code in a separate block so that it can by shared by
linux and NetBSD

3 years agoFix typo
Christos Zoulas [Mon, 29 Mar 2021 19:54:28 +0000 (15:54 -0400)] 
Fix typo

3 years agoExtract common transfer setting code for statfs and statvfs.
Christos Zoulas [Mon, 29 Mar 2021 19:32:34 +0000 (15:32 -0400)] 
Extract common transfer setting code for statfs and statvfs.
1. Makes detection of f_iosize constent.
2. Avoid infinite loops by detecting 0 sizes and converting to -1.
   This happens with FUSE. NetBSD PR/56083.

3 years agoMerge pull request #1514 from pimaster/fixDiskAccessForPrePaddedZips
Tim Kientzle [Sat, 27 Mar 2021 04:50:41 +0000 (21:50 -0700)] 
Merge pull request #1514 from pimaster/fixDiskAccessForPrePaddedZips

Rather than using the central directory offset as the file position directly, instead use the known location of the end-of-central-directory record and the size of the central directory to compute an offset.  This allows us to efficiently handle Zip archives that have other data prepended to the file.

3 years agoMerge pull request #1505 from arichardson/silent-stderr
Martin Matuška [Wed, 24 Mar 2021 14:33:56 +0000 (15:33 +0100)] 
Merge pull request #1505 from arichardson/silent-stderr

Silence stderr in test_read_append_filter_program

3 years agoFix declaration of variables, mostly to trigger a new check for what 1514/head
Russell Mullens [Wed, 24 Mar 2021 03:02:45 +0000 (14:02 +1100)] 
Fix declaration of variables, mostly to trigger a new check for what
seems like an unrelated issue.

3 years agoFix excessive disk read for padded zip.
Russell Mullens [Tue, 23 Mar 2021 11:22:07 +0000 (22:22 +1100)] 
Fix excessive disk read for padded zip.

Use the size of the Central Directory and the offset of the EOCD to
calculate the real position.

This trick doesn't work for Zip64 as easily as we are not scanning
backwards to find the PK\x06\x06 entry.
Interestingly, it is never checked so it could be trying to parse
bad files.

Updated based on review

3 years agoCalculate where the Central Directory is based on the size of the Central Directory...
Russell Mullens [Sat, 20 Mar 2021 07:59:12 +0000 (18:59 +1100)] 
Calculate where the Central Directory is based on the size of the Central Directory in EOCD and where the OECD was found.
This prevents large reads when a zip archive is preceded by other data.

3 years agoSilence stderr in test_read_append_filter_program 1505/head
Alex Richardson [Wed, 10 Mar 2021 10:31:28 +0000 (10:31 +0000)] 
Silence stderr in test_read_append_filter_program

When the FreeBSD testsuite runs the libarchive tests it checks that stderr
is empty. Since #1382 this is no longer the case. This change restores
the behaviour of silencing bunzip2 stderr but doesn't bring back the
output text check.

Partially reverts 2e7aa5d9

3 years agoMerge pull request #1481 from alexandre-janniaux/configure/prog-cpp/1
Martin Matuška [Mon, 8 Mar 2021 16:46:17 +0000 (17:46 +0100)] 
Merge pull request #1481 from alexandre-janniaux/configure/prog-cpp/1

Add AC_PROG_CPP to configure.ac

3 years agoMerge pull request #1480 from r0ptr/fix/7zip-extraction-32bit
Martin Matuška [Mon, 8 Mar 2021 16:45:25 +0000 (17:45 +0100)] 
Merge pull request #1480 from r0ptr/fix/7zip-extraction-32bit

Fix truncation of size values during 7zip archive extraction on 32bit architectures

3 years agoupdate "-h" output with new formats 1502/head
Tom Ivar Helbekkmo [Sat, 6 Mar 2021 21:45:41 +0000 (22:45 +0100)] 
update "-h" output with new formats

3 years agoupdate top level docs with binary cpio support
Tom Ivar Helbekkmo [Sat, 6 Mar 2021 13:44:02 +0000 (14:44 +0100)] 
update top level docs with binary cpio support

3 years agoupdate cpio documentation, add basic test of binary format
Tom Ivar Helbekkmo [Sat, 6 Mar 2021 12:04:37 +0000 (13:04 +0100)] 
update cpio documentation, add basic test of binary format

3 years agofix output format handling and symlink detection for PWB
Tom Ivar Helbekkmo [Sat, 6 Mar 2021 09:09:53 +0000 (10:09 +0100)] 
fix output format handling and symlink detection for PWB

3 years agoadd -7 option to bsdcpio for symmetry
Tom Ivar Helbekkmo [Sat, 6 Mar 2021 08:28:57 +0000 (09:28 +0100)] 
add -7 option to bsdcpio for symmetry

3 years agoadd a missing file entry to libarchive/CMakeLists.txt
Tom Ivar Helbekkmo [Fri, 5 Mar 2021 23:00:58 +0000 (00:00 +0100)] 
add a missing file entry to libarchive/CMakeLists.txt

3 years agobe PDP-endian host compatible when writing binary cpio headers
Tom Ivar Helbekkmo [Fri, 5 Mar 2021 22:35:09 +0000 (23:35 +0100)] 
be PDP-endian host compatible when writing binary cpio headers

3 years agoadd support for reading and writing PWB and V7 cpio archives
Tom Ivar Helbekkmo [Fri, 5 Mar 2021 22:18:21 +0000 (23:18 +0100)] 
add support for reading and writing PWB and V7 cpio archives

3 years agorearrange cpio output format selection
Tom Ivar Helbekkmo [Fri, 5 Mar 2021 20:25:06 +0000 (21:25 +0100)] 
rearrange cpio output format selection

3 years agoMerge pull request #1488 from oliness/add-null-check-1483
Martin Matuška [Tue, 16 Feb 2021 15:14:02 +0000 (16:14 +0100)] 
Merge pull request #1488 from oliness/add-null-check-1483

Add null check to string in archive_pathmatch

3 years agoMerge pull request #1487 from Olernov/fix_1486_build_fails_with_v120
Martin Matuška [Tue, 16 Feb 2021 15:12:30 +0000 (16:12 +0100)] 
Merge pull request #1487 from Olernov/fix_1486_build_fails_with_v120

Fix #1486: build fails on Windows with VS2013 toolset (v120)

3 years agoAdd null check to string in archive_pathmatch 1488/head
Oliver Ford [Wed, 27 Jan 2021 14:39:42 +0000 (14:39 +0000)] 
Add null check to string in archive_pathmatch

Adds a null check for the string parameter in archive_pathmatch
and archive_pathmatch_w to prevent a null pointer dereference.

Reported in github issue #1483.

3 years agoFix #1486: build fails on Windows with VS2013 toolset (v120) 1487/head
Oleg Smirnov [Fri, 22 Jan 2021 11:16:14 +0000 (14:16 +0300)] 
Fix #1486: build fails on Windows with VS2013 toolset (v120)

Build fails on compiling xxhash.c having a fuction with "inline" specifier.
"inline" is a c99 keyword and c99 is not yet (fully) supported with MSVC toolset v120:
"The inline keyword is available only in C++. The __inline and __forceinline
keywords are available in both C and C++. For compatibility with previous versions,
_inline is a synonym for __inline."
(Source: http://msdn.microsoft.com/en-us/library/z8y1yy88.aspx)

This fix adds a patch that replaces "inline" with "__inline" in xxhash.c

3 years agoconfigure.ac: remove trailing characters 1481/head
Alexandre Janniaux [Mon, 11 Jan 2021 11:34:30 +0000 (12:34 +0100)] 
configure.ac: remove trailing characters

3 years agoconfigure.ac: add AC_PROG_CPP
Alexandre Janniaux [Mon, 11 Jan 2021 11:31:53 +0000 (12:31 +0100)] 
configure.ac: add AC_PROG_CPP

Otherwise, the preprocessor is not detected and it leads to failure with
empty $CPP variable being used on la_TYPE_UID_T, leading to a cascade of
detection errors and redefinition of some types.

3 years agoFix truncation of size values during 7zip archive extraction on 32bit architectures 1480/head
r0ptr [Sun, 10 Jan 2021 12:36:03 +0000 (13:36 +0100)] 
Fix truncation of size values during 7zip archive extraction on 32bit architectures

3 years agoLibarchive 3.5.2dev
Martin Matuska [Sat, 26 Dec 2020 02:45:23 +0000 (03:45 +0100)] 
Libarchive 3.5.2dev

3 years agoRelease 3.5.1 v3.5.1
Martin Matuska [Fri, 25 Dec 2020 23:34:39 +0000 (00:34 +0100)] 
Release 3.5.1

3 years agoCI: use xz 5.2.5 in Windows build
Martin Matuska [Fri, 25 Dec 2020 23:34:05 +0000 (00:34 +0100)] 
CI: use xz 5.2.5 in Windows build

3 years agoCI: use FreeBSD 12.2 image in Cirrus CI build
Martin Matuska [Fri, 25 Dec 2020 23:33:27 +0000 (00:33 +0100)] 
CI: use FreeBSD 12.2 image in Cirrus CI build

3 years agoAdd HAVE_STRNLEN to config_freebsd.h
Martin Matuska [Sun, 13 Dec 2020 15:33:09 +0000 (16:33 +0100)] 
Add HAVE_STRNLEN to config_freebsd.h

3 years agoMerge pull request #1465 from arichardson/fix-warc-ub
Martin Matuška [Wed, 9 Dec 2020 20:01:57 +0000 (21:01 +0100)] 
Merge pull request #1465 from arichardson/fix-warc-ub

warc: Fix undefined behaviour in deconst() function

3 years agowarc: Fix undefined behaviour in deconst() function 1465/head
Alex Richardson [Wed, 9 Dec 2020 16:17:22 +0000 (16:17 +0000)] 
warc: Fix undefined behaviour in deconst() function

Creating a pointer by adding an offset to 0x1 is undefined behaviour and
results in an invalid pointer when running on CHERI systems. Use a
standards-compliant cast via uintptr_t instead.

This was found due to a crash while running the libarchive test suite on a
CHERI-RISC-V system.

3 years agoUse built-in strnlen on platforms where not available
Martin Matuska [Tue, 8 Dec 2020 01:26:52 +0000 (02:26 +0100)] 
Use built-in strnlen on platforms where not available

Fixes #1464

3 years agoBump minor version in contrib/libarchive.spec
Martin Matuska [Fri, 4 Dec 2020 14:41:18 +0000 (15:41 +0100)] 
Bump minor version in contrib/libarchive.spec

3 years agoRepair gcc11 build error in archive_read_support_format_warc.c
Martin Matuska [Fri, 4 Dec 2020 14:12:35 +0000 (15:12 +0100)] 
Repair gcc11 build error in archive_read_support_format_warc.c

Fixes #1462

3 years agoDo not use C99 for loop scoping in test_archive_read_support.c
Martin Matuska [Fri, 4 Dec 2020 14:08:42 +0000 (15:08 +0100)] 
Do not use C99 for loop scoping in test_archive_read_support.c

Fixes #1463

3 years agoAdd missing ifdef to unbreak build withot lzma
Martin Matuska [Fri, 4 Dec 2020 11:04:52 +0000 (12:04 +0100)] 
Add missing ifdef to unbreak build withot lzma

Fixes #1461

3 years agoLibarchive 3.5.1dev
Martin Matuska [Tue, 1 Dec 2020 08:47:32 +0000 (09:47 +0100)] 
Libarchive 3.5.1dev

3 years agoRelease 3.5.0 v3.5.0
Martin Matuska [Tue, 1 Dec 2020 08:21:21 +0000 (09:21 +0100)] 
Release 3.5.0

3 years agoBuild release with Ubuntu 20.04
Martin Matuska [Tue, 1 Dec 2020 01:18:22 +0000 (02:18 +0100)] 
Build release with Ubuntu 20.04

3 years agoMerge pull request #1429 from ltx2018/master
Martin Matuška [Wed, 18 Nov 2020 17:19:32 +0000 (18:19 +0100)] 
Merge pull request #1429 from ltx2018/master

Avoid stack overflow in read_data_compressed

3 years agoMerge pull request #1413 from uyjulian/unknown_system_identifier
Martin Matuška [Wed, 18 Nov 2020 17:16:44 +0000 (18:16 +0100)] 
Merge pull request #1413 from uyjulian/unknown_system_identifier

Fill in Unknown for the system identifier

3 years agoFix typo in archive_write_open.3
Martin Matuska [Thu, 12 Nov 2020 10:10:43 +0000 (11:10 +0100)] 
Fix typo in archive_write_open.3

3 years agoUpdate archive_write_open.3 manpage
Martin Matuska [Thu, 12 Nov 2020 09:52:32 +0000 (10:52 +0100)] 
Update archive_write_open.3 manpage

3 years agoIntroduce archive_write_open2() with free callback
Martin Matuska [Fri, 6 Nov 2020 02:17:11 +0000 (03:17 +0100)] 
Introduce archive_write_open2() with free callback

The archive_write_open() function does not provide a free callback.
Freeing was done by the close callback. When the open callback fails,
the client filter is left in ARCHIVE_WRITE_FILTER_STATE_FATAL,
the close callback is not called and unfreed resources may be left behind.

Fixes #1456

3 years agoarchive_cryptor: use new Nettle AES interface on Nettle 3.0 and higher
Martin Matuska [Wed, 4 Nov 2020 06:49:36 +0000 (07:49 +0100)] 
archive_cryptor: use new Nettle AES interface on Nettle 3.0 and higher

3 years agoCI: fix homebrew errors in MacOS build
Martin Matuska [Mon, 2 Nov 2020 12:57:03 +0000 (13:57 +0100)] 
CI: fix homebrew errors in MacOS build

3 years agoCI: update Ubuntu image to 20.04
Martin Matuska [Mon, 2 Nov 2020 12:56:43 +0000 (13:56 +0100)] 
CI: update Ubuntu image to 20.04

3 years agoarchive_cryptor: silence Nettle 3.5+ warnings
Martin Matuska [Mon, 2 Nov 2020 12:35:03 +0000 (13:35 +0100)] 
archive_cryptor: silence Nettle 3.5+ warnings

3 years agoMerge pull request #1450 from XVilka/patch-1
Martin Matuška [Wed, 21 Oct 2020 22:21:40 +0000 (00:21 +0200)] 
Merge pull request #1450 from XVilka/patch-1

libarchive/archive_entry.c is not 3-clause UC Regents License

3 years agoarchive_entry.c is not 3-clause UC Regents License 1450/head
Anton Kochkov [Wed, 21 Oct 2020 07:17:22 +0000 (15:17 +0800)] 
archive_entry.c is not 3-clause UC Regents License

3 years agoMerge pull request #1409 from HardenedBSD/hbsd/extattr
Martin Matuška [Wed, 14 Oct 2020 18:37:09 +0000 (20:37 +0200)] 
Merge pull request #1409 from HardenedBSD/hbsd/extattr

HBSD: Teach libarchive about the system extended attribute namespace

3 years agoHBSD: Ignore UFS shenanigans 1409/head
Shawn Webb [Wed, 14 Oct 2020 16:51:49 +0000 (12:51 -0400)] 
HBSD: Ignore UFS shenanigans

UFS stores NFSv4 ACLs in the system extended attribute namespace. Per
libarchive maintainer, ignore those attributes.

Signed-off-by: Shawn Webb <shawn.webb@hardenedbsd.org>

3 years agoHBSD: Teach libarchive about the system extended attribute namespace
Shawn Webb [Sun, 13 Sep 2020 19:03:28 +0000 (15:03 -0400)] 
HBSD: Teach libarchive about the system extended attribute namespace

In order to teach the packaging infrastructure how to support
HardenedBSD's method of exploit mitigation toggling, teach libarchive
how to handle the system filesystem extended attribute namespace.

Signed-off-by: Shawn Webb <shawn.webb@hardenedbsd.org>

3 years agoHBSD: wrap function declaration in an ifdef to appease CI
Shawn Webb [Sun, 9 Aug 2020 12:15:06 +0000 (08:15 -0400)] 
HBSD: wrap function declaration in an ifdef to appease CI

The function I added only applies to FreeBSD. As such, if the function
declaration isn't ifdef'd out for other architectures, continuous
integration (CI) builds fail. Mitigate the failure by guarding the
function declaration with the proper preprocessor macro conditional.

Signed-off-by: Shawn Webb <shawn.webb@hardenedbsd.org>

3 years agoHBSD: Teach libarchive about the system extended attribute namespace
Shawn Webb [Fri, 3 Jul 2020 14:33:18 +0000 (10:33 -0400)] 
HBSD: Teach libarchive about the system extended attribute namespace

In order to teach HardenedBSD's packaging infrastructure how to support
HardenedBSD's method of exploit mitigation toggling, teach libarchive
how to handle the system filesystem extended attribute namespace.

Signed-off-by: Shawn Webb <shawn.webb@hardenedbsd.org>

3 years agoMerge pull request #1435 from mariXanna/issue#1434
Martin Matuška [Wed, 14 Oct 2020 08:03:18 +0000 (10:03 +0200)] 
Merge pull request #1435 from mariXanna/issue#1434

Add support for decompression of symbolic links in zipx archives

3 years agofix test failure 1435/head
Masalskaya, Anna [Tue, 29 Sep 2020 21:21:41 +0000 (00:21 +0300)] 
fix test failure

3 years agoMerge pull request #1442 from luis-henrix/directory_traversals-fix
Tim Kientzle [Sat, 26 Sep 2020 04:29:31 +0000 (21:29 -0700)] 
Merge pull request #1442 from luis-henrix/directory_traversals-fix

Fix test clean-up

3 years agoFix test clean-up 1442/head
Luis Henriques [Fri, 25 Sep 2020 09:09:44 +0000 (10:09 +0100)] 
Fix test clean-up

On test clean-up an 'rm -rf' will fail because 'lock' and 'lock/lock2'
directories have 0311 permissions.  Change these permissions on exit so
that the directories can be deleted on success.

3 years agotests: add new assertion for chmod()
Luis Henriques [Fri, 25 Sep 2020 08:57:13 +0000 (09:57 +0100)] 
tests: add new assertion for chmod()

3 years agomove test to another place
Masalskaya, Anna [Tue, 22 Sep 2020 09:43:25 +0000 (12:43 +0300)] 
move test to another place

3 years agounit test added
Masalskaya, Anna [Mon, 21 Sep 2020 21:07:15 +0000 (00:07 +0300)] 
unit test added

3 years agoMerge pull request #1437 from arichardson/check-config-h-included
Martin Matuška [Mon, 21 Sep 2020 05:15:26 +0000 (07:15 +0200)] 
Merge pull request #1437 from arichardson/check-config-h-included

Avoid mismatch between library and test crypto configuration

3 years agoAvoid mismatch between library and test crypto configuration 1437/head
Alex Richardson [Thu, 17 Sep 2020 17:14:58 +0000 (18:14 +0100)] 
Avoid mismatch between library and test crypto configuration

I was investigating libarchive test failures on FreeBSD and it turns out
we get a reproducible SIGBUS for test_archive_m5, etc. Debugging this shows
that libarchive and the tests disagree when it comes to the definition of
archive_md5_ctx: libarchive assumes it's the OpenSSL type whereas the test
use the libmd type. The latter is not necessarily aligned enough to store
a pointer (16 bytes for CHERI RISC-V), so we were crashing when storing
EVP_MD_CTX* to an 8-byte-aligned archive_md5_ctx.

To avoid problems like this in the future, add a new macro to the config
header and use that to ensure that all configuration check macros have
been defined in archive_digest_private.h.

3 years agoadjust formatting
Masalskaya, Anna [Wed, 16 Sep 2020 13:50:21 +0000 (16:50 +0300)] 
adjust formatting

3 years agoapplying remarks
Masalskaya, Anna [Mon, 14 Sep 2020 21:32:46 +0000 (00:32 +0300)] 
applying remarks

3 years agomore comments
Masalskaya, Anna [Mon, 14 Sep 2020 17:15:34 +0000 (20:15 +0300)] 
more comments

3 years agoMerge pull request #1433 from kevans91/warns
Martin Matuška [Thu, 10 Sep 2020 22:11:18 +0000 (00:11 +0200)] 
Merge pull request #1433 from kevans91/warns

tests: mark failed_filename and tests static to fix WARNS=6 build

3 years agoAdd support for decompression of symbolic links in zipx archives
Masalskaya, Anna [Wed, 9 Sep 2020 19:58:32 +0000 (22:58 +0300)] 
Add support for decompression of symbolic links in zipx archives

3 years agotests: mark failed_filename and tests static to fix WARNS=6 build 1433/head
Kyle Evans [Tue, 8 Sep 2020 18:58:32 +0000 (13:58 -0500)] 
tests: mark failed_filename and tests static to fix WARNS=6 build

Observed on FreeBSD with a higher WARNS level on bsdcat/tests, these two
variables should be private to test_main.c in order to appease the build.

3 years agoAdd a loop checker in read_data_compressed to avoid stack overflow. 1429/head
lutianxiong [Thu, 20 Aug 2020 11:09:03 +0000 (19:09 +0800)] 
Add a loop checker in read_data_compressed to avoid stack overflow.

Signed-off-by: lutianxiong <lutianxiong@huawei.com>
3 years agoMerge pull request #1422 from crrodriguez/o_tmpfile
Martin Matuška [Sun, 9 Aug 2020 00:43:48 +0000 (02:43 +0200)] 
Merge pull request #1422 from crrodriguez/o_tmpfile

use O_TMPFILE if it works/is supported in __archive_mktemp

3 years agoCI: Run tests on FreeBSD 12.1 and 11.4 via Cirrus CI
Martin Matuska [Wed, 29 Jul 2020 08:10:50 +0000 (10:10 +0200)] 
CI: Run tests on FreeBSD 12.1 and 11.4 via Cirrus CI

3 years agouse O_TMPFILE if it works/is supported in __archive_mktemp 1422/head
Cristian Rodríguez [Mon, 27 Jul 2020 14:11:33 +0000 (10:11 -0400)] 
use O_TMPFILE if it works/is supported in __archive_mktemp

This makes the function safer on linux since the file is warrantied to never
be visible on the filesystem, cannot be linked anywhere unless O_EXCL is
not specified and it is lost forever on any kind of program termination.

3 years agoMerge pull request #1420 from Gei0r/master
Tim Kientzle [Sun, 26 Jul 2020 21:01:43 +0000 (14:01 -0700)] 
Merge pull request #1420 from Gei0r/master

Enable compression level up to 9 for xz, xar, 7zip