]> git.ipfire.org Git - thirdparty/libarchive.git/log
thirdparty/libarchive.git
46 hours agoMerge pull request #2807 from KlaraSystems/des/list-tests master
Tim Kientzle [Sat, 13 Dec 2025 01:19:37 +0000 (17:19 -0800)] 
Merge pull request #2807 from KlaraSystems/des/list-tests

Add option to list tests

2 days agoMerge pull request #2809 from mmatuska/fix/2787
Martin Matuška [Fri, 12 Dec 2025 11:04:09 +0000 (12:04 +0100)] 
Merge pull request #2809 from mmatuska/fix/2787

tar: fix off-bounds read resulting from #2787 (3150539ed)

5 days agotar: fix off-bounds read resulting from #2787 (3150539ed) 2809/head
Martin Matuska [Mon, 8 Dec 2025 20:40:46 +0000 (21:40 +0100)] 
tar: fix off-bounds read resulting from #2787 (3150539ed)

8 days agotest_main: Add option to list tests 2807/head
Dag-Erling Smørgrav [Sat, 6 Dec 2025 13:42:16 +0000 (14:42 +0100)] 
test_main: Add option to list tests

The test runner already lists available tests if it fails to parse the
command line, but add a -l option to explicitly do this without also
printing an error message and a summary of options.

10 days agoMerge pull request #2805 from fredldotme/android-recovery
Tim Kientzle [Thu, 4 Dec 2025 12:17:34 +0000 (04:17 -0800)] 
Merge pull request #2805 from fredldotme/android-recovery

libarchive & contrib: Build as static binary for the Android recovery

10 days agolibarchive & contrib: Build as static binary for the Android recovery 2805/head
Alfred Neumayer [Thu, 27 Nov 2025 04:10:33 +0000 (05:10 +0100)] 
libarchive & contrib: Build as static binary for the Android recovery

Adds a 'bsdtar-recovery' Android build target for use in Android recoveries
as a static binary, and fixes some build failures on the get-go.

Tested on halium-7.1, halium-9.0 & halium-13.0.

Change-Id: I9b656e7016d4bf21517e2edb18f2a7733edc6982

13 days agoMerge pull request #2800 from mmatuska/fix/freebsdci
Martin Matuška [Mon, 1 Dec 2025 12:31:22 +0000 (13:31 +0100)] 
Merge pull request #2800 from mmatuska/fix/freebsdci

CI: use gmake in Cirrus FreeBSD build

2 weeks agoCI: use gmake in Cirrus FreeBSD build 2800/head
Martin Matuska [Fri, 28 Nov 2025 21:31:25 +0000 (22:31 +0100)] 
CI: use gmake in Cirrus FreeBSD build

2 weeks agoMerge pull request #2797 from mmatuska/fix/treefuncs
Martin Matuška [Thu, 27 Nov 2025 23:57:09 +0000 (00:57 +0100)] 
Merge pull request #2797 from mmatuska/fix/treefuncs

Partially revert "Merge pull request #2679 from AZero13/error"

2 weeks agoMerge pull request #2799 from AZero13/idk
Tim Kientzle [Thu, 27 Nov 2025 05:08:01 +0000 (21:08 -0800)] 
Merge pull request #2799 from AZero13/idk

Prevent unneeded truncation

2 weeks agoPrevent unneeded truncation 2799/head
AZero13 [Wed, 26 Nov 2025 20:35:54 +0000 (15:35 -0500)] 
Prevent unneeded truncation

There is no reason we need to cast when every data type involved is size_t

2 weeks agoPartially revert "Merge pull request #2679 from AZero13/error" 2797/head
Martin Matuska [Mon, 24 Nov 2025 13:02:20 +0000 (14:02 +0100)] 
Partially revert "Merge pull request #2679 from AZero13/error"

This reverts commit d8aaf88c9feab047139df4cae60d845764a2480a, reversing
changes made to ee49ac81068f93754f004368f2cc72c95a8bf056.

tree_reopen() and tree_dup() return NULL only of they
are unable to allocate memory. Otherwise libarchive enters
ARCHIVE_FATAL if trying to walk an enterable but unreadable
directory.

__archive_ensure_cloexec_flag() operates only on fd >= 0
so there is no need to skip it

I have reimplemented the check around fdopendir()

Reported by: Christian Weisgerber from OpenBSD

3 weeks agoMerge pull request #2791 from KlaraSystems/des/383-fixes
Tim Kientzle [Fri, 21 Nov 2025 06:24:38 +0000 (22:24 -0800)] 
Merge pull request #2791 from KlaraSystems/des/383-fixes

Fix issues encountered while importing 3.8.3 downstream

3 weeks agoMerge pull request #2792 from KlaraSystems/des/generate-list
Tim Kientzle [Fri, 21 Nov 2025 06:22:32 +0000 (22:22 -0800)] 
Merge pull request #2792 from KlaraSystems/des/generate-list

Generate test lists reliably and deterministically

3 weeks agoMerge pull request #2793 from bgilbert/rar
Tim Kientzle [Fri, 21 Nov 2025 06:19:23 +0000 (22:19 -0800)] 
Merge pull request #2793 from bgilbert/rar

Add missing rar5 test case to dist

3 weeks agoMerge pull request #2787 from ljdarj/aar
Tim Kientzle [Fri, 21 Nov 2025 05:40:17 +0000 (21:40 -0800)] 
Merge pull request #2787 from ljdarj/aar

Fix bsdtar zero-length pattern issue.

3 weeks agoFix bsdtar zero-length pattern issue. 2787/head
ARJANEN Loïc Jean David [Fri, 14 Nov 2025 19:34:48 +0000 (20:34 +0100)] 
Fix bsdtar zero-length pattern issue.

Uses the sed-like way (and Java-like, and .Net-like, and Javascript-like…) to fix this issue of advancing the string to be processed by one if the match is zero-length.

Fixes libarchive/libarchive#2725 and solves libarchive/libarchive#2438.

3 weeks agoAdd missing rar5 test case to dist 2793/head
Benjamin Gilbert [Wed, 19 Nov 2025 08:12:36 +0000 (00:12 -0800)] 
Add missing rar5 test case to dist

Fixes: aafb078b7c ("Update 'archive_mstring_update_utf8' to attempt UTF8->WCS conversion on Windows if MBS conversion fails (#1978)")
3 weeks agoFix low-hanging type issues 2791/head
Dag-Erling Smørgrav [Wed, 19 Nov 2025 00:18:18 +0000 (01:18 +0100)] 
Fix low-hanging type issues

3 weeks agoFix lseek argument order
Dag-Erling Smørgrav [Wed, 19 Nov 2025 00:16:29 +0000 (01:16 +0100)] 
Fix lseek argument order

3 weeks agoFix the condition for using LIBXML_DOTTED_VERSION
Dag-Erling Smørgrav [Wed, 19 Nov 2025 00:15:48 +0000 (01:15 +0100)] 
Fix the condition for using LIBXML_DOTTED_VERSION

3 weeks agoImprove test list generation 2792/head
Dag-Erling Smørgrav [Wed, 19 Nov 2025 00:12:50 +0000 (01:12 +0100)] 
Improve test list generation

Update the lists of tests reliably and deterministically when the test sources change.

3 weeks agoClean up the top-level Makefile
Dag-Erling Smørgrav [Wed, 19 Nov 2025 00:05:41 +0000 (01:05 +0100)] 
Clean up the top-level Makefile

Most of this is just moving headers out from *_SOURCES.

3 weeks agoMerge pull request #2771 from mostynb/lz4_with_leading_skippable_frames
Martin Matuška [Mon, 17 Nov 2025 19:30:16 +0000 (20:30 +0100)] 
Merge pull request #2771 from mostynb/lz4_with_leading_skippable_frames

Support both lz4 and zstd data with leading skippable frames

3 weeks agoMerge pull request #2751 from KlaraSystems/des/zip_magic_numbers
Martin Matuška [Mon, 17 Nov 2025 19:27:46 +0000 (20:27 +0100)] 
Merge pull request #2751 from KlaraSystems/des/zip_magic_numbers

Avoid magic numbers in zip support code

3 weeks agoMerge pull request #2752 from KlaraSystems/des/safe-writes-umask
Martin Matuška [Mon, 17 Nov 2025 19:26:35 +0000 (20:26 +0100)] 
Merge pull request #2752 from KlaraSystems/des/safe-writes-umask

Set umask before testing safe writes

3 weeks agoMerge pull request #2755 from mmatuska/fix/cirrusci
Martin Matuška [Mon, 17 Nov 2025 19:24:53 +0000 (20:24 +0100)] 
Merge pull request #2755 from mmatuska/fix/cirrusci

CI: update FreeBSD 14 build environment

3 weeks agoMerge pull request #2783 from YoshiRulz/docs-fix-typo
Tim Kientzle [Mon, 17 Nov 2025 00:18:03 +0000 (16:18 -0800)] 
Merge pull request #2783 from YoshiRulz/docs-fix-typo

Fix typo in archive_entry_stat(3) man page

3 weeks agoMerge pull request #2738 from cmcgee1024/add_clang_module_map
Tim Kientzle [Mon, 17 Nov 2025 00:17:54 +0000 (16:17 -0800)] 
Merge pull request #2738 from cmcgee1024/add_clang_module_map

Add a clang module map for libarchive

4 weeks agoFix typo in archive_entry_stat(3) man page 2783/head
YoshiRulz [Thu, 13 Nov 2025 02:46:23 +0000 (12:46 +1000)] 
Fix typo in archive_entry_stat(3) man page

4 weeks agoProvide a detailed description of the libarchive module map file 2738/head
Chris McGee [Wed, 12 Nov 2025 13:42:03 +0000 (08:42 -0500)] 
Provide a detailed description of the libarchive module map file

5 weeks agoMerge pull request #2778 from AZero13/result-0
Tim Kientzle [Fri, 7 Nov 2025 04:17:19 +0000 (20:17 -0800)] 
Merge pull request #2778 from AZero13/result-0

Set *result to 0 when the tar flush fails.

5 weeks agoMerge pull request #2654 from AZero13/swapping-2
Tim Kientzle [Fri, 7 Nov 2025 04:15:08 +0000 (20:15 -0800)] 
Merge pull request #2654 from AZero13/swapping-2

s is a signed int, so make it signed int

5 weeks agoMerge pull request #2779 from AZero13/descriptor
Tim Kientzle [Fri, 7 Nov 2025 04:13:10 +0000 (20:13 -0800)] 
Merge pull request #2779 from AZero13/descriptor

file_open should close if fstat fails

5 weeks agofile_open should close if fstat fails 2779/head
AZero13 [Thu, 6 Nov 2025 16:14:45 +0000 (11:14 -0500)] 
file_open should close if fstat fails

5 weeks agoAdd error handling 2654/head
AZero13 [Thu, 6 Nov 2025 15:46:27 +0000 (10:46 -0500)] 
Add error handling

5 weeks agos is a signed int, so make it signed int
Rose [Sun, 1 Jun 2025 02:33:36 +0000 (22:33 -0400)] 
s is a signed int, so make it signed int

5 weeks agoSet *result to 0 when the tar flush fails. 2778/head
AZero13 [Thu, 6 Nov 2025 15:02:41 +0000 (10:02 -0500)] 
Set *result to 0 when the tar flush fails.

We should not uninitialize 0 when an error happens. Because t is then checked.

5 weeks agoMerge pull request #2775 from AZero13/off-by-one
Tim Kientzle [Wed, 5 Nov 2025 03:30:01 +0000 (19:30 -0800)] 
Merge pull request #2775 from AZero13/off-by-one

[tar] Bounds check newdir_len

5 weeks agoBounds check newdir_len 2775/head
AZero13 [Wed, 5 Nov 2025 00:02:08 +0000 (19:02 -0500)] 
Bounds check newdir_len

Honestly, this is of little consequence; if old_len is too big the program will crash anyway. However, an error exists just in case.

6 weeks agoMerge pull request #2769 from kientzle/kientzle-issue2765
Tim Kientzle [Sun, 2 Nov 2025 22:17:48 +0000 (14:17 -0800)] 
Merge pull request #2769 from kientzle/kientzle-issue2765

Fix a buffer overrun when reading truncated 7zip headers

6 weeks agoMerge pull request #2772 from moubctez/forget_name_max
Tim Kientzle [Sun, 2 Nov 2025 17:08:31 +0000 (09:08 -0800)] 
Merge pull request #2772 from moubctez/forget_name_max

Remove name_max leftover

6 weeks agoRemove name_max leftover 2772/head
Adam Ciarciński [Sun, 2 Nov 2025 08:49:02 +0000 (09:49 +0100)] 
Remove name_max leftover

6 weeks agoSkip over LZ4/zstd skippable frames when detecting data format 2771/head
Mostyn Bramley-Moore [Sat, 1 Nov 2025 21:42:30 +0000 (22:42 +0100)] 
Skip over LZ4/zstd skippable frames when detecting data format

Since LZ4 and zstd share the same format for skippable frames, we need
to skip over these frames when trying to detect the format of compressed
data. Let's read up to something like 64kb of data when performing this
scanning.

Note that the LZ4 specification advises against starting with a skippable
frame, but doesn't forbid it:
> For the purpose of facilitating identification, it is discouraged to
> start a flow of concatenated frames with a skippable frame. If there
> is a need to start such a flow with some user data encapsulated into
> a skippable frame, it's recommended to start with a zero-byte LZ4
> frame followed by a skippable frame. This will make it easier for
> file type identifiers.

Resolves #2692.

6 weeks agoTest that we can read lz4 data with leading skippable frames
Mostyn Bramley-Moore [Sat, 1 Nov 2025 21:17:42 +0000 (22:17 +0100)] 
Test that we can read lz4 data with leading skippable frames

This is expected to fail until a followup commit, because lz4 and zstd
skippable frames are the same format and we don't skip over those when
performing format detection (yet).

Relates to #2692.

6 weeks agoCorrect the new test expectations 2769/head
Tim Kientzle [Sat, 1 Nov 2025 05:37:33 +0000 (22:37 -0700)] 
Correct the new test expectations

6 weeks agoFix a buffer overrun when reading truncated 7zip headers
Tim Kientzle [Sat, 1 Nov 2025 05:30:09 +0000 (22:30 -0700)] 
Fix a buffer overrun when reading truncated 7zip headers

This adjusts the request size for reading data from a 7zip SFX header
to ensure we get enough bytes to cover the following checks.

Resolves #2765

6 weeks agoMerge pull request #2768 from Commandoss/master
Tim Kientzle [Sat, 1 Nov 2025 05:07:19 +0000 (22:07 -0700)] 
Merge pull request #2768 from Commandoss/master

Fix for an out-of-bounds buffer overrun when using p[H_LEVEL_OFFSET]

6 weeks agoMerge pull request #2767 from KlaraSystems/des/posix_spawn
Tim Kientzle [Fri, 31 Oct 2025 14:27:15 +0000 (07:27 -0700)] 
Merge pull request #2767 from KlaraSystems/des/posix_spawn

Replace system() with posix_spawn() if available

6 weeks agoMerge pull request #2766 from mostynb/fix_mac_signed_unsigned_comparison
Tim Kientzle [Fri, 31 Oct 2025 14:23:44 +0000 (07:23 -0700)] 
Merge pull request #2766 from mostynb/fix_mac_signed_unsigned_comparison

Fix signed-unsigned comparison in add_trivial_nfs4_acl

6 weeks agoheap-use-after-free(read) at src/libarchive/archive_read_support_format_lha.c:692:6 2768/head
Илья [Fri, 31 Oct 2025 12:23:55 +0000 (15:23 +0300)] 
heap-use-after-free(read) at src/libarchive/archive_read_support_format_lha.c:692:6

6 weeks agoFix signed-unsigned comparison in add_trivial_nfs4_acl 2766/head
Mostyn Bramley-Moore [Thu, 30 Oct 2025 10:29:55 +0000 (11:29 +0100)] 
Fix signed-unsigned comparison in add_trivial_nfs4_acl

Resolves #2760

6 weeks agoMerge pull request #2753 from KlaraSystems/des/temp-files
Tim Kientzle [Wed, 29 Oct 2025 00:13:18 +0000 (17:13 -0700)] 
Merge pull request #2753 from KlaraSystems/des/temp-files

Create temporary files in the target directory

8 weeks agoCI: update FreeBSD 14 build environment 2755/head
Martin Matuska [Wed, 15 Oct 2025 21:40:58 +0000 (23:40 +0200)] 
CI: update FreeBSD 14 build environment

8 weeks agoCreate temporary files in the target directory 2753/head
Dag-Erling Smørgrav [Tue, 14 Oct 2025 00:11:31 +0000 (02:11 +0200)] 
Create temporary files in the target directory

Whenever we need to create a temporary file while writing to disk on a
POSIX system, try to create it in the same directory as the final file
instead of the current working directory.  The target directory can
reasonably be expected to be writable (and if it isn't, creating the
file will fail anyway), but the current working directory may not be.

While here, consistently use __archive_mkstemp(), and increase the
template from six to eight random characters.

Fixes: 2e73ea3a7db1 ("Fix max path-length metadata writing (#2243)")
Fixes: e12c955dca63 ("Unify temporary directory handling")

2 months agoReplace system() with posix_spawn() if available 2767/head
Dag-Erling Smørgrav [Tue, 14 Oct 2025 17:01:17 +0000 (19:01 +0200)] 
Replace system() with posix_spawn() if available

Some platforms disallow system() due to its perceived insecurity.
Luckily, we can be just as insecure using the more palatable
posix_spawn() instead!

2 months agoAdd archive_string_dirname()
Dag-Erling Smørgrav [Tue, 14 Oct 2025 00:08:44 +0000 (02:08 +0200)] 
Add archive_string_dirname()

This function performs the equivalent of POSIX dirname(3) on a
struct archive_string.

2 months agoSet umask before testing safe writes 2752/head
Dag-Erling Smørgrav [Mon, 13 Oct 2025 19:45:28 +0000 (21:45 +0200)] 
Set umask before testing safe writes

Fixes: 27588eba5077 ("Fix replacing a regular file with a dir for ARCHIVE_EXTRACT_SAFE_WRITES")

2 months agozip: Increase max size of Mac metadata 2751/head
Dag-Erling Smørgrav [Mon, 13 Oct 2025 17:35:18 +0000 (19:35 +0200)] 
zip: Increase max size of Mac metadata

Raise the maximum size of Mac metadata from 4 MiB to 10 MiB, as that is
the value used by Apple themselves in the version of libarchive included
in Darwin.

2 months agozip: Avoid magic numbers
Dag-Erling Smørgrav [Mon, 13 Oct 2025 17:31:23 +0000 (19:31 +0200)] 
zip: Avoid magic numbers

Provide preprocessor macros for two recurring magic numbers in the zip
support code: the length of the local file header (30 bytes) and the
maximum allowable size for Mac metadata (4 MiB).

2 months agoMerge pull request #2737 from kientzle/kientzle-volume-header-overflow
Tim Kientzle [Mon, 13 Oct 2025 17:58:26 +0000 (10:58 -0700)] 
Merge pull request #2737 from kientzle/kientzle-volume-header-overflow

Fix an infinite loop when parsing `V` headers

2 months agoMerge pull request #2749 from KlaraSystems/des/tempdir
Tim Kientzle [Mon, 13 Oct 2025 17:57:18 +0000 (10:57 -0700)] 
Merge pull request #2749 from KlaraSystems/des/tempdir

Unify temporary directory handling

2 months agoDrop unused variable. 2749/head
Dag-Erling Smørgrav [Mon, 13 Oct 2025 12:58:16 +0000 (14:58 +0200)] 
Drop unused variable.

Fixes: a335429c5e71 ("Drop support for readdir_r()")

2 months agoUnify temporary directory handling
Dag-Erling Smørgrav [Mon, 13 Oct 2025 12:13:47 +0000 (14:13 +0200)] 
Unify temporary directory handling

In archive_util.c, we have a private function named get_tempdir() which
is used by __archive_mktemp() to get the temporary directory if the
caller did not pass one.

In archive_read_disk_entry_from_file.c, we use the same logic with a
slight twist (don't trust the environment if setugid) to create a
temporary file for metadata.

Merge the two by renaming get_tempdir() to __archive_get_tempdir() and
unstaticizing it (with a prototype in archive_private.h).

2 months agoMerge pull request #2722 from dependabot
Martin Matuška [Sat, 11 Oct 2025 20:12:11 +0000 (22:12 +0200)] 
Merge pull request #2722 from dependabot

CI: Bump the all-actions group across 1 directory with 3 updates

2 months agoMerge pull request #2746 from pbrisbin/patch-1
Tim Kientzle [Tue, 7 Oct 2025 13:09:01 +0000 (06:09 -0700)] 
Merge pull request #2746 from pbrisbin/patch-1

Fix invalid quoting in archive_entry_paths.3

2 months agoCI: Bump the all-actions group across 1 directory with 3 updates 2722/head
dependabot[bot] [Mon, 6 Oct 2025 16:07:23 +0000 (16:07 +0000)] 
CI: Bump the all-actions group across 1 directory with 3 updates

Bumps the all-actions group with 3 updates in the / directory: [actions/checkout](https://github.com/actions/checkout), [github/codeql-action](https://github.com/github/codeql-action) and [ossf/scorecard-action](https://github.com/ossf/scorecard-action).

Updates `actions/checkout` from 4.2.2 to 5.0.0
- [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/11bd71901bbe5b1630ceea73d27597364c9af683...08c6903cd8c0fde910a37f88322edcfb5dd907a8)

Updates `github/codeql-action` from 3.28.18 to 3.29.8
- [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/ff0a06e83cb2de871e5a09832bc6a81e7276941f...76621b61decf072c1cee8dd1ce2d2a82d33c17ed)

Updates `ossf/scorecard-action` from 2.4.1 to 2.4.2
- [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/f49aabe0b5af0936a0987cfb85d86b75731b0186...05b42c624433fc40578a4040d5cf5e36ddca8cde)

---
updated-dependencies:
- dependency-name: actions/checkout
  dependency-version: 5.0.0
  dependency-type: direct:production
  update-type: version-update:semver-major
  dependency-group: all-actions
- dependency-name: github/codeql-action
  dependency-version: 3.29.8
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: all-actions
- dependency-name: ossf/scorecard-action
  dependency-version: 2.4.2
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: all-actions
...

Signed-off-by: dependabot[bot] <support@github.com>
2 months agoFix invalid quoting in archive_entry_paths.3 2746/head
Pat Brisbin [Mon, 6 Oct 2025 12:23:26 +0000 (08:23 -0400)] 
Fix invalid quoting in archive_entry_paths.3

2 months agoAdd test case 2737/head
Tim Kientzle [Sat, 4 Oct 2025 17:03:08 +0000 (10:03 -0700)] 
Add test case

2 months agoMerge pull request #2740 from dunhor/gnutar_longpath_unicode
Tim Kientzle [Sat, 4 Oct 2025 03:43:21 +0000 (20:43 -0700)] 
Merge pull request #2740 from dunhor/gnutar_longpath_unicode

Check WCS pathname in header_gnutar before overwriting

2 months agoMerge pull request #2729 from KlaraSystems/des/leak-on-fatal
Tim Kientzle [Sat, 27 Sep 2025 17:25:03 +0000 (10:25 -0700)] 
Merge pull request #2729 from KlaraSystems/des/leak-on-fatal

Don't leak memory on fatal error

2 months agoMerge pull request #2742 from bradking/parse-date-2038
Tim Kientzle [Sat, 27 Sep 2025 02:52:20 +0000 (19:52 -0700)] 
Merge pull request #2742 from bradking/parse-date-2038

parse_date: handle dates in 2038 and beyond if time_t is big enough

2 months agoMerge pull request #2741 from e-kwsm/extra-semi
Tim Kientzle [Sat, 27 Sep 2025 02:50:52 +0000 (19:50 -0700)] 
Merge pull request #2741 from e-kwsm/extra-semi

fix: remove extra ';' outside of functions

2 months agoparse_date: handle dates in 2038 and beyond if time_t is big enough 2742/head
Brad King [Fri, 26 Sep 2025 21:08:00 +0000 (17:08 -0400)] 
parse_date: handle dates in 2038 and beyond if time_t is big enough

2 months agofix: remove extra ';' outside of functions 2741/head
Eisuke Kawashima [Fri, 26 Sep 2025 10:38:01 +0000 (19:38 +0900)] 
fix: remove extra ';' outside of functions

2 months agoCheck WCS pathname in header_gnutar 2740/head
Duncan Horn [Thu, 25 Sep 2025 23:03:18 +0000 (16:03 -0700)] 
Check WCS pathname in header_gnutar

2 months agoMerge pull request #2739 from DHowett/remove-wincrypt
Tim Kientzle [Wed, 24 Sep 2025 13:21:23 +0000 (06:21 -0700)] 
Merge pull request #2739 from DHowett/remove-wincrypt

windows: remove support for WinCrypt

2 months agoWIP: remove WinCrypt support 2739/head
Dustin L. Howett [Sun, 27 Jul 2025 00:17:28 +0000 (19:17 -0500)] 
WIP: remove WinCrypt support

I am debating whether to remove the checks for bcrypt as well (it is
supported on all versions of Windows currently targeted.)

fixes https://github.com/libarchive/libarchive/issues/2595

2 months agoAdd a clang module map for libarchive
Chris McGee [Mon, 22 Sep 2025 14:58:38 +0000 (10:58 -0400)] 
Add a clang module map for libarchive

When compiling libarchive using clang in module mode a special
module.modulemap file describes the structure of the header files
so that they can be imported modularly. Having this file makes
it easier for modular uses of the library out of the box so that
clients don't need to write their own, potentially making errors
in doing so.

Add a module.modulemap in the public header file location so that
clang and related tools can find it easily.

2 months agoFix an infinite loop when parsing `V` headers
Tim Kientzle [Tue, 16 Sep 2025 15:25:57 +0000 (08:25 -0700)] 
Fix an infinite loop when parsing `V` headers

Our tar header parsing tracks a count of bytes that need to be
consumed from the input.  After each header, we skip this many bytes,
discard them, and reset the count to zero.  The `V` header parsing
added the size of the `V` entry body to this count, but failed to
check whether that size was negative.  A negative size (from
overflowing the 64-bit signed number parsing) would decrement this
count, potentially leading us to consume zero bytes and leading to an
infinite loop parsing the same header over and over.

There are two fixes here:
* Check for a negative size for the `V` body
* Check for errors when skipping the bytes that
  need to be consumed

Thanks to Zhang Tianyi from Wuhan University for finding
and reporting this issue.

3 months agoMerge pull request #2734 from kientzle/kientzle-ignore-too-long-gzip-filename
Tim Kientzle [Sun, 14 Sep 2025 02:34:03 +0000 (19:34 -0700)] 
Merge pull request #2734 from kientzle/kientzle-ignore-too-long-gzip-filename

Ignore over-long gzip filename

3 months agoFix the reference to the archive object 2734/head
Tim Kientzle [Sat, 13 Sep 2025 20:07:33 +0000 (13:07 -0700)] 
Fix the reference to the archive object

3 months agoMerge pull request #2735 from kientzle/kientzle-err.h-conflict
Martin Matuška [Sat, 13 Sep 2025 20:01:52 +0000 (22:01 +0200)] 
Merge pull request #2735 from kientzle/kientzle-err.h-conflict

Rename err.h to avoid conflict with system header

3 months agoMerge pull request #2731 from mmatuska/fix/macosci
Martin Matuška [Sat, 13 Sep 2025 19:36:29 +0000 (21:36 +0200)] 
Merge pull request #2731 from mmatuska/fix/macosci

CI: add workaround for cmake installed from local/pinned tab on GH/MacOS

3 months agoMerge pull request #2732 from mmatuska/fix/safe-dir-over-reg-win
Martin Matuška [Sat, 13 Sep 2025 19:36:13 +0000 (21:36 +0200)] 
Merge pull request #2732 from mmatuska/fix/safe-dir-over-reg-win

win: add complementary safe writes fix for Windows to 27588eba5 (#2477)

3 months agoRename err.h to avoid conflict with system header 2735/head
Tim Kientzle [Sat, 13 Sep 2025 19:30:03 +0000 (12:30 -0700)] 
Rename err.h to avoid conflict with system header

Depending on header search path ordering, we can easily
confuse libarchive_fe/err.h with the system header.
Rename ours to lafe_err.h to avoid the confusion.
Rename libarchive_fe/err.c to match.

3 months agoOnly set the filename-present bit if we actually write the filename
Tim Kientzle [Sat, 13 Sep 2025 18:17:38 +0000 (11:17 -0700)] 
Only set the filename-present bit if we actually write the filename

3 months agoFix some nearby formatting
Tim Kientzle [Fri, 12 Sep 2025 16:03:01 +0000 (09:03 -0700)] 
Fix some nearby formatting

3 months agoIgnore overlong gzip original_filename
Tim Kientzle [Fri, 12 Sep 2025 16:01:13 +0000 (09:01 -0700)] 
Ignore overlong gzip original_filename

We reuse the compression buffer to format the gzip header,
but didn't check for an overlong gzip original_filename.
This adds that check.  If the original_filename is
over 32k (or bigger than the buffer in case someone shrinks
the buffer someday), we WARN and ignore the filename.

3 months agowin: add complementary safe writes fix for Windows to 27588eba5 (#2477) 2732/head
Martin Matuska [Wed, 10 Sep 2025 08:57:55 +0000 (10:57 +0200)] 
win: add complementary safe writes fix for Windows to 27588eba5 (#2477)

3 months agoCI: add workaround for cmake installed from local/pinned tab on GH/MacOS 2731/head
Martin Matuska [Wed, 10 Sep 2025 08:50:46 +0000 (10:50 +0200)] 
CI: add workaround for cmake installed from local/pinned tab on GH/MacOS

3 months agoMerge pull request #2670 from benoit-pierre/pr/fix_zip_writing_with_zstd_compression_...
Martin Matuška [Wed, 10 Sep 2025 08:41:33 +0000 (10:41 +0200)] 
Merge pull request #2670 from benoit-pierre/pr/fix_zip_writing_with_zstd_compression_method

zip: fix writing with ZSTD compression

3 months agoMerge pull request #2477 from jrtc27/safe-dir-over-reg
Martin Matuška [Wed, 10 Sep 2025 08:40:44 +0000 (10:40 +0200)] 
Merge pull request #2477 from jrtc27/safe-dir-over-reg

Fix replacing a regular file with a dir for ARCHIVE_EXTRACT_SAFE_WRITES

3 months agoMerge pull request #2686 from stoeckmann/lseek_win_regression
Martin Matuška [Wed, 10 Sep 2025 08:24:34 +0000 (10:24 +0200)] 
Merge pull request #2686 from stoeckmann/lseek_win_regression

Fix Windows off_t handling

3 months agoMerge pull request #2710 from meecash/CVE-2025-25724-check_strftime_result
Martin Matuška [Wed, 10 Sep 2025 08:22:58 +0000 (10:22 +0200)] 
Merge pull request #2710 from meecash/CVE-2025-25724-check_strftime_result

Fix CVE-2025-25724 by checking the result of the strftime

3 months agoarchive_write: Set archive state to fatal if format or filters fail 2729/head
Dag-Erling Smørgrav [Mon, 8 Sep 2025 20:17:09 +0000 (22:17 +0200)] 
archive_write: Set archive state to fatal if format or filters fail

In archive_write_header(), if the format method or a filter flush method
fails, we set the archive state to fatal, but we did not do this in
archive_write_data() or archive_write_finish_entry().  There is no good
reason for this discrepancy.  Not setting the archive state to fatal
means a subsequent archive_write_free() will invoke archive_write_close()
which may retry the operation and cause archive_write_free() to return
an unexpected ARCHIVE_FATAL.

3 months agowrite_add_filter_bzip2: End compression in the freer
Dag-Erling Smørgrav [Mon, 8 Sep 2025 19:20:32 +0000 (21:20 +0200)] 
write_add_filter_bzip2: End compression in the freer

If a fatal error occurs, the closer will not be called, so neither will
BZ2_bzCompressEnd(), and we will leak memory.  Fix this by calling it a
second time from the freer.  This is harmless in the non-error case as
it will see that the compression state has already been cleared and
immediately return BZ_PARAM_ERROR, which we simply ignore.

3 months agoarchive_write_client: Free state in freer, not in closer
Dag-Erling Smørgrav [Mon, 8 Sep 2025 19:14:04 +0000 (21:14 +0200)] 
archive_write_client: Free state in freer, not in closer

The closer will not be called if a fatal error occurs, so the current
arrangement results in a memory leak.  The downside is that the freer
may be called even if we were not fully constructed, so it needs to
perform additional checks.  On the other hand, knowing that the freer
always gets called and will free the client state simplifies error
handling in the opener.

3 months agoMerge pull request #2717 from peakschris/cb_windows
Tim Kientzle [Fri, 22 Aug 2025 15:13:40 +0000 (08:13 -0700)] 
Merge pull request #2717 from peakschris/cb_windows

bsdtar: Allow @filename to have CRLF endings

3 months agoaddress review comment 2717/head
Chris Brown [Fri, 22 Aug 2025 08:00:44 +0000 (04:00 -0400)] 
address review comment