]> git.ipfire.org Git - thirdparty/libarchive.git/log
thirdparty/libarchive.git
4 years agoMerge pull request #1591 from JiaT75/Added_documentation_for_exported_functions_in_ar...
Martin Matuška [Tue, 16 Nov 2021 00:01:17 +0000 (01:01 +0100)] 
Merge pull request #1591 from JiaT75/Added_documentation_for_exported_functions_in_archive_read_disk

Added documentation for exported functions in archive_read_disk

4 years agoMerge pull request #1598 from JiaT75/zip_entry_size_unset_store_fix_1547
Martin Matuška [Mon, 15 Nov 2021 23:59:49 +0000 (00:59 +0100)] 
Merge pull request #1598 from JiaT75/zip_entry_size_unset_store_fix_1547

Zip entry size unset now honors user requested compression level

4 years agoMerge pull request #1601 from evelikov/rm-fallthrough
Martin Matuška [Mon, 15 Nov 2021 23:54:51 +0000 (00:54 +0100)] 
Merge pull request #1601 from evelikov/rm-fallthrough

mtree reader: return early, remove fallthrough chain

4 years agoMerge pull request #1606 from JiaT75/clean_up_archive_read_disk_descend_functions
Martin Matuška [Mon, 15 Nov 2021 23:46:53 +0000 (00:46 +0100)] 
Merge pull request #1606 from JiaT75/clean_up_archive_read_disk_descend_functions

Cleaned up archive_read_disk_descend functions

4 years agoMerge pull request #1609 from JiaT75/added_error_message_to_warning_bsdtar_1561
Martin Matuška [Mon, 15 Nov 2021 23:45:36 +0000 (00:45 +0100)] 
Merge pull request #1609 from JiaT75/added_error_message_to_warning_bsdtar_1561

Added error text to warning when untaring with bsdtar

4 years agotar: expose ARCHIVE_READDISK_NO_SPARSE as --no-read-sparse
Jonas Witschel [Sun, 14 Nov 2021 17:56:49 +0000 (18:56 +0100)] 
tar: expose ARCHIVE_READDISK_NO_SPARSE as --no-read-sparse

4 years agoAdd ARCHIVE_READDISK_NO_SPARSE to suppress reading sparse file info
Jonas Witschel [Sun, 14 Nov 2021 17:56:49 +0000 (18:56 +0100)] 
Add ARCHIVE_READDISK_NO_SPARSE to suppress reading sparse file info

Sparse file information depends on the file system and can therefore be a
source of unreproducibility for the generated archives, e.g. if the same
content is compressed on a file system with and without sparse file support.
Add an option to suppress reading this information from disk entirely.

4 years agoAdded error message when archive extraction fails 1609/head
jiat75 [Sat, 30 Oct 2021 03:47:15 +0000 (11:47 +0800)] 
Added error message when archive extraction fails

4 years agoCleaned up archive_read_disk_descend functions. 1606/head
jiat75 [Wed, 27 Oct 2021 14:05:43 +0000 (22:05 +0800)] 
Cleaned up archive_read_disk_descend functions.

4 years agoFixing typo in archive_read_disk man page 1591/head
jiat75 [Wed, 27 Oct 2021 13:56:58 +0000 (21:56 +0800)] 
Fixing typo in archive_read_disk man page

4 years agoUsing the new .editorconfig to fix formatting on size unset store test 1598/head
jiat75 [Wed, 27 Oct 2021 12:43:48 +0000 (20:43 +0800)] 
Using the new .editorconfig to fix formatting on size unset store test

4 years agoReusing code from zip size known and adjusting comments
jiat75 [Wed, 27 Oct 2021 12:28:20 +0000 (20:28 +0800)] 
Reusing code from zip size known and adjusting comments

4 years agoMerge pull request #1602 from evelikov/editorconfig
Martin Matuška [Tue, 26 Oct 2021 12:22:23 +0000 (14:22 +0200)] 
Merge pull request #1602 from evelikov/editorconfig

editorconfig: add simple top-level file

4 years agoMerge pull request #1589 from JiaT75/added-missing-checks-for-canLzip-canLzma-and...
Martin Matuška [Tue, 26 Oct 2021 12:21:51 +0000 (14:21 +0200)] 
Merge pull request #1589 from JiaT75/added-missing-checks-for-canLzip-canLzma-and-canXz

added missing checks for canLzip, canLzma, and canXz

4 years agoMerge pull request #1590 from jsonn/master
Martin Matuška [Tue, 26 Oct 2021 12:03:10 +0000 (14:03 +0200)] 
Merge pull request #1590 from jsonn/master

Support ARCHIVE_EXTRACT_SECURE_NODOTDOT on Windows

4 years agoMerge pull request #1593 from JiaT75/added_bin_to_gitignore
Martin Matuška [Tue, 26 Oct 2021 11:51:25 +0000 (13:51 +0200)] 
Merge pull request #1593 from JiaT75/added_bin_to_gitignore

Added bin folder to .gitignore

4 years agoMerge pull request #1604 from AdamKorcz/fuzz1
Martin Matuška [Tue, 26 Oct 2021 11:24:03 +0000 (13:24 +0200)] 
Merge pull request #1604 from AdamKorcz/fuzz1

Add CIFuzz

4 years agoAdd CIFuzz 1604/head
AdamKorcz [Tue, 26 Oct 2021 10:10:08 +0000 (11:10 +0100)] 
Add CIFuzz

4 years agoreader: introduce struct archive_read_filter_vtable 1603/head
Emil Velikov [Sat, 14 Mar 2020 21:44:48 +0000 (21:44 +0000)] 
reader: introduce struct archive_read_filter_vtable

As before - move the dispatch/function pointer so a const data segment.
Separating it from the RW data section.

Note: the close function is _not_ optional - remove the NULL check.

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
4 years agoreader: remove unused archive_read_filter callbacks
Emil Velikov [Sat, 14 Mar 2020 19:41:27 +0000 (19:41 +0000)] 
reader: remove unused archive_read_filter callbacks

In particular the ::open and ::sswitch callbacks are unused.

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
4 years agoreader: track read_filter "can_skip" with a flag
Emil Velikov [Mon, 30 Mar 2020 22:13:15 +0000 (23:13 +0100)] 
reader: track read_filter "can_skip" with a flag

Analogous to the earlier "can_seek" change. Drop the function pointer
in favour of a flag. Over the years, with over a dozen filters, no
filters actually implemented it.

If at a point in the future that changes, one can reinstate it.

Alternatively one could use a ARCHIVE_FILTER_NONE check.

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
4 years agoreader: track read_filter "can_seek" with a flag
Emil Velikov [Mon, 30 Mar 2020 21:54:21 +0000 (22:54 +0100)] 
reader: track read_filter "can_seek" with a flag

Currently we the ::seek callback can be either NULL or client_seek_proxy.

Since we already explicitly use the latter, instead of ::seek just drop
the function pointer all together, in favour of a simple flag.

Alternatively one could use a ARCHIVE_FILTER_NONE check.

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
4 years agoreader: reuse client_{open,close}_proxy more
Emil Velikov [Sat, 14 Mar 2020 21:29:25 +0000 (21:29 +0000)] 
reader: reuse client_{open,close}_proxy more

Currently we have open-coded versions. Replace them with the respective
functions.

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
4 years agoarchive: remove ::compression_{code,name}
Emil Velikov [Fri, 17 Apr 2020 21:13:54 +0000 (22:13 +0100)] 
archive: remove ::compression_{code,name}

These internal variables were set but never used. Remove them.

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
4 years agoreader: transform get_bidder into register_bidder
Emil Velikov [Sat, 23 Oct 2021 17:22:05 +0000 (18:22 +0100)] 
reader: transform get_bidder into register_bidder

There's a notable duplication across all the read bidder code.

Check the archive magic/state, set the bidder private data (to NULL in
all but one case), name and vtable.

Change the helper to do the actual registration, keeping things simpler
in the dozen+ filters. This also allows us to enforce the bidder ::bid
and ::init dispatch are non NULL. The final one ::free is optional.

NOTE: some of the bidders do _not_ set a name, which I suspect is a
pre-existing bug. I've left them as-is, but we might want to fix and
enforce that somehow.

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
4 years agoreader: introduce archive_read_filter_bidder::vtable
Emil Velikov [Sat, 14 Mar 2020 15:47:22 +0000 (15:47 +0000)] 
reader: introduce archive_read_filter_bidder::vtable

Provides a clear separation between RW data and RO executable code.

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
4 years agoreader: remove the return type of archive_read_filter_bidder_vtable::free
Emil Velikov [Sun, 15 Mar 2020 15:44:26 +0000 (15:44 +0000)] 
reader: remove the return type of archive_read_filter_bidder_vtable::free

From over a dozen filters, only one instance has the vfunc... Always
returning ARCHIVE_OK.

Let's just remove the return type.

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
4 years agoreader: remove archive_read_filter_bidder_vtable::free stubs
Emil Velikov [Sat, 14 Mar 2020 17:05:41 +0000 (17:05 +0000)] 
reader: remove archive_read_filter_bidder_vtable::free stubs

There is no point in having stubs around. The caller already checks if
the function pointer is NULL before calling it.

With this in place only one implementation remains in filter_program.

Technically we can rework/remove that as well, although the solution
might not be so clean, so let's keep that for another day.

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
4 years agoreader: remove unused read_filter_bidder::options
Emil Velikov [Sat, 14 Mar 2020 16:01:11 +0000 (16:01 +0000)] 
reader: remove unused read_filter_bidder::options

None of the filters set ::options and based on git log, none of them
ever did despite that the API/infra was added over 10 years ago.

Let's just drop it, removing the majority of archive_set_filter_option()
which is essentially dead code.

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
4 years agoarchive: constify the archive::vtable dispatch
Emil Velikov [Wed, 26 Feb 2020 16:11:38 +0000 (16:11 +0000)] 
archive: constify the archive::vtable dispatch

Currently we have a constant dispatch/vtable that we populate at runtime
for unknown reason.

Remove the functions doing all the work and use a simple static const
struct archive_vtable.

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
4 years agoeditorconfig: add simple top-level file 1602/head
Emil Velikov [Sat, 23 Oct 2021 14:32:12 +0000 (15:32 +0100)] 
editorconfig: add simple top-level file

Add a simple top-level .editorconfig file to manage common attributes
such as indentation style, trailing whitespace and newline at end of
file. The format is wide spread and has support for nearly every editor
out there - see https://editorconfig.org/ for more.

Majority of the project is C - which uses tabs, although there are some
CMake files using 2 space indent and shell scripts - predominantly using
4 space indent.

This makes it harder for casual contributors to butcher things :-)

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
4 years agomtree reader: return early, remove fallthrough chain 1601/head
Emil Velikov [Sat, 23 Oct 2021 13:42:55 +0000 (14:42 +0100)] 
mtree reader: return early, remove fallthrough chain

Remove the excessive fallthrough chain in parse_keyword(). Even though
it is in the else/error path, there is no point in comparing the key
another dozen (or more) times when we know it will fail.

Just use an early return (OK) or break respectively.

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
4 years agoAdding test to Makefile.am
jiat75 [Tue, 19 Oct 2021 14:56:50 +0000 (22:56 +0800)] 
Adding test to Makefile.am

4 years agoAdded copyright to new test file.
jiat75 [Tue, 19 Oct 2021 14:33:10 +0000 (22:33 +0800)] 
Added copyright to new test file.

4 years agoAdded new test to cmake lists
jiat75 [Tue, 19 Oct 2021 13:45:58 +0000 (21:45 +0800)] 
Added new test to cmake lists

4 years agoAdded assertions for folder
jiat75 [Sun, 17 Oct 2021 02:37:22 +0000 (10:37 +0800)] 
Added assertions for folder

4 years agoAdded test for writing an zip file without entry size and no compression
jiat75 [Sun, 17 Oct 2021 01:52:13 +0000 (09:52 +0800)] 
Added test for writing an zip file without entry size and no compression

4 years agoOnly use deflate when size is not set if the user did not specify a compression algorithm
jiat75 [Sat, 16 Oct 2021 07:33:25 +0000 (15:33 +0800)] 
Only use deflate when size is not set if the user did not specify a compression algorithm

4 years agoAdd support for rar5 sfx files 1585/head
JFranklin13 [Thu, 14 Oct 2021 11:53:16 +0000 (13:53 +0200)] 
Add support for rar5 sfx files

4 years agoAdded bin folder to .gitignore 1593/head
jiat75 [Sat, 9 Oct 2021 05:58:44 +0000 (13:58 +0800)] 
Added bin folder to .gitignore

4 years agoRemoved unused function. 1589/head
jiat75 [Thu, 7 Oct 2021 14:43:08 +0000 (22:43 +0800)] 
Removed unused function.

4 years agoAdded all exported but undocumented functions to man pages
jiat75 [Wed, 6 Oct 2021 10:58:44 +0000 (18:58 +0800)] 
Added all exported but undocumented functions to man pages

4 years agoSupport ARCHIVE_EXTRACT_SECURE_NODOTDOT on Windows 1590/head
Joerg Sonnenberger [Wed, 6 Oct 2021 22:24:30 +0000 (00:24 +0200)] 
Support ARCHIVE_EXTRACT_SECURE_NODOTDOT on Windows

4 years agoadd test 1503/head
Wei-Cheng Pan [Thu, 30 Sep 2021 12:20:21 +0000 (21:20 +0900)] 
add test

4 years agoadded missing checks for canLzip, canLzma, and canXz
jiat75 [Sun, 3 Oct 2021 07:23:28 +0000 (15:23 +0800)] 
added missing checks for canLzip, canLzma, and canXz

4 years agosupport rar filters
Wei-Cheng Pan [Mon, 15 Feb 2021 16:08:55 +0000 (01:08 +0900)] 
support rar filters

4 years agoMake all the implicit cast explicit. 1588/head
IohannRabeson [Sun, 3 Oct 2021 06:07:37 +0000 (02:07 -0400)] 
Make all the implicit cast explicit.

To prevent conversion warning preventing to build on Windows.

4 years agoMerge pull request #1575 from Hello71/patch-1
Martin Matuška [Thu, 30 Sep 2021 13:41:29 +0000 (15:41 +0200)] 
Merge pull request #1575 from Hello71/patch-1

libarchive.3: update archive format list

4 years agoMerge pull request #1567 from russelltg/russell_zstd_threads
Martin Matuška [Thu, 30 Sep 2021 11:20:05 +0000 (13:20 +0200)] 
Merge pull request #1567 from russelltg/russell_zstd_threads

zstd filter writer: add threads option

4 years agoMerge pull request #1569 from ferivoz/dir
Martin Matuška [Thu, 30 Sep 2021 11:17:34 +0000 (13:17 +0200)] 
Merge pull request #1569 from ferivoz/dir

Ignore size of directories with regular type

4 years agolibarchive.3: update archive format list 1575/head
Alex Xu [Fri, 17 Sep 2021 02:33:55 +0000 (02:33 +0000)] 
libarchive.3: update archive format list

Add 7-Zip and WARC to read formats, add many compressors, sort lists in approximate lexicographical order.

4 years agoAdded test case for ustar directory handling 1569/head
Samanta Navarro [Sun, 29 Aug 2021 11:59:29 +0000 (11:59 +0000)] 
Added test case for ustar directory handling

Based on test_compat_tar_hardlink.c and with input by Tim Kientzle.

4 years agoMerge pull request #1570 from ferivoz/mac
Martin Matuška [Sat, 4 Sep 2021 22:28:16 +0000 (00:28 +0200)] 
Merge pull request #1570 from ferivoz/mac

Fix size_t cast in read_mac_metadata_blob

4 years agoIgnore size of directories with regular type
Samanta Navarro [Sat, 28 Aug 2021 11:53:24 +0000 (11:53 +0000)] 
Ignore size of directories with regular type

In old tar formats directories are specified by appending a slash to
their names.

Directories may have sizes, but they do not have data blocks. Keep this
in mind and avoid skipping data blocks when encountering directories.

4 years agoFix size_t cast in read_mac_metadata_blob 1570/head
Samanta Navarro [Sat, 28 Aug 2021 11:58:00 +0000 (11:58 +0000)] 
Fix size_t cast in read_mac_metadata_blob

The size_t data type on 32 bit systems is smaller than int64_t. Check
the int64_t value before casting to size_t. If the value is too large
then stop operation instead of continuing operation with truncated
value.

4 years agoarchive_write_set_format_cpio_binary: fix compilation on OpenBSD
Martin Matuska [Fri, 27 Aug 2021 16:04:59 +0000 (18:04 +0200)] 
archive_write_set_format_cpio_binary: fix compilation on OpenBSD

Rename swap16 and swap32 to la_swap16 and la_swap32.

4 years agoFix following symlinks when processing the fixup list
Martin Matuska [Fri, 27 Aug 2021 08:56:28 +0000 (10:56 +0200)] 
Fix following symlinks when processing the fixup list

The previous fix in b41daecb5 was incomplete. Fixup entries are
given the original path without calling cleanup_pathname().
To make sure we don't follow a symlink, we must strip trailing
slashes from the path.

The fixup entries are always directories. Make sure we try to modify
only directories by providing O_DIRECTORY to open() (if supported)
and if it fails to check directory via lstat().

Fixes #1566

4 years agofix --threads commandline 1567/head
Russell Greene [Wed, 25 Aug 2021 17:26:48 +0000 (13:26 -0400)] 
fix --threads commandline

4 years agozstd filter writer: add threads option
Russell Greene [Wed, 25 Aug 2021 16:09:19 +0000 (12:09 -0400)] 
zstd filter writer: add threads option

4 years agoCI: provide a more complete Ubuntu package list
Martin Matuska [Sun, 22 Aug 2021 23:06:27 +0000 (01:06 +0200)] 
CI: provide a more complete Ubuntu package list

4 years agoLibarchive 3.5.3dev
Martin Matuska [Sun, 22 Aug 2021 22:50:26 +0000 (00:50 +0200)] 
Libarchive 3.5.3dev

4 years agoRelease 3.5.2 v3.5.2
Martin Matuska [Sun, 22 Aug 2021 15:33:36 +0000 (17:33 +0200)] 
Release 3.5.2

4 years agoSkip archive_write_disk_fixup test on Windows
Martin Matuska [Sun, 22 Aug 2021 13:53:31 +0000 (15:53 +0200)] 
Skip archive_write_disk_fixup test on Windows

4 years agoDo not follow symlinks when processing the fixup list
Martin Matuska [Thu, 19 Aug 2021 23:50:27 +0000 (01:50 +0200)] 
Do not follow symlinks when processing the fixup list

Use lchmod() instead of chmod() and tell the remaining functions that the
real file to be modified is a symbolic link.

Fixes #1566

4 years agoNever follow symlinks when setting file flags on Linux
Martin Matuska [Sun, 22 Aug 2021 01:53:28 +0000 (03:53 +0200)] 
Never follow symlinks when setting file flags on Linux

When opening a file descriptor to set file flags on linux, ensure
no symbolic links are followed. This fixes the case when an archive
contains a directory entry followed by a symlink entry with the same
path. The fixup code would modify file flags of the symlink target.

4 years agoFix handling of symbolic link ACLs
Martin Matuska [Sat, 21 Aug 2021 18:51:07 +0000 (20:51 +0200)] 
Fix handling of symbolic link ACLs

On Linux ACLs on symbolic links are not supported.
We must avoid calling acl_set_file() on symbolic links as their
targets are modified instead.

While here, do not try to set default ACLs on non-directories.

Fixes #1565

4 years agowrite_disk_posix: rename variable in check_symlinks_fsobj()
Martin Matuska [Sat, 21 Aug 2021 07:07:54 +0000 (09:07 +0200)] 
write_disk_posix: rename variable in check_symlinks_fsobj()

Rename the flag "extracting_hardlink" to "checking_linkname" to
be more accurate about its use. If the variable is non-zero it
means that check_symlinks_fsobj() is called on the linkname
when a hardlink is going to be created.

4 years agoFix extracting hardlinks to symlinks
Martin Matuska [Fri, 20 Aug 2021 23:39:31 +0000 (01:39 +0200)] 
Fix extracting hardlinks to symlinks

On platforms that support the linkat(2) function we can safely
write hardlinks to symlinks as linkat(2) does not follow symlinks
by default.

Fixes #1044

4 years agoAdd ability to skip atime test in directory traversals
Martin Matuska [Fri, 20 Aug 2021 09:58:41 +0000 (11:58 +0200)] 
Add ability to skip atime test in directory traversals

4 years agoCI: Add FreeBSD 13.0 to Cirrus CI build
Martin Matuska [Wed, 12 May 2021 07:52:44 +0000 (09:52 +0200)] 
CI: Add FreeBSD 13.0 to Cirrus CI build

4 years agoMerge pull request #1542 from ferivoz/intmax
Martin Matuška [Sat, 17 Jul 2021 22:49:43 +0000 (00:49 +0200)] 
Merge pull request #1542 from ferivoz/intmax

Handle all negative int64_t values in mtree/tar

4 years agoMerge pull request #1552 from AndyBrown91/windows-long-path-fix
Martin Matuška [Sat, 17 Jul 2021 22:35:03 +0000 (00:35 +0200)] 
Merge pull request #1552 from AndyBrown91/windows-long-path-fix

Windows: Use full path including prefix when looking up file handle

4 years agoWindows: Use full path including prefix when looking up file handle 1552/head
Andy Brown [Tue, 13 Jul 2021 12:05:19 +0000 (13:05 +0100)] 
Windows: Use full path including prefix when looking up file handle

4 years agoMerge pull request #1540 from ferivoz/typos
Martin Matuška [Wed, 30 Jun 2021 08:24:56 +0000 (10:24 +0200)] 
Merge pull request #1540 from ferivoz/typos

Fix typos

4 years agoMerge pull request #1541 from ferivoz/mutual
Martin Matuška [Wed, 30 Jun 2021 08:23:23 +0000 (10:23 +0200)] 
Merge pull request #1541 from ferivoz/mutual

Fix mutual check in tar sparse handling

4 years agoFix mutual check in tar sparse handling 1541/head
Samanta Navarro [Tue, 1 Jun 2021 11:26:30 +0000 (11:26 +0000)] 
Fix mutual check in tar sparse handling

GNU.sparse.numbytes and GNU.sparse.offset both have to be set before
gnu_add_sparse_entry can be called.

The GNU.sparse.numbytes parser checks for tar->sparse_numbytes.
This has to be tar->sparse_offset instead to work just like the
GNU.sparse.offset parser.

4 years agoFix typos 1540/head
Samanta Navarro [Tue, 1 Jun 2021 11:26:02 +0000 (11:26 +0000)] 
Fix typos

Typos found with codespell

4 years agoHandle all negative int64_t values in mtree/tar 1542/head
Samanta Navarro [Tue, 1 Jun 2021 11:25:03 +0000 (11:25 +0000)] 
Handle all negative int64_t values in mtree/tar

The variable last_digit_limit is negative since INT64_MIN itself is
negative as well. This means that the last digit after "limit" always
leads to maxval.

Turning last_digit_limit positive in itself is not sufficient because
it would lead to a signed integer overflow during shift operation.

If limit is reached and the last digit is last_digit_limit, the number
is at least maxval. The already existing if condition for even larger
(or smaller) values can be reused to prevent the last shift.

In my humble opinion it might make sense to reduce duplicated code and
keep it separated in a utility source file for shared use.

4 years agoRestore comment formatting
Joerg Sonnenberger [Sun, 30 May 2021 21:01:12 +0000 (23:01 +0200)] 
Restore comment formatting

4 years agoMerge pull request #1532 from Gei0r/master
Martin Matuška [Thu, 27 May 2021 09:33:19 +0000 (11:33 +0200)] 
Merge pull request #1532 from Gei0r/master

7zip: Use compression settings from file also for file header

4 years agoMerge pull request #1530 from owtaylor/close-short-writes
Martin Matuška [Thu, 27 May 2021 09:32:21 +0000 (11:32 +0200)] 
Merge pull request #1530 from owtaylor/close-short-writes

On close, handle short writes from archive_write_callback

4 years agoMerge pull request #1529 from owtaylor/getcwd
Martin Matuška [Thu, 27 May 2021 09:32:02 +0000 (11:32 +0200)] 
Merge pull request #1529 from owtaylor/getcwd

Avoid getcwd(0, PATH_MAX) for GNU libc

4 years agoMerge pull request #1509 from mariXanna/fix/#1508
Martin Matuška [Thu, 27 May 2021 07:11:12 +0000 (09:11 +0200)] 
Merge pull request #1509 from mariXanna/fix/#1508

Added support of deflate algorithm in symbolic link decompression for zip archives

4 years agoUse tabs for indentation 1532/head
Adrian Ebeling [Wed, 19 May 2021 06:52:27 +0000 (08:52 +0200)] 
Use tabs for indentation

4 years ago7zip: Use compression settings for file header
Adrian Ebeling [Mon, 17 May 2021 19:11:38 +0000 (21:11 +0200)] 
7zip: Use compression settings for file header

5 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.

5 years agoAvoid getcwd(0, PATH_MAX) for GNU libc 1529/head
Owen W. Taylor [Wed, 12 May 2021 20:37:16 +0000 (16:37 -0400)] 
Avoid getcwd(0, PATH_MAX) for GNU libc

Recent versions of GNU libc and GCC produce a warning on getcwd(0, PATH_MAX):

 test_main.c: In function ‘get_refdir’:
 test_main.c:3684:8: error: argument 1 is null but the corresponding size argument 2 value is 4096 [-Werror=nonnull]
   3684 |  pwd = getcwd(NULL, PATH_MAX);/* Solaris getcwd needs the size. */

This is because getcwd() is marked with the 'write_only (1, 2)' attribute.

Using the alternate getcwd(NULL, 0) path which is supported by GNU libc avoids this.

5 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

5 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.

5 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-

5 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

5 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.

5 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.

5 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'

5 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

5 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.

5 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

5 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

5 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

5 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.