]> git.ipfire.org Git - thirdparty/libarchive.git/log
thirdparty/libarchive.git
4 weeks agoreturn early if archive_write_set_format_shar fails 2830/head
AZero13 [Fri, 26 Dec 2025 20:05:46 +0000 (15:05 -0500)] 
return early if archive_write_set_format_shar fails

5 weeks agoMerge pull request #2813 from AZero13/memcpy
Martin Matuška [Fri, 26 Dec 2025 09:22:13 +0000 (10:22 +0100)] 
Merge pull request #2813 from AZero13/memcpy

We copy from p, not p + module_len

5 weeks agoMerge pull request #2796 from vcoxvco/fix_unninit
Martin Matuška [Thu, 25 Dec 2025 09:16:46 +0000 (10:16 +0100)] 
Merge pull request #2796 from vcoxvco/fix_unninit

libarchive/archive_util.c: Uninitialized variable

5 weeks agoMerge pull request #2816 from AZero13/strdup
Martin Matuška [Thu, 25 Dec 2025 09:14:23 +0000 (10:14 +0100)] 
Merge pull request #2816 from AZero13/strdup

Error check strdup for path name

5 weeks agoMerge pull request #2814 from AZero13/gname
Martin Matuška [Thu, 25 Dec 2025 09:04:44 +0000 (10:04 +0100)] 
Merge pull request #2814 from AZero13/gname

uname_override checks gname_override when it should check uname_override

5 weeks agoMerge pull request #2789 from libarchive/dependabot/github_actions/all-actions-50b857948b
Martin Matuška [Thu, 25 Dec 2025 09:03:34 +0000 (10:03 +0100)] 
Merge pull request #2789 from libarchive/dependabot/github_actions/all-actions-50b857948b

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

5 weeks agoMerge pull request #2815 from AZero13/=
Martin Matuška [Thu, 25 Dec 2025 09:00:35 +0000 (10:00 +0100)] 
Merge pull request #2815 from AZero13/=

Use >=, not =>

5 weeks agoCI: Bump the all-actions group across 1 directory with 3 updates 2789/head
dependabot[bot] [Thu, 25 Dec 2025 08:53:17 +0000 (08:53 +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), [actions/upload-artifact](https://github.com/actions/upload-artifact) and [github/codeql-action](https://github.com/github/codeql-action).

Updates `actions/checkout` from 5.0.0 to 5.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/08c6903cd8c0fde910a37f88322edcfb5dd907a8...93cb6efe18208431cddfb8368fd83d5badbf9bfd)

Updates `actions/upload-artifact` from 4.6.2 to 5.0.0
- [Release notes](https://github.com/actions/upload-artifact/releases)
- [Commits](https://github.com/actions/upload-artifact/compare/ea165f8d65b6e75b540449e92b4886f43607fa02...330a01c490aca151604b8cf639adc76d48f6c5d4)

Updates `github/codeql-action` from 3.30.6 to 4.31.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/64d10c13136e1c5bce3e5fbde8d4906eeaafc885...014f16e7ab1402f30e7c3329d33797e7948572db)

---
updated-dependencies:
- dependency-name: actions/checkout
  dependency-version: 5.0.1
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: all-actions
- dependency-name: actions/upload-artifact
  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: 4.31.3
  dependency-type: direct:production
  update-type: version-update:semver-major
  dependency-group: all-actions
...

Signed-off-by: dependabot[bot] <support@github.com>
5 weeks agoMerge pull request #2819 from GabrielBarrantes/work/typos
Martin Matuška [Thu, 25 Dec 2025 08:48:17 +0000 (09:48 +0100)] 
Merge pull request #2819 from GabrielBarrantes/work/typos

Improve wording

5 weeks agoMerge pull request #2820 from skypher/oss-fuzz-expansion
Martin Matuška [Thu, 25 Dec 2025 08:47:17 +0000 (09:47 +0100)] 
Merge pull request #2820 from skypher/oss-fuzz-expansion

Expand OSS-Fuzz integration: 1 → 25 fuzz targets

5 weeks agoRefactor all fuzzers to use shared fuzz_helpers.h 2820/head
Leslie P. Polzer [Mon, 22 Dec 2025 04:53:06 +0000 (04:53 +0000)] 
Refactor all fuzzers to use shared fuzz_helpers.h

Complete the refactoring of all 25 fuzzers:
- Remove duplicate Buffer struct definitions from 15 format fuzzers
- Remove duplicate DataConsumer class from 7 API fuzzers
- Update consume_bytes() calls to match new signature
- All fuzzers now use shared helpers from fuzz_helpers.h

This eliminates ~1000 lines of duplicated code.

5 weeks agoRefactor fuzzers: add shared header, remove system() call
Leslie P. Polzer [Mon, 22 Dec 2025 04:26:57 +0000 (04:26 +0000)] 
Refactor fuzzers: add shared header, remove system() call

- Add fuzz_helpers.h with shared Buffer, reader_callback, DataConsumer
- Replace system("rm -rf") with nftw-based remove_directory_tree()
- Refactor entry, tar, write_disk fuzzers to use shared helpers
- Reduces code duplication and improves maintainability

5 weeks agoExpand OSS-Fuzz integration: 1 → 25 fuzz targets
Leslie P. Polzer [Mon, 22 Dec 2025 04:08:26 +0000 (04:08 +0000)] 
Expand OSS-Fuzz integration: 1 → 25 fuzz targets

Add comprehensive fuzzing coverage for libarchive:

Format-specific fuzzers (13):
- tar, zip, 7zip, rar, rar5, xar, cab, lha, iso9660, cpio, warc, mtree, ar

Security-critical fuzzers (4):
- encryption: encrypted archive handling
- write_disk: extraction path traversal
- read_disk: filesystem traversal, symlinks
- entry: ACL functions (previously 0% coverage)

API fuzzers (7):
- write: archive creation
- linkify: hardlink detection (complexity 775, was 0%)
- match: inclusion/exclusion patterns
- string: encoding conversions (UTF-8, wide chars)
- seek: seekable archive operations
- roundtrip: write-then-read consistency
- filter: compression/decompression

Supporting files:
- 14 dictionaries with format-specific magic bytes
- 9 options files for complex fuzzers
- Updated build script with seed corpora generation

Targets previously uncovered functions:
- archive_entry_linkify (complexity 775)
- ACL functions (complexity 705-713)
- xar_read_header (was 10.11% coverage)

Expected coverage improvement: 74% → 85-95%

5 weeks agoImprove wording 2819/head
Gabriel Barrantes [Sun, 21 Dec 2025 23:30:42 +0000 (17:30 -0600)] 
Improve wording

6 weeks agoMerge pull request #2812 from AZero13/w
Tim Kientzle [Thu, 18 Dec 2025 15:52:10 +0000 (07:52 -0800)] 
Merge pull request #2812 from AZero13/w

Fix p == null copy paste error

6 weeks agoError check strdup for path name 2816/head
AZero13 [Wed, 17 Dec 2025 02:50:06 +0000 (21:50 -0500)] 
Error check strdup for path name

6 weeks agoUse >=, not => 2815/head
AZero13 [Wed, 17 Dec 2025 02:48:45 +0000 (21:48 -0500)] 
Use >=, not =>

6 weeks agouname_override checks gname_override when it should check uname_override 2814/head
AZero13 [Wed, 17 Dec 2025 02:38:55 +0000 (21:38 -0500)] 
uname_override checks gname_override when it should check uname_override

6 weeks agoWe copy from p, not p + module_len 2813/head
AZero13 [Wed, 17 Dec 2025 02:38:55 +0000 (21:38 -0500)] 
We copy from p, not p + module_len

6 weeks agoFix p == null copy paste error 2812/head
AZero13 [Wed, 17 Dec 2025 02:37:16 +0000 (21:37 -0500)] 
Fix p == null copy paste error

6 weeks agoMerge pull request #2807 from KlaraSystems/des/list-tests
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

7 weeks 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)

7 weeks 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)

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

8 weeks 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

8 weeks 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

8 weeks 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 months 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 months 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 months 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 months 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 months 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

2 months agolibarchive/archive_util.c:__archive_issetugid: Fix uninitialized variable rgid 2796/head
vcoxvco [Sun, 23 Nov 2025 18:27:42 +0000 (19:27 +0100)] 
libarchive/archive_util.c:__archive_issetugid: Fix uninitialized variable rgid

2 months 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

2 months 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

2 months 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

2 months 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.

2 months 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.

2 months 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)")
2 months 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

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

2 months 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

2 months 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.

2 months 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.

2 months 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

2 months 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

2 months 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

2 months 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

2 months 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

2 months 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

2 months 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

2 months 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

2 months 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.

2 months 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

2 months 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

2 months 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

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

2 months 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

2 months 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.

2 months 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

2 months 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.

2 months 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

2 months 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

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

2 months 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.

2 months 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.

2 months 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

2 months 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

2 months 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]

2 months 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

2 months 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

2 months 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

3 months 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

3 months 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

3 months 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

3 months 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")

3 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!

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

3 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")

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

3 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).

3 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

3 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

3 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()")

3 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).

3 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

3 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

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

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

3 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

4 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

4 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

4 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

4 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

4 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

4 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

4 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

4 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

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