]> git.ipfire.org Git - thirdparty/libarchive.git/log
thirdparty/libarchive.git
89 min agoMerge pull request #3362 from stoeckmann/filter_bits master
Dustin L. Howett [Mon, 10 Aug 2026 05:53:31 +0000 (00:53 -0500)] 
Merge pull request #3362 from stoeckmann/filter_bits

35 hours agoMerge pull request #3365 from moodyastra/codex/libarchive-lzx-history-guard
Dustin L. Howett [Sat, 8 Aug 2026 19:38:09 +0000 (14:38 -0500)] 
Merge pull request #3365 from moodyastra/codex/libarchive-lzx-history-guard

cab: reject LZX matches before initialized history

36 hours agocab: reject LZX matches before initialized history 3365/head
Malachi Moody [Sat, 8 Aug 2026 18:48:40 +0000 (13:48 -0500)] 
cab: reject LZX matches before initialized history

36 hours agotests: reproduce invalid CAB LZX history reference
Malachi Moody [Sat, 8 Aug 2026 18:48:34 +0000 (13:48 -0500)] 
tests: reproduce invalid CAB LZX history reference

37 hours agoMerge pull request #3340 from subotac/fix/7zip-ppmd-small-read-buffer
Dustin L. Howett [Sat, 8 Aug 2026 18:10:12 +0000 (13:10 -0500)] 
Merge pull request #3340 from subotac/fix/7zip-ppmd-small-read-buffer

7zip: Track PPMd input across read blocks

37 hours agoMerge pull request #3354 from subotac/fix/write-close-fatal-state
Dustin L. Howett [Sat, 8 Aug 2026 18:08:07 +0000 (13:08 -0500)] 
Merge pull request #3354 from subotac/fix/write-close-fatal-state

Return fatal when closing a failed writer

39 hours agoMerge pull request #3348 from stoeckmann/signature_len
Tobias Stoeckmann [Sat, 8 Aug 2026 15:54:31 +0000 (17:54 +0200)] 
Merge pull request #3348 from stoeckmann/signature_len

program: Avoid signature length overflow

43 hours ago7zip: Track PPMd input across read blocks 3340/head
subotac [Sat, 8 Aug 2026 11:48:15 +0000 (14:48 +0300)] 
7zip: Track PPMd input across read blocks

PPMd pulls input through its byte callback, so the regular input buffer does not track bytes consumed after crossing a read-block boundary. Advance the packed stream using the callback count and reject reads beyond the remaining packed data.

Resolves #3337

43 hours ago7zip: Add PPMd small read block regression test
subotac [Sat, 8 Aug 2026 11:31:35 +0000 (14:31 +0300)] 
7zip: Add PPMd small read block regression test

The fixture and reproducer are based on the archive and report provided by @004helix in #3337.

43 hours agoReturn fatal when closing a failed writer 3354/head
subotac [Sat, 8 Aug 2026 11:31:04 +0000 (14:31 +0300)] 
Return fatal when closing a failed writer

Once an archive writer enters the fatal state, close should report that failure instead of proceeding as though it were usable.

Resolves #3353

43 hours agotests: Cover closing a failed writer
subotac [Sat, 8 Aug 2026 11:31:04 +0000 (14:31 +0300)] 
tests: Cover closing a failed writer

2 days agoMerge pull request #3363 from dnelson-1901/zero-tm
Dustin L. Howett [Sat, 8 Aug 2026 03:39:45 +0000 (22:39 -0500)] 
Merge pull request #3363 from dnelson-1901/zero-tm

2 days agorar: zero out stack-allocated struct tm before calling mktime() 3363/head
Dan Nelson [Thu, 6 Aug 2026 03:21:38 +0000 (22:21 -0500)] 
rar: zero out stack-allocated struct tm before calling mktime()

Caught by valgrind

2 days agoMerge pull request #3357 from dnelson-1901/remove-cat
Dustin L. Howett [Fri, 7 Aug 2026 22:58:10 +0000 (17:58 -0500)] 
Merge pull request #3357 from dnelson-1901/remove-cat

tar: manually combine test files instead of calling cat

2 days agoMerge pull request #3298 from DHowett/iso9660-nm-loop
Dustin L. Howett [Fri, 7 Aug 2026 22:57:32 +0000 (17:57 -0500)] 
Merge pull request #3298 from DHowett/iso9660-nm-loop

iso9660: rewrite the "NM" extension generator for clarity

2 days agoiso9660: rewrite the "NM" extension generator for clarity 3298/head
Dustin L. Howett [Fri, 17 Jul 2026 00:33:20 +0000 (19:33 -0500)] 
iso9660: rewrite the "NM" extension generator for clarity

There are other such generators in this code, but this one was the
subject of a recent bug. It was unclear how it worked, since it broke
writing the header, continuation and final entries into three different
places.

I feel this version is more intuitive.

2 days agoMerge pull request #3360 from subotac/fix/windows-empty-wcs-conversion
Dustin L. Howett [Fri, 7 Aug 2026 21:51:03 +0000 (16:51 -0500)] 
Merge pull request #3360 from subotac/fix/windows-empty-wcs-conversion

2 days agolz4/zstd: Count bits in bidder, not bytes 3362/head
Tobias Stoeckmann [Fri, 7 Aug 2026 20:40:33 +0000 (22:40 +0200)] 
lz4/zstd: Count bits in bidder, not bytes

All other filters count bits as bidding result. Do so here as well.

Signed-off-by: Tobias Stoeckmann <tobias@stoeckmann.org>
2 days agolz4/zstd: Always check upper bid byte limit
Tobias Stoeckmann [Fri, 7 Aug 2026 20:27:58 +0000 (22:27 +0200)] 
lz4/zstd: Always check upper bid byte limit

If upstream filter provides huge amount of bytes, e.g. if archive is
fully stored in memory, bidding accesses too many bytes. This could in
turn overflow int return value, possibly leading to signed integer
overflows.

Signed-off-by: Tobias Stoeckmann <tobias@stoeckmann.org>
2 days agozstd: Remove redundant errno.h include
Tobias Stoeckmann [Fri, 7 Aug 2026 20:27:33 +0000 (22:27 +0200)] 
zstd: Remove redundant errno.h include

Signed-off-by: Tobias Stoeckmann <tobias@stoeckmann.org>
3 days agoFix empty wide string conversion on Windows 3360/head
subotac [Thu, 6 Aug 2026 18:29:20 +0000 (21:29 +0300)] 
Fix empty wide string conversion on Windows

3 days agoMerge pull request #3356 from dunhor/windows-clang-fixes
Dustin L. Howett [Thu, 6 Aug 2026 16:38:16 +0000 (11:38 -0500)] 
Merge pull request #3356 from dunhor/windows-clang-fixes

Fix a number of Windows/clang(-cl) issues

4 days agotar: manually combine test files instead of calling cat 3357/head
Dan Nelson [Wed, 5 Aug 2026 19:01:20 +0000 (14:01 -0500)] 
tar: manually combine test files instead of calling cat

Lets the --ignore-zeros tests run on Windows

4 days agoMerge pull request #3341 from subotac/fix/root-absolute-path-test
Dustin L. Howett [Thu, 6 Aug 2026 01:26:26 +0000 (20:26 -0500)] 
Merge pull request #3341 from subotac/fix/root-absolute-path-test

4 days agoFix a number of Windows/clang(-cl) issues 3356/head
Duncan Horn [Wed, 5 Aug 2026 23:44:08 +0000 (16:44 -0700)] 
Fix a number of Windows/clang(-cl) issues

6 days agoMerge pull request #3345 from PeiweiHu/peiwei_fix
Tim Kientzle [Tue, 4 Aug 2026 05:16:19 +0000 (22:16 -0700)] 
Merge pull request #3345 from PeiweiHu/peiwei_fix

Fix bsdtar’s `@archive` handling by freeing input readers after open failures and applying passphrases to the correct reader object.

6 days agoMerge pull request #3351 from stoeckmann/support_format
Dustin L. Howett [Mon, 3 Aug 2026 22:26:03 +0000 (17:26 -0500)] 
Merge pull request #3351 from stoeckmann/support_format

format: Improve format registration error handling

6 days agoformat: Unify support_format styles 3351/head
Tobias Stoeckmann [Mon, 3 Aug 2026 16:50:17 +0000 (18:50 +0200)] 
format: Unify support_format styles

Use same style across all formats for easier audits.

Signed-off-by: Tobias Stoeckmann <tobias@stoeckmann.org>
6 days agoformat: Unify support_format error handling
Tobias Stoeckmann [Mon, 3 Aug 2026 16:43:26 +0000 (18:43 +0200)] 
format: Unify support_format error handling

Always return r to unify style for easier audits.

Signed-off-by: Tobias Stoeckmann <tobias@stoeckmann.org>
6 days agoformat: Forward errors/warnings in support_format
Tobias Stoeckmann [Mon, 3 Aug 2026 16:32:28 +0000 (18:32 +0200)] 
format: Forward errors/warnings in support_format

If registering a format parser bidder fails or triggers a warning,
forward the information instead of silently turning it into ARCHIVE_OK.

Signed-off-by: Tobias Stoeckmann <tobias@stoeckmann.org>
6 days agoformat: Test error handling in support_format
Tobias Stoeckmann [Mon, 3 Aug 2026 16:19:23 +0000 (18:19 +0200)] 
format: Test error handling in support_format

Make sure that all formats return a warning if registered multiple
times.

Signed-off-by: Tobias Stoeckmann <tobias@stoeckmann.org>
6 days agoMerge pull request #3347 from datauwu/archive-write-share-hdrcharset
Dustin L. Howett [Mon, 3 Aug 2026 17:51:31 +0000 (12:51 -0500)] 
Merge pull request #3347 from datauwu/archive-write-share-hdrcharset

archive_write: share hdrcharset option handling

6 days agoMerge pull request #3346 from stoeckmann/append_filter_desync
Dustin L. Howett [Mon, 3 Aug 2026 17:48:35 +0000 (12:48 -0500)] 
Merge pull request #3346 from stoeckmann/append_filter_desync

Always attach filter to correct bidder

6 days agoMerge pull request #3350 from libarchive/dependabot/github_actions/all-actions-4f142db38a
Dustin L. Howett [Mon, 3 Aug 2026 17:07:32 +0000 (12:07 -0500)] 
Merge pull request #3350 from libarchive/dependabot/github_actions/all-actions-4f142db38a

CI: Bump the all-actions group with 4 updates

6 days agoCI: Bump the all-actions group with 4 updates 3350/head
dependabot[bot] [Mon, 3 Aug 2026 16:18:20 +0000 (16:18 +0000)] 
CI: Bump the all-actions group with 4 updates

Bumps the all-actions group with 4 updates: [github/codeql-action/init](https://github.com/github/codeql-action), [github/codeql-action/autobuild](https://github.com/github/codeql-action), [github/codeql-action/analyze](https://github.com/github/codeql-action) and [github/codeql-action/upload-sarif](https://github.com/github/codeql-action).

Updates `github/codeql-action/init` from 4.37.3 to 4.37.4
- [Release notes](https://github.com/github/codeql-action/releases)
- [Changelog](https://github.com/github/codeql-action/blob/main/CHANGELOG.md)
- [Commits](https://github.com/github/codeql-action/compare/e4fba868fa4b1b91e1fdab776edc8cfbe6e9fb81...f205ea1c3313d32999d8d6a48b4f6530d4437b38)

Updates `github/codeql-action/autobuild` from 4.37.3 to 4.37.4
- [Release notes](https://github.com/github/codeql-action/releases)
- [Changelog](https://github.com/github/codeql-action/blob/main/CHANGELOG.md)
- [Commits](https://github.com/github/codeql-action/compare/e4fba868fa4b1b91e1fdab776edc8cfbe6e9fb81...f205ea1c3313d32999d8d6a48b4f6530d4437b38)

Updates `github/codeql-action/analyze` from 4.37.3 to 4.37.4
- [Release notes](https://github.com/github/codeql-action/releases)
- [Changelog](https://github.com/github/codeql-action/blob/main/CHANGELOG.md)
- [Commits](https://github.com/github/codeql-action/compare/e4fba868fa4b1b91e1fdab776edc8cfbe6e9fb81...f205ea1c3313d32999d8d6a48b4f6530d4437b38)

Updates `github/codeql-action/upload-sarif` from 4.37.3 to 4.37.4
- [Release notes](https://github.com/github/codeql-action/releases)
- [Changelog](https://github.com/github/codeql-action/blob/main/CHANGELOG.md)
- [Commits](https://github.com/github/codeql-action/compare/e4fba868fa4b1b91e1fdab776edc8cfbe6e9fb81...f205ea1c3313d32999d8d6a48b4f6530d4437b38)

---
updated-dependencies:
- dependency-name: github/codeql-action/init
  dependency-version: 4.37.4
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: all-actions
- dependency-name: github/codeql-action/autobuild
  dependency-version: 4.37.4
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: all-actions
- dependency-name: github/codeql-action/analyze
  dependency-version: 4.37.4
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: all-actions
- dependency-name: github/codeql-action/upload-sarif
  dependency-version: 4.37.4
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: all-actions
...

Signed-off-by: dependabot[bot] <support@github.com>
6 days agoarchive_write: share hdrcharset option handling 3347/head
datauwu [Sun, 2 Aug 2026 15:30:13 +0000 (23:30 +0800)] 
archive_write: share hdrcharset option handling

Several archive writers duplicate identical hdrcharset option handling.
Share the validation and conversion logic across the affected cpio, tar,
and zip writers.

This reduces duplication without changing behavior.

7 days agoMerge pull request #3312 from datauwu/formats-use-strrchr
Dustin L. Howett [Mon, 3 Aug 2026 04:53:08 +0000 (23:53 -0500)] 
Merge pull request #3312 from datauwu/formats-use-strrchr

7 days agobsdtar: apply passphrase to appended archive reader 3345/head
Peiwei Hu [Mon, 3 Aug 2026 00:49:58 +0000 (08:49 +0800)] 
bsdtar: apply passphrase to appended archive reader

When creating an archive from an @archive argument, configure the
input reader rather than passing the output writer to
archive_read_add_passphrase(). Use the reader for error reporting as
well.

7 days agobsdtar: test passphrase for appended archives
Peiwei Hu [Mon, 3 Aug 2026 00:49:51 +0000 (08:49 +0800)] 
bsdtar: test passphrase for appended archives

Exercise --passphrase while copying entries from an encrypted
@archive into a new archive, then extract the result and verify the
copied file contents.

7 days agoprogram: Avoid signature length overflow 3348/head
Tobias Stoeckmann [Sun, 2 Aug 2026 20:12:56 +0000 (22:12 +0200)] 
program: Avoid signature length overflow

If a signature is too large, the bid value could overflow INT_MAX. With
its current implementation, it could even lead to a signed integer
overflow, which is undefined behavior.

Disallow huge signatures, which most likely won't impact anyone.

Signed-off-by: Tobias Stoeckmann <tobias@stoeckmann.org>
7 days agobsdtar: free reader after failed archive open
Peiwei Hu [Sun, 2 Aug 2026 09:41:43 +0000 (17:41 +0800)] 
bsdtar: free reader after failed archive open

append_archive_filename() returns after reporting an input archive open
failure so archive creation can continue. Release the input archive
reader before returning to avoid accumulating one reader for every
failed @archive argument.

7 days agoMerge pull request #3343 from dnelson-1901/tar-mode
Tim Kientzle [Sun, 2 Aug 2026 14:34:39 +0000 (07:34 -0700)] 
Merge pull request #3343 from dnelson-1901/tar-mode

tar: add --mode option for GNU tar compatibility

7 days agoRemove bidder name 3346/head
Tobias Stoeckmann [Sun, 2 Aug 2026 12:31:33 +0000 (14:31 +0200)] 
Remove bidder name

The name was only needed to find the appropriate bidder for a filter.
Since this has been resolved by accessing the last bidder, since in these
situations the bidder is added first, then the filter, the name is not
needed anymore.

Signed-off-by: Tobias Stoeckmann <tobias@stoeckmann.org>
7 days agoappend_filter: Use last bidder for filter
Tobias Stoeckmann [Sun, 2 Aug 2026 12:27:17 +0000 (14:27 +0200)] 
append_filter: Use last bidder for filter

Appending a filter implies appending a bidder. Always use the last added
bidder, since it was just added. This avoids desync situations where
previously added bidders could erroneously match.

Signed-off-by: Tobias Stoeckmann <tobias@stoeckmann.org>
7 days agoappend_filter: Verify that bidder and filter match
Tobias Stoeckmann [Sun, 2 Aug 2026 12:26:22 +0000 (14:26 +0200)] 
append_filter: Verify that bidder and filter match

Make sure that appending a filter always matches its supposed bidder.

Signed-off-by: Tobias Stoeckmann <tobias@stoeckmann.org>
8 days agotar: handle --mode when extracting archives also 3343/head
Dan Nelson [Thu, 30 Jul 2026 14:31:57 +0000 (09:31 -0500)] 
tar: handle --mode when extracting archives also

8 days agotar: add --mode option (compatible with gnutar)
Dan Nelson [Fri, 24 Jul 2026 05:02:05 +0000 (00:02 -0500)] 
tar: add --mode option (compatible with gnutar)

8 days agoMerge pull request #3344 from datauwu/warc-fix-ub
Tim Kientzle [Sat, 1 Aug 2026 19:58:35 +0000 (12:58 -0700)] 
Merge pull request #3344 from datauwu/warc-fix-ub

warc: fix UB signed overflow in time conversion

8 days agowarc: fix UB signed overflow in time conversion 3344/head
datauwu [Sat, 1 Aug 2026 18:57:11 +0000 (02:57 +0800)] 
warc: fix UB signed overflow in time conversion

Use checked 64-bit math when timegm() is not available.
Reject values outside time_t instead of overflowing signed integers.

8 days agowarc: test future date conversion
datauwu [Sat, 1 Aug 2026 18:57:01 +0000 (02:57 +0800)] 
warc: test future date conversion

Add a WARC date after 2038 to cover the fallback time conversion.
On 64-bit time_t, it must parse as the expected Unix timestamp.

8 days agoMerge pull request #3342 from datauwu/bsdcpio-fix-ub
Tim Kientzle [Sat, 1 Aug 2026 15:54:01 +0000 (08:54 -0700)] 
Merge pull request #3342 from datauwu/bsdcpio-fix-ub

bsdcpio: fix UB signed overflow in time formatting

8 days agobsdtar: fix UB signed overflow in time formatting 3342/head
datauwu [Sat, 1 Aug 2026 11:48:39 +0000 (19:48 +0800)] 
bsdtar: fix UB signed overflow in time formatting

Use difftime() instead of changing time_t values by the half-year
range. This avoids signed overflow near the time_t limits without
changing normal output.

8 days agobsdcpio: fix UB signed overflow in time formatting
datauwu [Sat, 1 Aug 2026 11:48:38 +0000 (19:48 +0800)] 
bsdcpio: fix UB signed overflow in time formatting

Use difftime() instead of subtracting time_t values when choosing the
date format. This avoids signed overflow for far past or future
timestamps without changing normal output.

9 days agoClarify absolute path test extraction roots 3341/head
subotac [Fri, 31 Jul 2026 17:26:23 +0000 (20:26 +0300)] 
Clarify absolute path test extraction roots

9 days agoMerge pull request #3335 from jaipaulcheernam/fix/skip-ppmd8-aes256-test-without...
Dustin L. Howett [Fri, 31 Jul 2026 14:22:42 +0000 (09:22 -0500)] 
Merge pull request #3335 from jaipaulcheernam/fix/skip-ppmd8-aes256-test-without-crypto

10 days agoMerge pull request #3339 from datauwu/archive-string-fix-build
Dustin L. Howett [Thu, 30 Jul 2026 23:21:32 +0000 (18:21 -0500)] 
Merge pull request #3339 from datauwu/archive-string-fix-build

10 days agoFix absolute path test when run as root
subotac [Thu, 30 Jul 2026 15:40:17 +0000 (18:40 +0300)] 
Fix absolute path test when run as root

10 days agoarchive_string: require localcharset.h for locale_charset 3339/head
datauwu [Thu, 30 Jul 2026 08:20:51 +0000 (16:20 +0800)] 
archive_string: require localcharset.h for locale_charset

Only call locale_charset() when localcharset.h provides its declaration.

11 days agotest: skip ppmd8 aes256 streaming test when no crypto library is present 3335/head
Jaipaul Cheernam [Wed, 29 Jul 2026 13:33:10 +0000 (13:33 +0000)] 
test: skip ppmd8 aes256 streaming test when no crypto library is present

test_read_format_zip_ppmd8_aes256_streaming fails with 6 assertion
failures on systems without a crypto library (openssl/nettle/mbedtls)
because it tries to decrypt a pre-built encrypted zipx file without
checking crypto availability first.

Add the same guard used by the other encrypted zip tests in this file.

Signed-off-by: Jaipaul Cheernam <jaipaul.cheernam@est.tech>
12 days agoMerge pull request #3320 from carrerasdarren-cell/fix/iso9660-boot-image-size-overflow
Dustin L. Howett [Tue, 28 Jul 2026 19:32:46 +0000 (14:32 -0500)] 
Merge pull request #3320 from carrerasdarren-cell/fix/iso9660-boot-image-size-overflow

iso9660: avoid boot image block count overflow

12 days agoiso9660: avoid boot image block count overflow 3320/head
carrerasdarren-cell [Thu, 23 Jul 2026 15:21:29 +0000 (11:21 -0400)] 
iso9660: avoid boot image block count overflow

Use overflow-free ceiling division before narrowing the boot image block count to int.

Fixes #3269

13 days agoMerge pull request #3315 from datauwu/iso9660-remove-per-reader-comp-buf
Dustin L. Howett [Mon, 27 Jul 2026 22:12:53 +0000 (17:12 -0500)] 
Merge pull request #3315 from datauwu/iso9660-remove-per-reader-comp-buf

iso9660: remove per-reader zero comparison buffer

13 days agoMerge pull request #3302 from datauwu/program-read-fix-uaf
Dustin L. Howett [Mon, 27 Jul 2026 22:12:20 +0000 (17:12 -0500)] 
Merge pull request #3302 from datauwu/program-read-fix-uaf

program: fix dangling pointer after close

13 days agoMerge pull request #3317 from stoeckmann/rar5_varint
Dustin L. Howett [Mon, 27 Jul 2026 21:08:31 +0000 (16:08 -0500)] 
Merge pull request #3317 from stoeckmann/rar5_varint

rar5: Improve varint handling

13 days agoMerge pull request #3329 from dag-erling/des/xar-unsup-digest
Tim Kientzle [Mon, 27 Jul 2026 19:36:40 +0000 (12:36 -0700)] 
Merge pull request #3329 from dag-erling/des/xar-unsup-digest

xar: Fix for unsupported digests

13 days agoMerge pull request #3325 from tbontb-iaq/fix/seek-data-null-not-fatal
Dustin L. Howett [Mon, 27 Jul 2026 19:24:12 +0000 (14:24 -0500)] 
Merge pull request #3325 from tbontb-iaq/fix/seek-data-null-not-fatal

archive_read: don't poison archive when format lacks seek_data (fixes #3323)

13 days agoxar: Fix for unsupported digests 3329/head
Dag-Erling Smørgrav [Mon, 27 Jul 2026 18:57:24 +0000 (20:57 +0200)] 
xar: Fix for unsupported digests

* In _checksum_init() and _checksum_final(), fail if the requested digest
  is not supported (e.g. archive uses SHA256 but libarchive was compiled
  without SHA256 support)

* In checksum_init(), fail with a meaningful error message if either
  _checksum_init() call fails.

* In checksum_final(), simplify the logic and improve the error message.

* Make the various digest tests conditional on support for the digest
  being tested.

Fixes: 6f10adcd5931 ("xar: Add support for SHA256 and SHA512")

13 days agoMerge pull request #3322 from datauwu/warc-writer-unify
Dustin L. Howett [Mon, 27 Jul 2026 18:43:51 +0000 (13:43 -0500)] 
Merge pull request #3322 from datauwu/warc-writer-unify

warc: match other writer styles

13 days agoMerge pull request #3328 from dag-erling/des/xar-sha2
Tim Kientzle [Mon, 27 Jul 2026 18:20:21 +0000 (11:20 -0700)] 
Merge pull request #3328 from dag-erling/des/xar-sha2

xar: Add support for SHA256 and SHA512

13 days agoxar: Add support for SHA256 and SHA512 3328/head
Dag-Erling Smørgrav [Mon, 27 Jul 2026 17:20:07 +0000 (19:20 +0200)] 
xar: Add support for SHA256 and SHA512

Extend the xar reader and writer to understand the SHA256 (header
cksum_alg 3, 32 bytes, style "sha256") and SHA512 (cksum_alg 4, 64
bytes, style "sha512") checksum algorithms in addition to the existing
SHA1 and MD5.  These are the algorithm codes defined by the canonical
xar format, so archives written with them interoperate with Apple's xar,
pkgutil, and PackageKit.

Both the TOC ("toc-checksum") and per-file ("checksum") algorithms are
supported for writing.  New algorithm handling is guarded by
ARCHIVE_HAS_SHA256 / ARCHIVE_HAS_SHA512 so builds without those digests
are unaffected.  MAX_SUM_SIZE grows from 20 to 64 to hold a SHA512
digest.

13 days agoMerge pull request #3327 from libarchive/dependabot/github_actions/all-actions-413c1c7ad7
Dustin L. Howett [Mon, 27 Jul 2026 17:01:12 +0000 (12:01 -0500)] 
Merge pull request #3327 from libarchive/dependabot/github_actions/all-actions-413c1c7ad7

CI: Bump the all-actions group with 6 updates

13 days agoarchive_read: don't poison archive when seek is unsupported (fixes #3323) 3325/head
Jin [Sun, 26 Jul 2026 01:23:26 +0000 (09:23 +0800)] 
archive_read: don't poison archive when seek is unsupported (fixes #3323)

3.8.8 ("make ARCHIVE_FATAL sticky in data-reading entry points",
commit e1f890dc) made archive_seek_data() set
a->archive.state = ARCHIVE_STATE_FATAL whenever the call returned
ARCHIVE_FATAL.  That is correct for genuine I/O / parse failures
returned by a format's seek_data() implementation, but it also
poisoned the archive in two cases where seeking is simply
unsupported for the current format:

  1. The seek_data == NULL branch in archive_seek_data() itself
     (no format_seek_data_block registered: ustar/tar, the
     streaming ZIP reader, ...).

  2. rar5_seek_data() in archive_read_support_format_rar5.c, which
     unconditionally returns ARCHIVE_FATAL because RAR5 is a
     streaming unpacker.  This was latent before 3.8.8 because
     the read core did not make FATAL sticky; the stickiness
     change exposed it.

Both are capability gaps, not stream corruption.  ARCHIVE_FATAL
must always be sticky (it means the archive is irrecoverably
damaged), so both sites now return ARCHIVE_FAILED with an error
string instead.  ARCHIVE_FAILED is recoverable: capability probes
such as

    if (archive_seek_data(a, 0, SEEK_CUR) >= 0) ...

learn that seeking is unavailable while the archive remains
usable for subsequent reads.  The sticky-on-genuine-FATAL part of
the original 3.8.8 change is preserved for actual ARCHIVE_FATAL
returns from a format's seek_data() implementation.

The seek_data == NULL branch also reports the condition better: a
format that never registers a seek hook is not illegal use of the
library, so the error is now ARCHIVE_ERRNO_MISC / "Cannot seek
data with this format" instead of ARCHIVE_ERRNO_PROGRAMMER /
"Internal error: No format_seek_data_block function registered".

The rar5 change also matches how the RAR4 reader already reports
the same situation (archive_read_support_format_rar.c:1339
returns ARCHIVE_FAILED for compressed RAR files).

This restores 3.8.7 behaviour for clients that probe seekability
before reading.  VLC's skins2 stream extractor
(modules/stream_extractor/archive.c, archive_seek_subentry())
probes with archive_seek_data(a, 0, SEEK_CUR); on a non-seekable
format the poisoned state killed all later archive_read_data()
calls, breaking ZIP-packed .vlt skins on distributions shipping
libarchive 3.8.8.

Tests:
  - test_archive_seek_data_unsupported: covers the seek_data==NULL
    branch using a ustar archive.
  - test_read_format_rar5_seek_data_unsupported: covers the
    rar5_seek_data() branch using an existing RAR5 fixture, and
    verifies the entry content with verify_data() after the probe.
  Both fail on master and pass with this change.

13 days agoCI: Bump the all-actions group with 6 updates 3327/head
dependabot[bot] [Mon, 27 Jul 2026 16:13:38 +0000 (16:13 +0000)] 
CI: Bump the all-actions group with 6 updates

Bumps the all-actions group with 6 updates:

| Package | From | To |
| --- | --- | --- |
| [acj/freebsd-firecracker-action](https://github.com/acj/freebsd-firecracker-action) | `0.10.4` | `0.11.0` |
| [github/codeql-action/init](https://github.com/github/codeql-action) | `4.37.1` | `4.37.3` |
| [github/codeql-action/autobuild](https://github.com/github/codeql-action) | `4.37.1` | `4.37.3` |
| [github/codeql-action/analyze](https://github.com/github/codeql-action) | `4.37.1` | `4.37.3` |
| [ossf/scorecard-action](https://github.com/ossf/scorecard-action) | `2.4.3` | `2.4.4` |
| [github/codeql-action/upload-sarif](https://github.com/github/codeql-action) | `4.37.1` | `4.37.3` |

Updates `acj/freebsd-firecracker-action` from 0.10.4 to 0.11.0
- [Release notes](https://github.com/acj/freebsd-firecracker-action/releases)
- [Commits](https://github.com/acj/freebsd-firecracker-action/compare/0fe13161c7d388eed0570eac668e1ba8fc1f1e4e...e04896d2dd91f7ec7381e5f363c6fbe83ee445c3)

Updates `github/codeql-action/init` from 4.37.1 to 4.37.3
- [Release notes](https://github.com/github/codeql-action/releases)
- [Changelog](https://github.com/github/codeql-action/blob/main/CHANGELOG.md)
- [Commits](https://github.com/github/codeql-action/compare/7188fc363630916deb702c7fdcf4e481b751f97a...e4fba868fa4b1b91e1fdab776edc8cfbe6e9fb81)

Updates `github/codeql-action/autobuild` from 4.37.1 to 4.37.3
- [Release notes](https://github.com/github/codeql-action/releases)
- [Changelog](https://github.com/github/codeql-action/blob/main/CHANGELOG.md)
- [Commits](https://github.com/github/codeql-action/compare/7188fc363630916deb702c7fdcf4e481b751f97a...e4fba868fa4b1b91e1fdab776edc8cfbe6e9fb81)

Updates `github/codeql-action/analyze` from 4.37.1 to 4.37.3
- [Release notes](https://github.com/github/codeql-action/releases)
- [Changelog](https://github.com/github/codeql-action/blob/main/CHANGELOG.md)
- [Commits](https://github.com/github/codeql-action/compare/7188fc363630916deb702c7fdcf4e481b751f97a...e4fba868fa4b1b91e1fdab776edc8cfbe6e9fb81)

Updates `ossf/scorecard-action` from 2.4.3 to 2.4.4
- [Release notes](https://github.com/ossf/scorecard-action/releases)
- [Changelog](https://github.com/ossf/scorecard-action/blob/main/RELEASE.md)
- [Commits](https://github.com/ossf/scorecard-action/compare/4eaacf0543bb3f2c246792bd56e8cdeffafb205a...2d1146689b8cda280b9bc96326124645441f03bc)

Updates `github/codeql-action/upload-sarif` from 4.37.1 to 4.37.3
- [Release notes](https://github.com/github/codeql-action/releases)
- [Changelog](https://github.com/github/codeql-action/blob/main/CHANGELOG.md)
- [Commits](https://github.com/github/codeql-action/compare/7188fc363630916deb702c7fdcf4e481b751f97a...e4fba868fa4b1b91e1fdab776edc8cfbe6e9fb81)

---
updated-dependencies:
- dependency-name: acj/freebsd-firecracker-action
  dependency-version: 0.11.0
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: all-actions
- dependency-name: github/codeql-action/init
  dependency-version: 4.37.3
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: all-actions
- dependency-name: github/codeql-action/autobuild
  dependency-version: 4.37.3
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: all-actions
- dependency-name: github/codeql-action/analyze
  dependency-version: 4.37.3
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: all-actions
- dependency-name: ossf/scorecard-action
  dependency-version: 2.4.4
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: all-actions
- dependency-name: github/codeql-action/upload-sarif
  dependency-version: 4.37.3
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: all-actions
...

Signed-off-by: dependabot[bot] <support@github.com>
13 days agowarc: name local variables 3322/head
datauwu [Thu, 23 Jul 2026 14:07:11 +0000 (22:07 +0800)] 
warc: name local variables

Replace short local names with clear names.

Match the common writer layout and return style.

2 weeks agoiso9660: test large no-emulation boot image
carrerasdarren-cell [Thu, 23 Jul 2026 15:20:41 +0000 (11:20 -0400)] 
iso9660: test large no-emulation boot image

2 weeks agowarc: name helper functions
datauwu [Thu, 23 Jul 2026 14:07:11 +0000 (22:07 +0800)] 
warc: name helper functions

Give private helpers clear WARC names.

Make the UUID helper return void.

2 weeks agowarc: name internal types and fields
datauwu [Thu, 23 Jul 2026 14:07:11 +0000 (22:07 +0800)] 
warc: name internal types and fields

Replace short names with clear WARC names.

Move the header size limit to file scope.

2 weeks agowarc: use writer callback names
datauwu [Thu, 23 Jul 2026 14:07:11 +0000 (22:07 +0800)] 
warc: use writer callback names

Use the same callback form as other format writers.

Clean the prototypes and remove old section marks.

2 weeks agoprogram: fix dangling pointer after close 3302/head
datauwu [Tue, 21 Jul 2026 19:12:04 +0000 (03:12 +0800)] 
program: fix dangling pointer after close

Store the program filter description in the bidder state instead of the
active filter state.

The active state is freed by archive_read_close(), while the bidder state
remains valid until archive_read_free(). This keeps archive_filter_name()
from returning a dangling pointer.

2 weeks agoprogram: test filter name after close
datauwu [Tue, 21 Jul 2026 19:12:04 +0000 (03:12 +0800)] 
program: test filter name after close

Verify that the external program filter name remains available after
archive_read_close().

2 weeks agoMerge pull request #3299 from datauwu/tar-read-fix-uaf
Dustin L. Howett [Tue, 21 Jul 2026 18:13:03 +0000 (13:13 -0500)] 
Merge pull request #3299 from datauwu/tar-read-fix-uaf

tar: fix UAF when reading GNU sparse headers

2 weeks agoMerge commit from fork
Dustin L. Howett [Tue, 21 Jul 2026 17:55:13 +0000 (12:55 -0500)] 
Merge commit from fork

Fix RAR seek_data cursor underflow

2 weeks agoMerge pull request #3318 from carrerasdarren-cell/fix/mac-metadata-self-copy-uaf
Dustin L. Howett [Tue, 21 Jul 2026 17:48:06 +0000 (12:48 -0500)] 
Merge pull request #3318 from carrerasdarren-cell/fix/mac-metadata-self-copy-uaf

archive_entry: handle aliased Mac metadata copies

2 weeks agoarchive_entry: handle aliased Mac metadata copies 3318/head
carrerasdarren-cell [Tue, 21 Jul 2026 15:54:13 +0000 (11:54 -0400)] 
archive_entry: handle aliased Mac metadata copies

2 weeks agoarchive_entry: test aliased Mac metadata copies
carrerasdarren-cell [Tue, 21 Jul 2026 15:54:05 +0000 (11:54 -0400)] 
archive_entry: test aliased Mac metadata copies

2 weeks agoxar: use strrchr to find parent directories 3312/head
datauwu [Tue, 21 Jul 2026 09:43:15 +0000 (17:43 +0800)] 
xar: use strrchr to find parent directories

Replace the manual pathname scan with strrchr when locating the
parent directory.

2 weeks agomtree: use strrchr to find parent directories
datauwu [Tue, 21 Jul 2026 09:43:15 +0000 (17:43 +0800)] 
mtree: use strrchr to find parent directories

Replace the manual pathname scan with strrchr when locating the
parent directory.

2 weeks agomtree: use archive_string_dirname to roll back paths
datauwu [Tue, 21 Jul 2026 09:43:14 +0000 (17:43 +0800)] 
mtree: use archive_string_dirname to roll back paths

Replace the manual reverse scan with archive_string_dirname while
preserving the empty path representation.

2 weeks agoiso9660: remove per-reader zero comparison buffer 3315/head
datauwu [Mon, 20 Jul 2026 14:57:55 +0000 (22:57 +0800)] 
iso9660: remove per-reader zero comparison buffer

Check reserved fields by comparing adjacent bytes after confirming the
first byte is zero. This preserves the memcmp fast path and removes
2 KiB from each ISO9660 reader state.

2 weeks agoMerge pull request #3316 from libarchive/dependabot/github_actions/all-actions-3c55da1aaa
Dustin L. Howett [Tue, 21 Jul 2026 00:36:20 +0000 (19:36 -0500)] 
Merge pull request #3316 from libarchive/dependabot/github_actions/all-actions-3c55da1aaa

CI: Bump the all-actions group with 6 updates

2 weeks agorar5: Improve varint handling 3317/head
Tobias Stoeckmann [Mon, 20 Jul 2026 17:03:22 +0000 (19:03 +0200)] 
rar5: Improve varint handling

A varint field can actually have up to 10 bytes to resemble whole 64 bit
of a value. Use checked arithmetic to detect integer overflows.

Also, treat a varint which never has a byte without continuation bit as
faulty.

Signed-off-by: Tobias Stoeckmann <tobias@stoeckmann.org>
2 weeks agoCI: Bump the all-actions group with 6 updates 3316/head
dependabot[bot] [Mon, 20 Jul 2026 16:13:42 +0000 (16:13 +0000)] 
CI: Bump the all-actions group with 6 updates

Bumps the all-actions group with 6 updates:

| Package | From | To |
| --- | --- | --- |
| [acj/freebsd-firecracker-action](https://github.com/acj/freebsd-firecracker-action) | `0.10.3` | `0.10.4` |
| [actions/checkout](https://github.com/actions/checkout) | `7.0.0` | `7.0.1` |
| [github/codeql-action/init](https://github.com/github/codeql-action) | `4.37.0` | `4.37.1` |
| [github/codeql-action/autobuild](https://github.com/github/codeql-action) | `4.37.0` | `4.37.1` |
| [github/codeql-action/analyze](https://github.com/github/codeql-action) | `4.37.0` | `4.37.1` |
| [github/codeql-action/upload-sarif](https://github.com/github/codeql-action) | `4.37.0` | `4.37.1` |

Updates `acj/freebsd-firecracker-action` from 0.10.3 to 0.10.4
- [Release notes](https://github.com/acj/freebsd-firecracker-action/releases)
- [Commits](https://github.com/acj/freebsd-firecracker-action/compare/53cfec625fd81cfb34160e6d9ec19c9d9baa8adf...0fe13161c7d388eed0570eac668e1ba8fc1f1e4e)

Updates `actions/checkout` from 7.0.0 to 7.0.1
- [Release notes](https://github.com/actions/checkout/releases)
- [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md)
- [Commits](https://github.com/actions/checkout/compare/9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0...3d3c42e5aac5ba805825da76410c181273ba90b1)

Updates `github/codeql-action/init` from 4.37.0 to 4.37.1
- [Release notes](https://github.com/github/codeql-action/releases)
- [Changelog](https://github.com/github/codeql-action/blob/main/CHANGELOG.md)
- [Commits](https://github.com/github/codeql-action/compare/99df26d4f13ea111d4ec1a7dddef6063f76b97e9...7188fc363630916deb702c7fdcf4e481b751f97a)

Updates `github/codeql-action/autobuild` from 4.37.0 to 4.37.1
- [Release notes](https://github.com/github/codeql-action/releases)
- [Changelog](https://github.com/github/codeql-action/blob/main/CHANGELOG.md)
- [Commits](https://github.com/github/codeql-action/compare/99df26d4f13ea111d4ec1a7dddef6063f76b97e9...7188fc363630916deb702c7fdcf4e481b751f97a)

Updates `github/codeql-action/analyze` from 4.37.0 to 4.37.1
- [Release notes](https://github.com/github/codeql-action/releases)
- [Changelog](https://github.com/github/codeql-action/blob/main/CHANGELOG.md)
- [Commits](https://github.com/github/codeql-action/compare/99df26d4f13ea111d4ec1a7dddef6063f76b97e9...7188fc363630916deb702c7fdcf4e481b751f97a)

Updates `github/codeql-action/upload-sarif` from 4.37.0 to 4.37.1
- [Release notes](https://github.com/github/codeql-action/releases)
- [Changelog](https://github.com/github/codeql-action/blob/main/CHANGELOG.md)
- [Commits](https://github.com/github/codeql-action/compare/99df26d4f13ea111d4ec1a7dddef6063f76b97e9...7188fc363630916deb702c7fdcf4e481b751f97a)

---
updated-dependencies:
- dependency-name: acj/freebsd-firecracker-action
  dependency-version: 0.10.4
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: all-actions
- dependency-name: actions/checkout
  dependency-version: 7.0.1
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: all-actions
- dependency-name: github/codeql-action/init
  dependency-version: 4.37.1
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: all-actions
- dependency-name: github/codeql-action/autobuild
  dependency-version: 4.37.1
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: all-actions
- dependency-name: github/codeql-action/analyze
  dependency-version: 4.37.1
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: all-actions
- dependency-name: github/codeql-action/upload-sarif
  dependency-version: 4.37.1
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: all-actions
...

Signed-off-by: dependabot[bot] <support@github.com>
2 weeks agoMerge pull request #3306 from stoeckmann/data
Dustin L. Howett [Mon, 20 Jul 2026 15:25:52 +0000 (10:25 -0500)] 
Merge pull request #3306 from stoeckmann/data

3 weeks agoGenerally use f for filter 3306/head
Tobias Stoeckmann [Sun, 19 Jul 2026 14:32:21 +0000 (16:32 +0200)] 
Generally use f for filter

If there is no good reason to deviate from the rule, always use "f" for
filter just as we use "a" for archive.

Signed-off-by: Tobias Stoeckmann <tobias@stoeckmann.org>
3 weeks agofilter: Use f as filter variable name
Tobias Stoeckmann [Sat, 18 Jul 2026 20:21:03 +0000 (22:21 +0200)] 
filter: Use f as filter variable name

- If filter is meant, use "f" instead of "self" or "filter".
- If bidder is meant, use "b" instead of "self".

Matches writer filter style.

Signed-off-by: Tobias Stoeckmann <tobias@stoeckmann.org>
3 weeks agoUnify filter data access names
Tobias Stoeckmann [Sat, 18 Jul 2026 19:56:05 +0000 (21:56 +0200)] 
Unify filter data access names

Use "struct filter *filter" pattern, with filter being the name of the
filter. This matches the format parser pattern.

Signed-off-by: Tobias Stoeckmann <tobias@stoeckmann.org>
3 weeks agoshar: Merge format setters
Tobias Stoeckmann [Sat, 18 Jul 2026 19:22:37 +0000 (21:22 +0200)] 
shar: Merge format setters

Clarify where the differences between the format setters are.

Signed-off-by: Tobias Stoeckmann <tobias@stoeckmann.org>
3 weeks agoUnify filter data handling
Tobias Stoeckmann [Sat, 18 Jul 2026 18:54:47 +0000 (20:54 +0200)] 
Unify filter data handling

- Declare access variable at the beginning
- Remove unneeded cast

Signed-off-by: Tobias Stoeckmann <tobias@stoeckmann.org>
3 weeks agoUnify format data access names
Tobias Stoeckmann [Sat, 18 Jul 2026 17:39:41 +0000 (19:39 +0200)] 
Unify format data access names

It's generally the pattern "struct format *format". Unify for easier
readability.

Signed-off-by: Tobias Stoeckmann <tobias@stoeckmann.org>
3 weeks agoUnify format data handling
Tobias Stoeckmann [Sat, 18 Jul 2026 17:09:12 +0000 (19:09 +0200)] 
Unify format data handling

- Declare access variable at the beginning
- Remove unneeded cast (see warc parser, which never did it)
- Remove inline cast function
- Avoid unneeded brackets to unify style

Signed-off-by: Tobias Stoeckmann <tobias@stoeckmann.org>