]> git.ipfire.org Git - thirdparty/libarchive.git/log
thirdparty/libarchive.git
12 days agoMerge pull request #2704 from kientzle/kientzle-harden-append-acl
Tim Kientzle [Sat, 26 Jul 2025 19:24:43 +0000 (12:24 -0700)] 
Merge pull request #2704 from kientzle/kientzle-harden-append-acl

Guard against invalid type arguments

(cherry picked from commit 6062470cbcf5ff76535b6f161ce9cc9f4c6f56c0)

12 days agoMerge pull request #2699 from mostynb/7z_eopm_reference
Tim Kientzle [Fri, 18 Jul 2025 02:18:53 +0000 (19:18 -0700)] 
Merge pull request #2699 from mostynb/7z_eopm_reference

7z: add liblzma EOPM reference
(cherry picked from commit cc97338239c5b1c0e0ffcb323d8cc4fd5929bf54)

12 days agoMerge pull request #2697 from Kraust/topic/cmake_build_fixes
Tim Kientzle [Mon, 14 Jul 2025 17:05:56 +0000 (10:05 -0700)] 
Merge pull request #2697 from Kraust/topic/cmake_build_fixes

Allow Compiling Against Static CRT.

(cherry picked from commit cb6b9e9a28218aadcb0275e41af1e5ffda7598b2)

3 weeks agoMerge pull request #2694 from stoeckmann/cleanups
Tim Kientzle [Sat, 12 Jul 2025 04:06:20 +0000 (21:06 -0700)] 
Merge pull request #2694 from stoeckmann/cleanups

Perform various cleanups

(cherry picked from commit 267042ebc7de8e4972d43d0c02433184649c1d4f)

3 weeks agoMerge pull request #2691 from kientzle/kientzle-issue2681
Tim Kientzle [Sun, 29 Jun 2025 19:03:51 +0000 (12:03 -0700)] 
Merge pull request #2691 from kientzle/kientzle-issue2681

Add missing test file

(cherry picked from commit d06700a0986b80c456d82800eaf1de872cf9ea6c)

3 weeks agoMerge pull request #2664 from fedegiova/fix_leak_for_cb_error
Tim Kientzle [Sun, 29 Jun 2025 02:15:32 +0000 (19:15 -0700)] 
Merge pull request #2664 from fedegiova/fix_leak_for_cb_error

Fix a memory leak if write callback error early

(cherry picked from commit 595fb29e4cf7cfd43bce0dfce7547cbcdfbd077b)

3 weeks agoMerge pull request #2658 from stoeckmann/skip_tests
Tim Kientzle [Sun, 29 Jun 2025 02:14:17 +0000 (19:14 -0700)] 
Merge pull request #2658 from stoeckmann/skip_tests

Skip tests if respective support is missing

(cherry picked from commit 609d8122f1c5210c57bcf14ac35cd4622b8546b1)

3 weeks agoMerge pull request #2673 from 004helix/master
Tim Kientzle [Sun, 29 Jun 2025 02:10:27 +0000 (19:10 -0700)] 
Merge pull request #2673 from 004helix/master

archive_cryptor_private.h: check message digest functions are enabled for windows

(cherry picked from commit 31cff981e4fe9a583de43b239fb23e77045b293a)

3 weeks agoMerge pull request #2679 from AZero13/error
Tim Kientzle [Sun, 29 Jun 2025 02:09:12 +0000 (19:09 -0700)] 
Merge pull request #2679 from AZero13/error

Handle possible errors from system calls

(cherry picked from commit d8aaf88c9feab047139df4cae60d845764a2480a)

3 weeks agoMerge pull request #2687 from hemant-jadhav-emerson/master
Tim Kientzle [Sun, 29 Jun 2025 02:04:30 +0000 (19:04 -0700)] 
Merge pull request #2687 from hemant-jadhav-emerson/master

Supress restrict keyword for msc_ver older than 1927

(cherry picked from commit ee49ac81068f93754f004368f2cc72c95a8bf056)

3 weeks agoMerge pull request #2689 from ElvishJerricco/linux-fs-flags
Tim Kientzle [Sat, 28 Jun 2025 21:23:02 +0000 (14:23 -0700)] 
Merge pull request #2689 from ElvishJerricco/linux-fs-flags

clear_nochange_fflags: Use linux FS flags

(cherry picked from commit 9fe18ba0a644893c94d7b809885b4f32786a88ed)

3 weeks agoMerge pull request #2684 from DHowett/dev/duhowett/shim_open
Tim Kientzle [Sat, 28 Jun 2025 21:22:26 +0000 (14:22 -0700)] 
Merge pull request #2684 from DHowett/dev/duhowett/shim_open

win32: shim wopen, and make both open/wopen use _s "secure" variant
(cherry picked from commit cd020d1ccb9791057e7a13de51122dbe11fafa94)

3 weeks agoMerge pull request #2688 from stoeckmann/entry_off32
Tim Kientzle [Sat, 28 Jun 2025 21:11:17 +0000 (14:11 -0700)] 
Merge pull request #2688 from stoeckmann/entry_off32

Ignore sizes which do not fit into off_t

(cherry picked from commit a474bab7e381e4d54dc336b8206060e64b81cffd)

3 weeks agoMerge pull request #2672 from AZero13/ferror
Tim Kientzle [Fri, 20 Jun 2025 21:33:45 +0000 (14:33 -0700)] 
Merge pull request #2672 from AZero13/ferror

Fix error checking in writing files

(cherry picked from commit ffde04f27231cabb91cebcbd7eca08d0f5088dc8)

3 weeks agoMerge pull request #2678 from mostynb/zstd_filter_checksum
Tim Kientzle [Fri, 20 Jun 2025 16:32:51 +0000 (09:32 -0700)] 
Merge pull request #2678 from mostynb/zstd_filter_checksum

Enable Zstandard's checksum feature in the zstd write filter

(cherry picked from commit a218a52dbba98ff4071105207ff9275efff3eabe)

3 weeks agoMerge pull request #2677 from AZero13/fwrite
Tim Kientzle [Thu, 19 Jun 2025 23:12:26 +0000 (16:12 -0700)] 
Merge pull request #2677 from AZero13/fwrite

Change error message from "fwrite function failed" to "write function failed"

(cherry picked from commit e4978e2edd2b59ef93304e3534622a0647f05a73)

3 weeks agoMerge pull request #2676 from danyeaw/fix-pkgconf-path
Tim Kientzle [Thu, 19 Jun 2025 15:20:43 +0000 (08:20 -0700)] 
Merge pull request #2676 from danyeaw/fix-pkgconf-path

Fix .pc location when CMAKE_INSTALL_LIBDIR not set

(cherry picked from commit 6a252c84a283789af4bf060b5d750840472dbdb2)

3 weeks agoMerge pull request #2659 from stoeckmann/chld
Martin Matuška [Thu, 12 Jun 2025 08:59:43 +0000 (10:59 +0200)] 
Merge pull request #2659 from stoeckmann/chld

Improve filter process handling

(cherry picked from commit 6effe2ec6bdc636573f9ea82bff3add632862333)

3 weeks agoMerge pull request #2669 from benoit-pierre/pr/minor_test_related_tweaks
Martin Matuška [Thu, 12 Jun 2025 08:57:17 +0000 (10:57 +0200)] 
Merge pull request #2669 from benoit-pierre/pr/minor_test_related_tweaks

minor test related tweaks

(cherry picked from commit 251f7e839c17cbfffc08439ca332e13082ef6875)

3 weeks agoMerge pull request #2663 from stoeckmann/filename_errpath
Martin Matuška [Thu, 12 Jun 2025 08:56:32 +0000 (10:56 +0200)] 
Merge pull request #2663 from stoeckmann/filename_errpath

open_filename: Free memory on error paths

(cherry picked from commit 47bdf824892f09dc604a6de180202f0f61c225ff)

3 weeks agoMerge pull request #2665 from stoeckmann/read_data_sparse
Martin Matuška [Thu, 12 Jun 2025 08:54:08 +0000 (10:54 +0200)] 
Merge pull request #2665 from stoeckmann/read_data_sparse

archive_read_data: Handle sparse holes at end of file correctly

(cherry picked from commit c3be70e0711b273bfa4f8dc41b8a88848473cec8)

3 weeks agoMerge pull request #2668 from stoeckmann/7z_oob
Martin Matuška [Thu, 12 Jun 2025 08:51:45 +0000 (10:51 +0200)] 
Merge pull request #2668 from stoeckmann/7z_oob

7zip: Fix out of boundary access
(cherry picked from commit 9bdc5b82f7b98c9fa0c499268341be2aaf1f699e)

3 weeks agoMerge pull request #2662 from stoeckmann/set_format_strcpy
Tim Kientzle [Wed, 4 Jun 2025 12:58:32 +0000 (05:58 -0700)] 
Merge pull request #2662 from stoeckmann/set_format_strcpy

archive_read_set_format: Remove strcpy calls

(cherry picked from commit 0931c12b7eb43bedefec4cde89e1e7e0b3d25477)

3 weeks agoMerge pull request #2660 from kevans91/ke/fix-fortify
Tim Kientzle [Tue, 3 Jun 2025 13:02:09 +0000 (06:02 -0700)] 
Merge pull request #2660 from kevans91/ke/fix-fortify

libarchive/test: fix build when memcpy() is a macro

(cherry picked from commit a8f93f2480a2a0511485e5a24cb975a0d205fec6)

3 weeks agoMerge pull request #2655 from mmatuska/fix/setclocale
Tim Kientzle [Sun, 1 Jun 2025 23:04:49 +0000 (16:04 -0700)] 
Merge pull request #2655 from mmatuska/fix/setclocale

test_utils/test_main.c: satisfy -Wstrict-prototypes

(cherry picked from commit 0f9a06d6abb1ab00e48580d488facbd78240ee50)

4 months agoRelease 3.8.1 v3.8.1
Martin Matuska [Sun, 1 Jun 2025 19:26:44 +0000 (21:26 +0200)] 
Release 3.8.1

4 months agoMerge pull request #2627 from heirecka/do-not-hard-code-pkg-config
Martin Matuška [Sat, 31 May 2025 19:40:04 +0000 (21:40 +0200)] 
Merge pull request #2627 from heirecka/do-not-hard-code-pkg-config

Use PKG_CONFIG instead of hard-coded pkg-config

(cherry picked from commit 70978468e9078601d9f8e0c2be55762c0b3ff3e2)

4 months agoMerge pull request #2643 from stoeckmann/tar_pax_sparse
Martin Matuška [Sat, 31 May 2025 19:31:14 +0000 (21:31 +0200)] 
Merge pull request #2643 from stoeckmann/tar_pax_sparse

tar: Handle extra bytes after sparse entries
(cherry picked from commit c7b7bd7c0e3aa29caf874efe6686cd0f78e1842d)

4 months agoMerge pull request #2652 from stoeckmann/wstring_ensure
Tim Kientzle [Sat, 31 May 2025 14:16:07 +0000 (07:16 -0700)] 
Merge pull request #2652 from stoeckmann/wstring_ensure

Check archive_wstring_ensure return value

(cherry picked from commit 8d074302ac6b50e54d7e0430ced19c1b878cce32)

4 months agoMerge pull request #2651 from stoeckmann/string_ensure_check
Tim Kientzle [Sat, 31 May 2025 02:50:25 +0000 (19:50 -0700)] 
Merge pull request #2651 from stoeckmann/string_ensure_check

Always check archive_string_ensure return value

(cherry picked from commit 101230094c5793b3f82a2f3531b0ebd4b406e85f)

4 months agoMerge pull request #2648 from stoeckmann/test_en_us
Tim Kientzle [Sat, 31 May 2025 02:35:44 +0000 (19:35 -0700)] 
Merge pull request #2648 from stoeckmann/test_en_us

test_utils: Enforce C locale for all tests

(cherry picked from commit 8540cb7cfbfb47340ecae856d7f2a1292096e936)

4 months agoMerge pull request #2650 from stoeckmann/string_sort
Tim Kientzle [Sat, 31 May 2025 02:33:34 +0000 (19:33 -0700)] 
Merge pull request #2650 from stoeckmann/string_sort

archive_utility_string_sort: Use qsort directly

(cherry picked from commit e2eda9e68b7174eb37b80c0dd4761e71a989db5c)

4 months agoMerge pull request #2634 from stoeckmann/tar_neg_time
Tim Kientzle [Fri, 30 May 2025 00:31:28 +0000 (17:31 -0700)] 
Merge pull request #2634 from stoeckmann/tar_neg_time

tar: Support negative time values with pax
(cherry picked from commit 9b07a143ee0e55d04ef602e926f2d343ee5a9a8f)

4 months agoMerge pull request #2649 from stoeckmann/compress_recursion
Tim Kientzle [Thu, 29 May 2025 23:37:44 +0000 (16:37 -0700)] 
Merge pull request #2649 from stoeckmann/compress_recursion

compress: Prevent call stack overflow
(cherry picked from commit cd5c44c5d0470a5bb497541ae7bcb617c4480855)

4 months agoMerge pull request #2642 from stoeckmann/seek_regress
Tim Kientzle [Wed, 28 May 2025 03:55:15 +0000 (20:55 -0700)] 
Merge pull request #2642 from stoeckmann/seek_regress

Fix FILE_skip regression

(cherry picked from commit 59b09796c3402489c3f47625b6401a28d24ad8a4)

4 months agoMerge pull request #2644 from stoeckmann/tar_neg_size
Tim Kientzle [Wed, 28 May 2025 03:52:36 +0000 (20:52 -0700)] 
Merge pull request #2644 from stoeckmann/tar_neg_size

tar: Always treat negative sizes as error
(cherry picked from commit d261f46ae57f115a48c0bef10643753cb305a9a5)

4 months agoMerge pull request #2645 from stoeckmann/tar_formatter
Tim Kientzle [Wed, 28 May 2025 03:43:46 +0000 (20:43 -0700)] 
Merge pull request #2645 from stoeckmann/tar_formatter

tar: Fix archive_set_error formatters
(cherry picked from commit dcdd7338d68c30d8171b483c7fa25729ae1a1f56)

4 months agoMerge pull request #2646 from stoeckmann/sparse32
Tim Kientzle [Wed, 28 May 2025 03:41:19 +0000 (20:41 -0700)] 
Merge pull request #2646 from stoeckmann/sparse32

tar: Handle many sparse comments on 32 bit systems
(cherry picked from commit 702f31a01cf2a867b2df8c4be6a6d2e8ae403078)

4 months agoMerge pull request #2640 from robUx4/xml-uuid
Tim Kientzle [Mon, 26 May 2025 16:06:47 +0000 (09:06 -0700)] 
Merge pull request #2640 from robUx4/xml-uuid

[cmake] add uuid library when using xmllite

(cherry picked from commit 6389d172ed25de1b84606716553241c171a30111)

4 months agoMerge pull request #2637 from stoeckmann/pax_nl
Tim Kientzle [Sun, 25 May 2025 23:22:59 +0000 (16:22 -0700)] 
Merge pull request #2637 from stoeckmann/pax_nl

tar: Keep block alignment after pax error
(cherry picked from commit 341dd5d1d45ce320ff05928e50efafd8ed42ed81)

4 months agoMerge pull request #2639 from stoeckmann/sprintf_ll
Tim Kientzle [Sun, 25 May 2025 23:19:38 +0000 (16:19 -0700)] 
Merge pull request #2639 from stoeckmann/sprintf_ll

Add ll length modifier to archive_string_vsprintf

(cherry picked from commit 18d456377ea7c8fe7946fa7b45b87d5da294640b)

4 months agoMerge pull request #2636 from zhaofengli/reset-header-state-after-mac-metadata
Tim Kientzle [Sun, 25 May 2025 00:18:00 +0000 (17:18 -0700)] 
Merge pull request #2636 from zhaofengli/reset-header-state-after-mac-metadata

tar: Reset accumulated header state after reading macOS metadata blob
(cherry picked from commit b6e1f06457e61c182dd2f34b9fb37701cfda041b)

4 months agoMerge pull request #2630 from stoeckmann/wincrypt_casts
Tim Kientzle [Sat, 24 May 2025 17:45:57 +0000 (10:45 -0700)] 
Merge pull request #2630 from stoeckmann/wincrypt_casts

Fix archive_wincrypt_version

(cherry picked from commit 42c2f8464962990bf7df0df2f3cbd0ce80121190)

4 months agoMerge pull request #2633 from stoeckmann/match_cleanup
Tim Kientzle [Sat, 24 May 2025 17:37:02 +0000 (10:37 -0700)] 
Merge pull request #2633 from stoeckmann/match_cleanup

archive_match: Simplify and clean up code

(cherry picked from commit 6dbea2df3bc8288d52c65cb3d543a1e883162a20)

4 months agoMerge pull request #2632 from stoeckmann/cygwin_definition
Tim Kientzle [Sat, 24 May 2025 17:23:28 +0000 (10:23 -0700)] 
Merge pull request #2632 from stoeckmann/cygwin_definition

Prefer __CYGWIN__ over CYGWIN definition

(cherry picked from commit cdc185e9177edcdc03bb5c1983d59874d434fb12)

4 months agoMerge pull request #2631 from stoeckmann/configure_windows
Tim Kientzle [Sat, 24 May 2025 02:58:02 +0000 (19:58 -0700)] 
Merge pull request #2631 from stoeckmann/configure_windows

configure.ac: Improve Windows version detection

(cherry picked from commit 0ed4435209b9b694cc190d937e4709a0609580e6)

4 months agoMerge pull request #2509 from tesap/install-lib-dir
Tim Kientzle [Sat, 24 May 2025 02:57:14 +0000 (19:57 -0700)] 
Merge pull request #2509 from tesap/install-lib-dir

Make installation lib dir depend on CMAKE_INSTALL_LIBDIR variable

(cherry picked from commit 992734d6cc557e3387f9cfd44a0cca3934d22262)

4 months agoMerge pull request #2629 from mmatuska/fix/versiontest
Tim Kientzle [Sat, 24 May 2025 02:39:00 +0000 (19:39 -0700)] 
Merge pull request #2629 from mmatuska/fix/versiontest

tests: accept underscore in arbitrary third-party version strings
(cherry picked from commit 627ba5bbbf80fe25dbf5015ef304a905a2820f17)

4 months agoRelease 3.8.0 v3.8.0
Martin Matuska [Tue, 20 May 2025 08:35:37 +0000 (10:35 +0200)] 
Release 3.8.0

4 months agoCI: Bump the all-actions group across 1 directory with 4 updates (#2623)
dependabot[bot] [Tue, 20 May 2025 08:19:56 +0000 (10:19 +0200)] 
CI: Bump the all-actions group across 1 directory with 4 updates (#2623)

Bumps the all-actions group with 4 updates:
`actions/checkout` from 4.2.1 to 4.2.2
`actions/upload-artifact` from 4.4.3 to 4.6.2
`github/codeql-action` from 3.26.12 to 3.28.18
`ossf/scorecard-action` from 2.4.0 to 2.4.1

4 months agoAdd some more error checking to shell scripts (#2617)
Mostyn Bramley-Moore [Tue, 20 May 2025 08:14:17 +0000 (10:14 +0200)] 
Add some more error checking to shell scripts (#2617)

Exit immediately if a command exits with a non-zero status, and treat
unset variables as an error when substituting.

4 months agoMerge pull request #2612 from AZero13/okay-what
Tim Kientzle [Tue, 20 May 2025 02:39:10 +0000 (19:39 -0700)] 
Merge pull request #2612 from AZero13/okay-what

Fatal if field[0].start is null

4 months agoMerge pull request #2622 from AZero13/calculate-size
Tim Kientzle [Tue, 20 May 2025 02:38:04 +0000 (19:38 -0700)] 
Merge pull request #2622 from AZero13/calculate-size

Calculate size of arrays instead of assuming they are always 6

4 months agoMerge pull request #2621 from AZero13/redundant-s
Tim Kientzle [Tue, 20 May 2025 02:36:57 +0000 (19:36 -0700)] 
Merge pull request #2621 from AZero13/redundant-s

*s != '\0' is redundant

4 months agoMerge pull request #2619 from AZero13/patch-2
Tim Kientzle [Tue, 20 May 2025 02:34:24 +0000 (19:34 -0700)] 
Merge pull request #2619 from AZero13/patch-2

days should be a long type

4 months agoMerge pull request #2618 from AZero13/patch-1
Tim Kientzle [Tue, 20 May 2025 02:32:32 +0000 (19:32 -0700)] 
Merge pull request #2618 from AZero13/patch-1

Label error and errorx as __LA_NORETURN

4 months agoCalculate size of arrays instead of assuming they are always 6 2622/head
Rose [Mon, 19 May 2025 19:19:57 +0000 (15:19 -0400)] 
Calculate size of arrays instead of assuming they are always 6

4 months ago*s != '\0' is redundant 2621/head
Rose [Mon, 19 May 2025 19:16:18 +0000 (15:16 -0400)] 
*s != '\0' is redundant

Not that this does anything to codegen probably, but it is still redundant.

4 months agoFatal if field[0].start or field[0].end is null 2612/head
Rose [Sat, 17 May 2025 23:35:22 +0000 (19:35 -0400)] 
Fatal if field[0].start or field[0].end is null

We should not get here, but given that the check exists, we should not let it happen if this is NULL because otherwise we just dereference it later on.

4 months agodays should be a long type 2619/head
AZero13 [Mon, 19 May 2025 17:39:32 +0000 (13:39 -0400)] 
days should be a long type

The difference in years is cast to a long and then multiplied by 365. The return value of the function is also a long.

4 months agoLabel error and errorx as __LA_NORETURN 2618/head
AZero13 [Mon, 19 May 2025 17:35:19 +0000 (13:35 -0400)] 
Label error and errorx as __LA_NORETURN

This also prevents clang-tidy from reporting some false bugs.

4 months agoMerge pull request #2611 from zhaofengli/fix-iconv-pc
Tim Kientzle [Sun, 18 May 2025 22:44:48 +0000 (15:44 -0700)] 
Merge pull request #2611 from zhaofengli/fix-iconv-pc

autotools: Fix iconv issues in generated .pc file

4 months agoMerge pull request #2613 from mmatuska/fix/7zipsfx-2
Tim Kientzle [Sun, 18 May 2025 22:41:26 +0000 (15:41 -0700)] 
Merge pull request #2613 from mmatuska/fix/7zipsfx-2

7z: fix another out-of-bounds read in 7z SFX archive detection

4 months agoMerge pull request #2616 from mostynb/contrib_psota-benchmark_tcp_sh_bash
Tim Kientzle [Sun, 18 May 2025 22:26:17 +0000 (15:26 -0700)] 
Merge pull request #2616 from mostynb/contrib_psota-benchmark_tcp_sh_bash

contrib/psota-benchmark/tcp.sh is a bash script

4 months agoMerge pull request #2614 from AZero13/tar-2
Tim Kientzle [Sun, 18 May 2025 22:25:11 +0000 (15:25 -0700)] 
Merge pull request #2614 from AZero13/tar-2

Assign a result when failure happens

4 months agoMerge pull request #2600 from nvinson/master
Tim Kientzle [Sun, 18 May 2025 21:59:36 +0000 (14:59 -0700)] 
Merge pull request #2600 from nvinson/master

Copy ae digests to mtree_entry

4 months agoRemove long-unused travis CI script (#2615)
Mostyn Bramley-Moore [Sun, 18 May 2025 16:55:32 +0000 (18:55 +0200)] 
Remove long-unused travis CI script (#2615)

Support for travis CI was removed in 2019, this script hasn't been used
since.

4 months agocontrib/psota-benchmark/tcp.sh is a bash script 2616/head
Mostyn Bramley-Moore [Sun, 18 May 2025 10:58:27 +0000 (12:58 +0200)] 
contrib/psota-benchmark/tcp.sh is a bash script

I am unsure if this is still used, but it fails to run in Bourne shell.

4 months agoAssign a result when failure happens 2614/head
Rose [Sun, 18 May 2025 01:24:51 +0000 (21:24 -0400)] 
Assign a result when failure happens

In some places, result is checked even after failure, so let's assign a result.

4 months ago7z: fix another out-of-bounds read in 7z SFX archive detection 2613/head
Martin Matuska [Sun, 18 May 2025 00:40:05 +0000 (02:40 +0200)] 
7z: fix another out-of-bounds read in 7z SFX archive detection

When looping over program header entries (e_shnum)
we need to increment sec_tbl_offset by e_shentsize
and not by fixed values.

Fixes OSS-Fuzz issue 418349489

4 months agoMerge pull request #2610 from stoeckmann/string_int_size_t
Tim Kientzle [Sun, 18 May 2025 00:15:03 +0000 (17:15 -0700)] 
Merge pull request #2610 from stoeckmann/string_int_size_t

archive_string: Check values before casts

4 months agoautotools: Fix iconv issues in generated .pc file 2611/head
Zhaofeng Li [Sat, 17 May 2025 00:03:52 +0000 (18:03 -0600)] 
autotools: Fix iconv issues in generated .pc file

The goal is to make everyone (including msys2) happy.

Fixes #1766 and #1819.

Signed-off-by: Zhaofeng Li <hello@zhaofeng.li>
4 months agoMerge pull request #2609 from stoeckmann/safe_fprintf
Tim Kientzle [Sat, 17 May 2025 18:46:32 +0000 (11:46 -0700)] 
Merge pull request #2609 from stoeckmann/safe_fprintf

tar: Handle more edge cases in safe_fprintf

4 months agotest_utils/test_main.c: increase logfilename bf sz 2600/head
Nicholas Vinson [Sat, 17 May 2025 15:30:23 +0000 (11:30 -0400)] 
test_utils/test_main.c: increase logfilename bf sz

Increase logfilename buffer size from 64 to 256. This aligns the buffer
size with the size limits found in Windows and Linux.

4 months agoReplace struct ae_mset_digest with uint_least32_t
Nicholas Vinson [Tue, 13 May 2025 23:38:50 +0000 (19:38 -0400)] 
Replace struct ae_mset_digest with uint_least32_t

Signed-off-by: Nicholas Vinson <nvinson234@gmail.com>
4 months agoCopy ae digests to mtree_entry
Nicholas Vinson [Sun, 13 Apr 2025 11:33:43 +0000 (07:33 -0400)] 
Copy ae digests to mtree_entry

    Copy ae digests to mtree_entry. This simplifies porting non-archive
    formats to archive formats while preserving supported message
    digests specifically in cases where recomputing digests is not
    viable.

Signed-off-by: Nicholas Vinson <nvinson234@gmail.com>
4 months agoarchive_string: Check values before casts 2610/head
Tobias Stoeckmann [Sat, 17 May 2025 08:36:47 +0000 (10:36 +0200)] 
archive_string: Check values before casts

The size_t to int conversion is especially required on Windows systems
to support their int-based functions. These variables should be properly
checked before casts. This avoids integer truncations with large
strings.

I prefer size_t over int for sizes and adjusted variables to size_t
where possible to avoid casts.

Signed-off-by: Tobias Stoeckmann <tobias@stoeckmann.org>
4 months agoMerge pull request #2604 from mmatuska/fix/7zipsfx
Tim Kientzle [Fri, 16 May 2025 23:40:24 +0000 (16:40 -0700)] 
Merge pull request #2604 from mmatuska/fix/7zipsfx

7z: fix out-of-bounds read in 7z self extracting archive detection

4 months agoMerge pull request #2607 from zhaofengli/disallow-multiple-files-from
Tim Kientzle [Fri, 16 May 2025 22:49:16 +0000 (15:49 -0700)] 
Merge pull request #2607 from zhaofengli/disallow-multiple-files-from

bsdtar: Disallow multiple --files-from/-T options

4 months agotar: Make safe_fprintf more platform independent 2609/head
Tobias Stoeckmann [Fri, 16 May 2025 22:01:53 +0000 (00:01 +0200)] 
tar: Make safe_fprintf more platform independent

If vsnprintf fails with errno EOVERFLOW, the results are very platform
dependent but never useful. The implementation in glibc fills bytes with
blanks, FreeBSD fills them with zeros, OpenBSD and Windows set first
byte to '\0'.

Just stop processing and don't print anything, which makes it follow
the OpenBSD and Windows approach.

Signed-off-by: Tobias Stoeckmann <tobias@stoeckmann.org>
4 months agotar: Fix safe_fprintf comment
Tobias Stoeckmann [Fri, 16 May 2025 21:25:42 +0000 (23:25 +0200)] 
tar: Fix safe_fprintf comment

The stack buffer is never used for out of memory messages.

Signed-off-by: Tobias Stoeckmann <tobias@stoeckmann.org>
4 months agotar: Support large strings in safe_fprintf
Tobias Stoeckmann [Fri, 16 May 2025 21:11:52 +0000 (23:11 +0200)] 
tar: Support large strings in safe_fprintf

The vsnprintf calls might return INT_MAX with very long strings.
Prevent a signed integer overflow when taking an additional nul
byte into account.

Signed-off-by: Tobias Stoeckmann <tobias@stoeckmann.org>
4 months agotar: Always use correct length in safe_fprintf
Tobias Stoeckmann [Fri, 16 May 2025 21:08:59 +0000 (23:08 +0200)] 
tar: Always use correct length in safe_fprintf

If the format buffer shall not be further increased in size, the
length value mistakenly takes the terminating nul byte into account.

This is in contrast to a successful vsnprintf call.

Also use the correct string length if fallback to stack buffer is
required.

Signed-off-by: Tobias Stoeckmann <tobias@stoeckmann.org>
4 months agotar: Clear safe_fprintf stack before usage
Tobias Stoeckmann [Fri, 16 May 2025 21:50:27 +0000 (23:50 +0200)] 
tar: Clear safe_fprintf stack before usage

The stack buffer is never cleared, which can become an issue depending
on vsnprintf implementation's behavior if -1 is returned. The code
would eventually fall back to stack buffer which might be not
nul terminated.

Signed-off-by: Tobias Stoeckmann <tobias@stoeckmann.org>
4 months ago7z: Free the file if compression-level option is invalid (#2608)
AZero13 [Fri, 16 May 2025 21:41:18 +0000 (17:41 -0400)] 
7z: Free the file if compression-level option is invalid (#2608)

Otherwise, the file is leaked.

4 months agobsdtar: Disallow multiple --files-from/-T options 2607/head
Zhaofeng Li [Fri, 16 May 2025 17:34:08 +0000 (11:34 -0600)] 
bsdtar: Disallow multiple --files-from/-T options

4 months agoMerge pull request #2606 from zhaofengli/parse-unix-epoch-date
Tim Kientzle [Fri, 16 May 2025 01:06:03 +0000 (18:06 -0700)] 
Merge pull request #2606 from zhaofengli/parse-unix-epoch-date

Support @-prefixed Unix epoch timestamps as date strings

4 months agoSupport @-prefixed Unix epoch timestamps as date strings 2606/head
Zhaofeng Li [Wed, 14 May 2025 22:01:44 +0000 (16:01 -0600)] 
Support @-prefixed Unix epoch timestamps as date strings

Signed-off-by: Zhaofeng Li <hello@zhaofeng.li>
4 months agobsdtar: Support `--mtime` and `--clamp-mtime` (#2601)
Zhaofeng Li [Thu, 15 May 2025 12:08:14 +0000 (06:08 -0600)] 
bsdtar: Support `--mtime` and `--clamp-mtime` (#2601)

Hi,

This PR adds support for setting a forced mtime on all written files
(`--mtime` and `--clamp-mtime`) in bsdtar.

The end goal will be to support all functionalities in
<https://reproducible-builds.org/docs/archives/#full-example>, namely
`--sort` and disabling other attributes (atime, ctime, etc.).

Fixes #971.

## History

- [v1](https://github.com/zhaofengli/libarchive/tree/forced-mtime-v1):
Added `archive_read_disk_set_forced_mtime` in libarchive. As a result,
it was only applied when reading from the filesystem and not from other
archives.
- [v2](https://github.com/zhaofengli/libarchive/tree/forced-mtime-v2):
Refactored to apply the forced mtime in `archive_write`.
- v3 (current): Reduced libarchive change to exposing
`archive_parse_date`, moved clamping logic into bsdtar.

---------

Signed-off-by: Zhaofeng Li <hello@zhaofeng.li>
Co-authored-by: Dustin L. Howett <dustin@howett.net>
4 months agoAllow setting the original filename for gzip compressed files (#2544)
Marcus Tillmanns [Thu, 15 May 2025 12:07:48 +0000 (14:07 +0200)] 
Allow setting the original filename for gzip compressed files (#2544)

Co-authored-by: Martin Matuška <martin@matuska.de>
4 months agocorrect only modes of `--no-mac-metadata` in bsdtar.1 (#2597)
Moroshima [Thu, 15 May 2025 10:59:37 +0000 (18:59 +0800)] 
correct only modes of `--no-mac-metadata` in bsdtar.1 (#2597)

`--no-mac-metadata` is c, r, u and x mode only

4 months agoFix mbedtls version 3 compatibility (#2602)
James Hilliard [Thu, 15 May 2025 10:56:59 +0000 (04:56 -0600)] 
Fix mbedtls version 3 compatibility (#2602)

We need to use the new API for mbedtls 3 compatibility

Fixes #2025

Signed-off-by: James Hilliard <james.hilliard1@gmail.com>
4 months agosafe_printf should annotate with restrict (#2605)
AZero13 [Thu, 15 May 2025 01:24:54 +0000 (21:24 -0400)] 
safe_printf should annotate with restrict (#2605)

printf has restrict for its parameters, and safe_printf should do the
same.

4 months ago7z: fix out-of-bounds read in 7z self extracting archive detection 2604/head
Martin Matuska [Wed, 14 May 2025 10:37:26 +0000 (12:37 +0200)] 
7z: fix out-of-bounds read in 7z self extracting archive detection

Fixes OSS-Fuzz issue 416832167

4 months agorar: Fix heap-buffer-overflow (#2599)
Tobias Stoeckmann [Sun, 11 May 2025 17:00:11 +0000 (19:00 +0200)] 
rar: Fix heap-buffer-overflow (#2599)

A filter block size must not be larger than the lzss window, which is
defined
by dictionary size, which in turn can be derived from unpacked file
size.

While at it, improve error messages and fix lzss window wrap around
logic.

Fixes https://github.com/libarchive/libarchive/issues/2565

---------

Signed-off-by: Tobias Stoeckmann <tobias@stoeckmann.org>
Co-authored-by: Tim Kientzle <kientzle@acm.org>
4 months agorar: Fix double free with over 4 billion nodes (#2598)
Tobias Stoeckmann [Sun, 11 May 2025 00:17:19 +0000 (02:17 +0200)] 
rar: Fix double free with over 4 billion nodes (#2598)

If a system is capable of handling 4 billion nodes in memory, a double
free could occur because of an unsigned integer overflow leading to a
realloc call with size argument of 0. Eventually, the client will
release that memory again, triggering a double free.

Signed-off-by: Tobias Stoeckmann <tobias@stoeckmann.org>
4 months ago7z sfx overaly detection (#2088)
mehrabiworkmail [Fri, 9 May 2025 17:21:32 +0000 (10:21 -0700)] 
7z sfx overaly detection (#2088)

To detect 7z SFX files, libarchive currently searches for the 7z header
in a hard-coded addr range of the PE/ELF file
(specified via macros SFX_MIN_ADDR and SFX_MAX_ADDR). This causes it to
miss SFX files that may stray outside these values (libarchive fails to
extract 7z SFX ELF files created by recent versions of 7z tool because
of this issue). This patch fixes the issue by finding a more robust
starting point for the 7z header search: overlay in PE or the .data
section in ELF. This patch also adds 3 new test cases for 7z SFX to
libarchive.

Fixes https://github.com/libarchive/libarchive/issues/2075

---------

Co-authored-by: Masoud Mehrabi Koushki <masoud.mehrabi.koushki1@huawei.com>
Co-authored-by: Martin Matuška <martin@matuska.de>
4 months ago7zip reader: add test for POWERPC filter support for LZMA compressor (#2460)
Mostyn Bramley-Moore [Fri, 9 May 2025 11:40:56 +0000 (13:40 +0200)] 
7zip reader: add test for POWERPC filter support for LZMA compressor (#2460)

This new test archive contains a C hello world executable built like so
on a ubuntu 24.04 machine:
```
int main(int argc, char *argv[]) {
  printf("hello, world\n");
  return 0;
}
```

`powerpc-linux-gnu-gcc hw.c -o hw-powerpc -Wall`

The test archive that contains this executable was created like so,
using 7-Zip 24.08: `7zz a -t7z -m0=lzma2 -mf=ppc
libarchive/test/test_read_format_7zip_lzma2_powerpc.7z hw-powerpc`

The new test archive is required because the powerpc filter for lzma is
implemented in liblzma rather than in libarchive.

4 months agoxar: add xmllite support to the XAR reader and writer (#2388)
Dustin L. Howett [Fri, 9 May 2025 11:40:21 +0000 (06:40 -0500)] 
xar: add xmllite support to the XAR reader and writer (#2388)

This commit adds support for reading and writing XAR archives on Windows
using the built-in xmllite library. xmllite is present in all versions
of Windows starting with Windows XP.

With this change, no external XML library (libxml2, expat) is required
to read or produce XAR archives on Windows.

xmllite is a little bit annoying in that it's entirely a COM API--the
likes of which are annoying to use from C.

Signed-off-by: Dustin L. Howett <dustin@howett.net>
Depends on e619342dfa36b887ffa0ea33e98d04cb161cd7de
Closes #1811

4 months agoPolish for GNU tar format reading/writing (#2455)
Tim Kientzle [Fri, 9 May 2025 11:36:05 +0000 (04:36 -0700)] 
Polish for GNU tar format reading/writing (#2455)

A few small tweaks to improve reading/writing of the legacy GNU tar
format.

* Be more tolerant of redundant 'K' and 'L' headers
* Fill in missing error messages for redundant headers
* New test for reading archive with redundant 'L' headers
* Earlier identification of GNU tar format in some cases

These changes were inspired by Issue #2434. Although that was determined
to not technically be a bug in libarchive, it's relatively easy for
libarchive to tolerate duplicate 'K' and 'L' headers and we should be
issuing appropriate error messages in any case.