]> git.ipfire.org Git - thirdparty/libarchive.git/log
thirdparty/libarchive.git
4 months agoRelease 3.7.9 patch/3.7 v3.7.9
Martin Matuska [Sun, 30 Mar 2025 19:19:12 +0000 (21:19 +0200)] 
Release 3.7.9

4 months agoIssue 2548: Reading GNU sparse entries (#2558)
Tim Kientzle [Sun, 30 Mar 2025 16:26:25 +0000 (09:26 -0700)] 
Issue 2548: Reading GNU sparse entries (#2558)

My attempt to fix #2404 just made the confusion between the size of the
extracted file and the size of the contents in the tar archive worse
than it was before.

@ferivoz in #2557 showed that the confusion stemmed from a point where
we were setting the size in the entry (which is by definition the size
of the file on disk) when we read the `GNU.sparse.size` and
`GNU.sparse.realsize` attributes (which might represent the size on disk
or in the archive) and then using that to determine whether to read the
value in ustar header (which represents the size of the data in the
archive).

The confusion stems from three issues:
* The GNU.sparse.* fields mean different things depending on the version
of GNU tar used.
* The regular Pax `size` field overrides the value in the ustar header,
but the GNU sparse size fields don't always do so.
* The previous libarchive code tried to reconcile different size
information as we went along, which is problematic because the order in
which this information appears can vary.

This PR makes one big structural change: We now have separate storage
for every different size field we might encounter. We now just store
these values and record which one we saw. Then at the end, when we have
all the information available at once, we can use this data to determine
the size on disk and the size in the archive.

A few key facts about GNU sparse formats:

* GNU legacy sparse format: Stored all the relevant info in an extension
of the ustar header.
* GNU pax 0.0 format: Used `GNU.sparse.size` to store the size on disk
* GNU pax 0.1 format: Used `GNU.sparse.size` to store the size on disk
* GNU pax 1.0 format: Used `GNU.sparse.realsize` to store the size on
disk; repurposed `GNU.sparse.size` to store the size in the archive, but
omitted this in favor of the ustar size field when that could be used.

And of course, some key precedence information:
* Pax `size` field always overrides the ustar header size field.
* GNU sparse size fields override it ONLY when they represent the size
of the data in the archive.

Resolves #2548

(cherry picked from commit 29fd918e1886abacca88864ad3676fa237ff21e2)

4 months ago[cmake] Require CMake 3.17 or newer (#2556)
Christoph Grüninger [Sat, 29 Mar 2025 01:06:15 +0000 (02:06 +0100)] 
[cmake] Require CMake 3.17 or newer (#2556)

Remove code for older versions of CMake.
CMake 3.14 stopped running on Windows XP and Vista.

Fix detection of wcscmo, wcscpy, wcslen

(cherry picked from commit 3a5a34b8211b68709090fcac71c45d9b5f59f4f2)

4 months ago[cmake] Require minimum CMake version of 3.5 (#2555)
Christoph Grüninger [Wed, 26 Mar 2025 13:18:12 +0000 (14:18 +0100)] 
[cmake] Require minimum CMake version of 3.5 (#2555)

CMake 4.0 will be released soon and it refuses to accept a minimum
required version below 3.5 without additional flags.

(cherry picked from commit 4237b476fd4ef4b2b5ebac55811d92e73aeb5257)

4 months agoFix for the ZIP large file test (#2552)
ARJANEN Loïc Jean David [Tue, 25 Mar 2025 02:20:21 +0000 (03:20 +0100)] 
Fix for the ZIP large file test (#2552)

Making the ZIP large file test use the utility functions too.

(cherry picked from commit 9ad0e27f53b0f29168693b9305ae7dd2021348e2)

4 months agoCMake: Replace CMAKE_COMPILER_IS_GNUCC with CMAKE_C_COMPILER_ID (#2550)
Peter Kokot [Sat, 22 Mar 2025 21:21:38 +0000 (22:21 +0100)] 
CMake: Replace CMAKE_COMPILER_IS_GNUCC with CMAKE_C_COMPILER_ID (#2550)

Hello,

- The `CMAKE_COMPILER_IS_*` variables are deprecated and
`CMAKE_C_COMPILER_ID` can be used in this case instead.
- The legacy `endif()` command argument also simplified to avoid
repeating the condition.

(cherry picked from commit 2c2266432f1b0bf7be918f354140a6ba4a87a04c)

4 months agoRelease 3.7.8 v3.7.8
Martin Matuska [Thu, 20 Mar 2025 09:45:48 +0000 (10:45 +0100)] 
Release 3.7.8

4 months agoCI: Update FreeBSD build environments (#2534)
Martin Matuška [Tue, 11 Mar 2025 13:15:49 +0000 (14:15 +0100)] 
CI: Update FreeBSD build environments (#2534)

FreeBSD 13.4 -> 13.5
FreeBSD 14.1 -> 14.2

(cherry picked from commit 03e15babd6ea5ad6add33b070bb5ef50f79b052c)

4 months agoOnly use S_ISSOCK if available. (#2543)
nia [Tue, 18 Mar 2025 13:17:03 +0000 (14:17 +0100)] 
Only use S_ISSOCK if available. (#2543)

Needed to build on OpenServer 5 Definitive 2018.

(cherry picked from commit f8a34abfbb284f5d5bdd254e4fec52979453b0fa)

4 months agoRemove extra newline from error messages (#2541)
Tobias Stoeckmann [Sun, 16 Mar 2025 22:33:05 +0000 (23:33 +0100)] 
Remove extra newline from error messages (#2541)

The lafe_errc function adds a newline by itself already, so do not
insert one into the message.

You can reproduce with the following commands:

```
touch archive.tar
bsdtar -xf archive.tar -C /non-existing
```

```
bsdtar --exclude ""
```

Signed-off-by: Tobias Stoeckmann <tobias@stoeckmann.org>
(cherry picked from commit a88e09a37069dd6a07d65f6dfee08a8563d79d8c)

4 months agoFILE* seeking support (#2539)
ljdarj [Sat, 15 Mar 2025 18:17:27 +0000 (19:17 +0100)] 
FILE* seeking support (#2539)

Adding a seeker function to archive_read_open_FILE().

Fixes #437.

(cherry picked from commit 09a2ed4853cd177264076a88c98e525e892a0d0b)

4 months agofix CVE-2025-1632 and CVE-2025-25724 (#2532)
Peter Kästle [Mon, 10 Mar 2025 15:43:04 +0000 (16:43 +0100)] 
fix CVE-2025-1632 and CVE-2025-25724 (#2532)

Hi,

please find my approach to fix the CVE-2025-1632 and CVE-2025-25724
vulnerabilities in this pr.
As both error cases did trigger a NULL pointer deref (and triggered
hopefully everywhere a coredump), we can safely replace the actual
information by a predefined invalid string without breaking any
functionality.

---------

Signed-off-by: Peter Kaestle <peter@piie.net>
(cherry picked from commit c9bc934e7e91d302e0feca6e713ccc38d6d01532)

4 months agoAvoid unreachable code in this test (#2528)
Tim Kientzle [Sat, 1 Mar 2025 17:06:31 +0000 (09:06 -0800)] 
Avoid unreachable code in this test (#2528)

As remarked in #2521, this test has unreachable code on Windows, which
triggers a build failure in development due to warnings-as-errors.
(Release versions should not have warnings-as-errors.)

(cherry picked from commit 3512329ba9a06a7360601f195c5013c3161f5e70)

4 months agoHandle ARCHIVE_FILTER_LZOP in archive_read_append_filter (#2519)
François Degros [Mon, 24 Feb 2025 15:01:39 +0000 (02:01 +1100)] 
Handle ARCHIVE_FILTER_LZOP in archive_read_append_filter (#2519)

Fixes #2513

(cherry picked from commit 21f74252f2fee6db896e3db80baa3c36663ede62)

4 months agoCast (mode_t)mode for POSIX functions (#2476)
Graham Percival [Tue, 7 Jan 2025 00:44:40 +0000 (16:44 -0800)] 
Cast (mode_t)mode for POSIX functions (#2476)

(cherry picked from commit 42565b88b5cc7441239269902a9d1735fd9ca0e2)

4 months agoFix another GCC version detection error (#2474)
Mostyn Bramley-Moore [Wed, 1 Jan 2025 23:36:17 +0000 (00:36 +0100)] 
Fix another GCC version detection error (#2474)

This is another instance of the same bug that was fixed in #2472.

(cherry picked from commit 743bbe97693f648e05dc428a770fefed5f1a7d3f)

4 months agoSuppress macOS CC_MD5_* deprecation warnings in the autoconf build too (#2473)
Mostyn Bramley-Moore [Wed, 1 Jan 2025 23:30:37 +0000 (00:30 +0100)] 
Suppress macOS CC_MD5_* deprecation warnings in the autoconf build too (#2473)

This also limits the amount of code where deprecation warnings are
suppressed.

Previously these warnings were only suppressed in the cmake build.

(cherry picked from commit 7708713b634eb2f72ffe484b565a5a87f58e8cb3)

4 months agoFix GCC version detection for __attribute__((deprecated)) (#2472)
Sam James [Wed, 1 Jan 2025 18:56:51 +0000 (18:56 +0000)] 
Fix GCC version detection for __attribute__((deprecated)) (#2472)

The #if condition as-written fails for any major >= 3 if minor < 1, e.g.
GCC 15.0 (while in development).

Use the idiom described in the GCC docs [0] to avoid this.

[0] https://gcc.gnu.org/onlinedocs/cpp/Common-Predefined-Macros.html

Fixes: ab94a813b0f64cbc1bcb952bf55424a2d9c7f1d9
(cherry picked from commit a186d9662b4e3bc2e0f39d3248f9c1244c4346cb)

4 months agoFix a Y2038 bug by replacing `Int32x32To64` with regular multiplication (#2471)
Silent [Wed, 1 Jan 2025 16:31:35 +0000 (17:31 +0100)] 
Fix a Y2038 bug by replacing `Int32x32To64` with regular multiplication (#2471)

`Int32x32To64` macro internally truncates the arguments to int32, while
`time_t` is 64-bit on most/all modern platforms. Therefore, usage of
this macro creates a Year 2038 bug.

I detailed this issue a while ago in a writeup, and spotted the same
issue in this repository when updating the list of affected
repositories:
<https://cookieplmonster.github.io/2022/02/17/year-2038-problem/>

A few more notes:
1. I changed all uses of `Int32x32To64` en masse, even though at least
one of them was technically OK and used with int32 parameters only. IMO
better safe than sorry.
2. This is untested, but it's a small enough change that I hope the CI
success is a good enough indicator.

(cherry picked from commit 14b8803c40d36fe1f0c8b3bb2846d865e3adcfce)

4 months agoFix compiler nitpicks (#2470)
Graham Percival [Tue, 31 Dec 2024 03:42:04 +0000 (19:42 -0800)] 
Fix compiler nitpicks (#2470)

(cherry picked from commit 25c3d9afeada3241cd966f65bb6a28ae9b47a832)

4 months agoFix compiler nitpicks (#2469)
Graham Percival [Mon, 30 Dec 2024 21:31:48 +0000 (13:31 -0800)] 
Fix compiler nitpicks (#2469)

(cherry picked from commit 982747fd66ea69875052ec62598a72d2fa2f9469)

4 months agoDetect endianness at build time for common MSVC targets also (#2466)
Mostyn Bramley-Moore [Mon, 30 Dec 2024 16:31:14 +0000 (17:31 +0100)] 
Detect endianness at build time for common MSVC targets also (#2466)

This should now cover the most common build targets.

(cherry picked from commit 1427f3431d3479dd0bc72cdbbd082fc9391c3cf3)

4 months agoFix compiler nitpicks (#2465)
Graham Percival [Mon, 30 Dec 2024 16:30:42 +0000 (08:30 -0800)] 
Fix compiler nitpicks (#2465)

(cherry picked from commit edcae6c164717df48c59e6c2dc3e2510fa34ad87)

4 months agoPrefer build-time endianness detection (#2464)
Mostyn Bramley-Moore [Mon, 30 Dec 2024 02:10:23 +0000 (03:10 +0100)] 
Prefer build-time endianness detection (#2464)

Endianness is easy to determine at runtime, but detecting this a single
time and then reusing the cached result might require API changes.

However we can use compile-time detection for some known compiler macros
without API changes fairly easily. Let's start by enabling this for
Clang and GCC.

(cherry picked from commit 561b6430fd558af6e15b3cbe4258e0b30945b411)

4 months agoAdd more casts for %c, %o, and %x (#2463)
Graham Percival [Sun, 29 Dec 2024 18:20:24 +0000 (10:20 -0800)] 
Add more casts for %c, %o, and %x (#2463)

(cherry picked from commit 4ce9c2f4bedfef8e4c5962c4d0f59bc400e2a976)

4 months agoSpelling fixes for func, struct, and macros (#2462)
Graham Percival [Sun, 29 Dec 2024 18:19:21 +0000 (10:19 -0800)] 
Spelling fixes for func, struct, and macros (#2462)

(cherry picked from commit dc5e1405b630258c41e0059fd121fca222d8eabd)

4 months agoAdd more casts for %o (#2461)
Graham Percival [Sun, 29 Dec 2024 18:18:06 +0000 (10:18 -0800)] 
Add more casts for %o (#2461)

(cherry picked from commit a2086b67d88d8d3d2d99d80ada3fcd19eaf76ed4)

4 months agoAdd straightforward casts for %o and %x (#2458)
Graham Percival [Sun, 29 Dec 2024 00:29:47 +0000 (16:29 -0800)] 
Add straightforward casts for %o and %x (#2458)

(cherry picked from commit 14221c7ba20d50598b56f455a6d613ed186e3510)

4 months ago7zip reader: add support for POWERPC filter for non-LZMA compressors (#2459)
Mostyn Bramley-Moore [Sat, 28 Dec 2024 23:36:01 +0000 (00:36 +0100)] 
7zip reader: add support for POWERPC filter for non-LZMA compressors (#2459)

This new test archive contains a C hello world executable built like so
on a ubuntu 24.04 machine:
```
#include <stdio.h>

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=deflate -mf=ppc
libarchive/test/test_read_format_7zip_deflate_powerpc.7z hw-powerpc`

This test fails in the first commit in this PR, and passes in the second
commit.

(cherry picked from commit 28cb5064d8dcd256237a736d7d6cbf7873de6671)

4 months agoFix format strings (#2457)
Graham Percival [Sat, 28 Dec 2024 19:03:17 +0000 (11:03 -0800)] 
Fix format strings (#2457)

(cherry picked from commit a659a44a8511c9a08b28e8d7953382dde0c2c657)

4 months agoAdd tar/test/test_list_item (#2454)
Graham Percival [Sat, 28 Dec 2024 19:01:19 +0000 (11:01 -0800)] 
Add tar/test/test_list_item (#2454)

(cherry picked from commit b557c1f16165a1d28d45ea0bb045b61017aea5a2)

4 months agoFix the test for NOABSOLUTEPATHS (#2456)
Tim Kientzle [Fri, 27 Dec 2024 23:51:33 +0000 (15:51 -0800)] 
Fix the test for NOABSOLUTEPATHS (#2456)

The test inadvertently tried to manipulate the wrong archive at one
point.

(cherry picked from commit 12517fa78dc9c232f95b4fa01af7f19e8ee71ad3)

4 months agotar: fix bug when -s/a/b/ used more than once with b flag (#2435)
Stephane Chazelas [Fri, 27 Dec 2024 23:20:16 +0000 (23:20 +0000)] 
tar: fix bug when -s/a/b/ used more than once with b flag (#2435)

When the -s/regexp/replacement/ option was used with the b flag more
than once, the result of the previous substitution was appended to the
previous subject instead of replacing it. Fixed it by making sure the
subject is made the empty string before the call to realloc_strcat().
That in effect makes it more like a realloc_strcpy(), but creating a new
realloc_strcpy() function for that one usage doesn't feel worth it.

Resolves Issue libarchive/libarchive#2414

Co-authored-by: Stephane Chazelas <stephane@chazelas.org>
(cherry picked from commit 4d5106f2b5e48a34ec0e341974737252ed5aae84)

4 months agoFix remaining TODOs in test_stdio.c (#2444)
Graham Percival [Fri, 27 Dec 2024 20:38:03 +0000 (12:38 -0800)] 
Fix remaining TODOs in test_stdio.c (#2444)

(cherry picked from commit 0acaa2994a6c230fc9d83684c151417c9c1e19d1)

4 months agoRemove unnecessary semicolons (#2450)
Graham Percival [Wed, 25 Dec 2024 17:35:54 +0000 (09:35 -0800)] 
Remove unnecessary semicolons (#2450)

(cherry picked from commit 35da265cc3fc21150e14b3d01bafc57bc82eacdc)

4 months agoRemove unreachable 'break' statements (#2451)
Graham Percival [Wed, 25 Dec 2024 17:33:11 +0000 (09:33 -0800)] 
Remove unreachable 'break' statements (#2451)

(cherry picked from commit 0d1ac07d3fbe39f26e6cf0ad2b38c1be3b421e64)

4 months agoFix CRLF line endings in source files (#2449)
Graham Percival [Tue, 24 Dec 2024 23:25:53 +0000 (15:25 -0800)] 
Fix CRLF line endings in source files (#2449)

(cherry picked from commit e99c6d69f165a2920123c56a04d58d9420347ef9)

4 months agoReject relative path for test refdir (#2445)
Graham Percival [Tue, 24 Dec 2024 19:51:50 +0000 (11:51 -0800)] 
Reject relative path for test refdir (#2445)

(cherry picked from commit af4a3562cd436d8b469404759f780c1ca7fe8f12)

4 months agoFix a few clang nitpicks (#2447)
Graham Percival [Tue, 24 Dec 2024 19:50:19 +0000 (11:50 -0800)] 
Fix a few clang nitpicks (#2447)

Fixes warnings found by:
```
-Wformat-non-iso
-Wnewline-eof
-Wmissing-variable-declarations
```

(cherry picked from commit 1f6cdd46255fe2397c05f6701c06c9c600d64e87)

4 months agoFix some TODOs in tar/test/test_stdio.c (#2442)
Graham Percival [Thu, 19 Dec 2024 22:24:57 +0000 (14:24 -0800)] 
Fix some TODOs in tar/test/test_stdio.c (#2442)

(cherry picked from commit 72bbf9ec25eb7097b624f16397c138442e2f8827)

4 months agoRemove liblzmadec remnants (#2436)
Mostyn Bramley-Moore [Sun, 15 Dec 2024 22:14:57 +0000 (23:14 +0100)] 
Remove liblzmadec remnants (#2436)

It looks like support for this library was removed in 2016, but we still
had some unused cmake code and a dead preprocessor block.

(cherry picked from commit 819a50a0436531276e388fc97eb0b1b61d2134a3)

4 months agoRemove unnecessary HAVE_LZMA_FILTER_ARM64 feature check (#2433)
Mostyn Bramley-Moore [Wed, 11 Dec 2024 04:35:16 +0000 (05:35 +0100)] 
Remove unnecessary HAVE_LZMA_FILTER_ARM64 feature check (#2433)

It is sufficent to use HAVE_LZMA_H and then check for macros defined in
lzma.h

(cherry picked from commit 6516cd137eb5381b2f91773456c7069ba576034a)

4 months agoHandle truncation in the middle of a GNU long linkname (#2422)
Tim Kientzle [Tue, 10 Dec 2024 05:09:29 +0000 (21:09 -0800)] 
Handle truncation in the middle of a GNU long linkname (#2422)

Thanks to gbdngb12 김동건 for reporting this.

Resolves Issue #2415

(cherry picked from commit 82912103214506316bd9990d73f33d743d55f570)

4 months agoci: make skipped tests more obvious (#2430)
Mostyn Bramley-Moore [Mon, 9 Dec 2024 02:08:34 +0000 (03:08 +0100)] 
ci: make skipped tests more obvious (#2430)

Previously skipped tests were reported like this when running the *_test
binaries:
```
 4: test_acl_platform_nfs4                                          ok (S)
```

Let's make this more obvious:
```
  4: test_acl_platform_nfs4                                         skipped
```

(cherry picked from commit 7efa99bdb100cc5f32bb16324ef75920e49deaf4)

4 months agoReport skipped tests to cmake/ctest (#2429)
Mostyn Bramley-Moore [Mon, 9 Dec 2024 02:07:49 +0000 (03:07 +0100)] 
Report skipped tests to cmake/ctest (#2429)

This plumbing is required for cmake/ctest to recognise and report
skipped tests.

Now skipped tests in cmake ci jobs are reported like so:
```
          Start   7: libarchive_test_acl_platform_posix1e_read
    7/785 Test   #7: libarchive_test_acl_platform_posix1e_read ................................***Skipped   0.02 sec
```

And there is a list of skipped tests shown at the end of the test run.

(cherry picked from commit 8ac45a813e78fe6f2f8c40f0219f106a7ff9a28f)

4 months agoci: speed up windows/mingw build by using multiple make jobs (#2428)
Mostyn Bramley-Moore [Sun, 8 Dec 2024 00:39:46 +0000 (01:39 +0100)] 
ci: speed up windows/mingw build by using multiple make jobs (#2428)

This decreases the "Install library dependencies" step duration from
~4min to ~2min, and the "Build" step duration from ~10min to ~4min.

(cherry picked from commit ba76798136062868d2cbe80648ebc6fe2ebfbaed)

4 months agoci: make autoconf look for headers and libraries in /opt/homebrew if those directorie...
Mostyn Bramley-Moore [Sat, 7 Dec 2024 23:11:19 +0000 (00:11 +0100)] 
ci: make autoconf look for headers and libraries in /opt/homebrew if those directories exist (#2427)

Prior to this change, the ci autoconf jobs weren't looking for homebrew
headers or libraries unless pkg-config was used, so for example the
"MacOS (autotools)" ci job wasn't testing lz4 or zstd code.

Relates to #2426.

(cherry picked from commit 29802f6a5e8543e61bac7d9dede42abf21ded5aa)

4 months agoci: log bsdtar's version text, so we can see which support libraries were used (...
Mostyn Bramley-Moore [Sat, 7 Dec 2024 23:10:42 +0000 (00:10 +0100)] 
ci: log bsdtar's version text, so we can see which support libraries were used (#2426)

A few of libarchive's CI jobs don't find all the local support libraries
that they could be using. This change makes it easier to see which of
them are used.

(cherry picked from commit 0bbbe2883ef45b2027ea7395a691a855b1296cd1)

4 months agoci: find liblzma >= 5.6.3 on windows msvc tests (#2421)
Mostyn Bramley-Moore [Sat, 7 Dec 2024 03:56:06 +0000 (04:56 +0100)] 
ci: find liblzma >= 5.6.3 on windows msvc tests (#2421)

We currently use XZ Utils 5.6.3 on windows CI jobs, but the Windows
(msvc)
job which uses cmake seems to only be looking for the old library name,
liblzma.lib:

```
-- Looking for lzma_auto_decoder in C:/Program Files (x86)/xz/lib/liblzma.lib
-- Looking for lzma_auto_decoder in C:/Program Files (x86)/xz/lib/liblzma.lib - not found
-- Looking for lzma_easy_encoder in C:/Program Files (x86)/xz/lib/liblzma.lib
-- Looking for lzma_easy_encoder in C:/Program Files (x86)/xz/lib/liblzma.lib - not found
-- Looking for lzma_lzma_preset in C:/Program Files (x86)/xz/lib/liblzma.lib
-- Looking for lzma_lzma_preset in C:/Program Files (x86)/xz/lib/liblzma.lib - not found
-- Could NOT find LibLZMA (missing: LIBLZMA_HAS_AUTO_DECODER LIBLZMA_HAS_EASY_ENCODER LIBLZMA_HAS_LZMA_PRESET) (found version "5.6.3")
```

We need to update build/ci/github_actions/ci.cmd to look for lzma.lib
instead.

(cherry picked from commit 9b7540aaf1eddf558aa3f221b0c6c4ad5520dc9b)

4 months agoCheck for tcgetattr / tcsetattr before using it for readpassphrase implementation...
Julian Uy [Fri, 6 Dec 2024 15:58:58 +0000 (09:58 -0600)] 
Check for tcgetattr / tcsetattr before using it for readpassphrase implementation (#2424)

This is mainly for non-cygwin newlib platforms that don't have tcgetattr
/ tcsetattr implemented

(cherry picked from commit 819c5b01a90e738ced6af237a6ae0d1aff981127)

4 months agoAdd missing definition for getline polyfill (#2425)
Julian Uy [Fri, 6 Dec 2024 15:57:27 +0000 (09:57 -0600)] 
Add missing definition for getline polyfill (#2425)

The fallback for when `getline` is not implemented in libc was not
compiling due to the fact that the definition for it was missing, so add
the definition.

(cherry picked from commit b5d95321d4b07dc381210fb26ac9d7533b8fc97b)

4 months agobsdtar.1: Mention rar support + manual page polish (#2423)
Alexander Ziaee [Fri, 6 Dec 2024 15:50:06 +0000 (10:50 -0500)] 
bsdtar.1: Mention rar support + manual page polish (#2423)

I have been using this for years without realizing it decompresses rar.

+ add rar to supported decompression formats
+ use section references to link sections (this makes them clickable in
GUIs)
+ add paragraph breaks for consistent spacing
+ pdtar is not this program, so use Sy per mdoc style guide
+ do almost the same in reverse for bsdtar
+ remove parenthetical around a complete sentance

Thank you so much, this is wonderful software.

(cherry picked from commit 68238f28ee9e051be0c78f91f99b1ad2a4c74a03)

4 months agoTest with XZ Utils 5.6.3 on windows CI jobs (#2417)
Mostyn Bramley-Moore [Sun, 1 Dec 2024 23:29:46 +0000 (00:29 +0100)] 
Test with XZ Utils 5.6.3 on windows CI jobs (#2417)

This change fixes the autotools build to work with xz-utils 5.6.3, which
changed library names on windows, and fixes a couple of tests that I
noticed had dependencies on liblzma.

(cherry picked from commit 84ad8745308463d0e2e7e067b1eda99db5a661b1)

4 months agonit(tar): fix typo (#2420)
MithicSpirit [Sun, 1 Dec 2024 03:21:45 +0000 (22:21 -0500)] 
nit(tar): fix typo (#2420)

(cherry picked from commit cbfe4d9e6dac1c156fab760ccf92c902200c896e)

8 months agoIgnore ustar size when pax size is present (#2405)
Tim Kientzle [Wed, 6 Nov 2024 21:21:54 +0000 (13:21 -0800)] 
Ignore ustar size when pax size is present (#2405)

When the pax `size` field is present, we should ignore the size value in
the ustar header. In particular, this fixes reading pax archives created
by GNU tar with entries larger than 8GB.

Note: This doesn't impact reading pax archives created by libarchive
because libarchive uses tar extensions to store an accurate large size
field in the ustar header. GNU tar instead strictly follows ustar in
this case, which prevents it from storing accurate sizes in the ustar
header.

Resolves #2404

(cherry picked from commit d60f3ea1b3bfd9f1dcd4040de9fca53fbedd829a)

8 months ago7zip reader: add SPARC filter support for non-LZMA compressors (#2399)
Mostyn Bramley-Moore [Tue, 29 Oct 2024 02:29:23 +0000 (03:29 +0100)] 
7zip reader: add SPARC filter support for non-LZMA compressors (#2399)

(cherry picked from commit 974b59113d595c1b7babcfbc1f16341e49400aad)

8 months agoRename bsdtar test_extract_tar_absolute_paths source file for consistency
Mostyn Bramley-Moore [Sun, 27 Oct 2024 15:43:59 +0000 (16:43 +0100)] 
Rename bsdtar test_extract_tar_absolute_paths source file for consistency

The `-P` flag is uppercase, so the test file should be named
test_option_P_upper.c for consistency with the other test files in this
directory.

Sorry about the noise.

Closes #2400
(cherry picked from commit 87fa7336799e44e1c4b4638056bf780173e3eca4)

8 months agotests: redirect stdout in one call in test_extract_tar_absolute_paths
Martin Matuška [Fri, 25 Oct 2024 17:45:28 +0000 (19:45 +0200)] 
tests: redirect stdout in one call in test_extract_tar_absolute_paths

This redirects the message "Removing leading '/' from member names"
from stderr to a file in one case.

Closes #2386
(cherry picked from commit 2cea675da23c1fc13eefcd778995d9448a1a7207)

8 months agoReintroduce size_t cast to clarify the use of a u32 shift on a u64 arg
Dustin L. Howett [Tue, 22 Oct 2024 08:52:19 +0000 (03:52 -0500)] 
Reintroduce size_t cast to clarify the use of a u32 shift on a u64 arg

Closes #2383
Regressed in #2285

(cherry picked from commit ac43e8e3fea3ed80cb7c35659decf8ca5a315ba9)

8 months agoVarious small fixes for Cygwin, Haiku, OpenIndiana (#2346)
vcoxvco [Mon, 14 Oct 2024 15:44:17 +0000 (17:44 +0200)] 
Various small fixes for Cygwin, Haiku, OpenIndiana (#2346)

Cygwin 3.5.4 (same applies for 3.5.3),
I get a compile error as shown below after a simple ./configure and
make. Adding <windef.h> solves the problem.

Co-authored-by: vco <god@universe.sys>
(cherry picked from commit 40ff837717b89e9a5d2c735758f503d124d17b72)

8 months agotests: use const char instead of char in one case (#2381)
Martin Matuška [Sun, 13 Oct 2024 20:41:06 +0000 (22:41 +0200)] 
tests: use const char instead of char in one case (#2381)

Found in test_extract_cpio_absolute_paths.c when compiling FreeBSD base

(cherry picked from commit d8c3b97b3196a5617bdc682acf8728c89f08f57e)

9 months agoRelease 3.7.7 v3.7.7
Martin Matuska [Sun, 13 Oct 2024 08:09:33 +0000 (10:09 +0200)] 
Release 3.7.7

9 months agoIgnore checksum mismatches when fuzzing tar archives (#2378)
Tim Kientzle [Sun, 13 Oct 2024 07:42:38 +0000 (00:42 -0700)] 
Ignore checksum mismatches when fuzzing tar archives (#2378)

This should speed up fuzzing just a bit, so we
can find more bugs!

(cherry picked from commit 971c043a1df850c9ccfc155c80c64b0673d7daa4)

9 months agoCI: Bump the all-actions group across 1 directory with 4 updates (#2379)
dependabot[bot] [Sun, 13 Oct 2024 07:42:01 +0000 (09:42 +0200)] 
CI: Bump the all-actions group across 1 directory with 4 updates (#2379)

Bumps the all-actions group with 4 updates:

actions/checkout from 4.1.6 to 4.2.1
actions/upload-artifact from 4.3.3 to 4.4.3
github/codeql-action from 3.25.6 to 3.26.12
ossf/scorecard-action from 2.3.3 to 2.4.0

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
(cherry picked from commit 295f47a074444df5f4fb1ac44fa55c7be17aa3cf)

9 months agoIncrease the hole size for this test to 32MiB (#2380)
Tim Kientzle [Sun, 13 Oct 2024 07:35:17 +0000 (00:35 -0700)] 
Increase the hole size for this test to 32MiB (#2380)

APFS on macOS 15 seems to have a higher threshold for creating sparse
files.

(cherry picked from commit aada018f05c1696efb5c306b5acbc3c9dd811632)

9 months agoConvert the tools and respective tests to SPDX (#2317)
Emil Velikov [Sun, 13 Oct 2024 03:54:16 +0000 (04:54 +0100)] 
Convert the tools and respective tests to SPDX (#2317)

This is the first part of converting the project to use SPDX license
identifiers instead using the verbose license text.

The patches are semi-automated and I've went through manually to ensure
no license changes were made. That said, I would welcome another pair of
eyes, since I am only human.

See https://github.com/libarchive/libarchive/issues/2298

---------

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
(cherry picked from commit 6287b99eb78ad4ffada536f75c55902208234425)

9 months agoUpdate archive_private to avoid template keyword (#2342)
Christian Schmitz [Sun, 13 Oct 2024 00:47:30 +0000 (02:47 +0200)] 
Update archive_private to avoid template keyword (#2342)

People really should never, ever, ever use libarchive internal headers.  And they definitely should not expect libarchive internal headers to work in a C++ compiler.  (C++ and C are really just not that compatible.)

However, people do a lot of things they shouldn't:  Avoid the reserved C++ keyword `template`

(cherry picked from commit b8d7e074c16c7d0cac98e9236b299c0941edfd78)

9 months agoconfigure.ac,CMakeLists.txt: Add libbsd on Haiku for readpassphrase (#2352)
vcoxvco [Sun, 13 Oct 2024 00:44:32 +0000 (02:44 +0200)] 
configure.ac,CMakeLists.txt: Add libbsd on Haiku for readpassphrase (#2352)

Followup from #2346

Add libbsd to make/cmake configuration for linking readpassphrase on
Haiku.
Maybe there is a better way to do this for cmake, I'm not that familiar
with it.

Co-authored-by: vco <god@universe.sys>
(cherry picked from commit e2c512a59fea1087b89e4252add056359a83bedf)

9 months agoCI: Update build environments (#2373)
Martin Matuška [Sat, 12 Oct 2024 16:31:20 +0000 (18:31 +0200)] 
CI: Update build environments (#2373)

FreeBSD 13.3 -> 13.4
FreeBSD 14.0 -> 14.1
Ubuntu 22.04 -> 24.04

(cherry picked from commit c0ce80b970de61a59e2f0753c09ecf283d7ee339)

9 months agoFix two leaks in tar header parsing (#2377)
Tim Kientzle [Sat, 12 Oct 2024 11:54:23 +0000 (04:54 -0700)] 
Fix two leaks in tar header parsing (#2377)

OSS-Fuzz found two places where an error return would bypass cleaning up
a local allocation.

Credit: OSS-Fuzz
(cherry picked from commit 3343bb8a28c8e17e3160e8c097c4a0b72bd7564c)

9 months agotests: change file format from dos to unix in one test file (#2376)
Martin Matuška [Sat, 12 Oct 2024 03:54:59 +0000 (05:54 +0200)] 
tests: change file format from dos to unix in one test file (#2376)

(cherry picked from commit 10c817cdc3d0b28d14ac3415f8458c651ff4b5da)

9 months ago[7zip] Read/write symlink paths as UTF-8 (#2252)
Duncan Horn [Fri, 11 Oct 2024 06:30:25 +0000 (23:30 -0700)] 
[7zip] Read/write symlink paths as UTF-8 (#2252)

I previously tried to find documentation on how symlinks are expected to
be stored in 7zip files, however the best reference I could find was
[here](https://py7zr.readthedocs.io/en/latest/archive_format.html). That
site suggests that symlink paths are stored as UTF-8 encoded strings:

(cherry picked from commit 2121da4bbbdb976af69f6d913e4a2cd19267ff06)

9 months agoUpdate RAR5 code to report encryption (#2096)
Duncan Horn [Fri, 11 Oct 2024 06:25:47 +0000 (23:25 -0700)] 
Update RAR5 code to report encryption (#2096)

Currently, the RAR5 code always reports
`ARCHIVE_READ_FORMAT_ENCRYPTION_UNSUPPORTED` for
`archive_read_has_encrypted_entries`, nor does it set any of the
entry-specific properties, even though it has enough information to
properly report this information. Accurate reporting of encryption is
super useful for applications because reporting an error message such as
"the archive is encrypted, but we don't currently support encryption" is
a lot better than a not generally useful `errno` value and a
non-localizable error string with a confusing and unpredictable error
message.

Fixes #1661

(cherry picked from commit 6177e4d0c0886010538bf91eea9bff2d0677baa7)

9 months agoChange to Windows absolute symlinks. (#2362)
ljdarj [Fri, 11 Oct 2024 06:18:55 +0000 (08:18 +0200)] 
Change to Windows absolute symlinks. (#2362)

Change to read absolute symlinks as verbatim paths instead of NT paths:
as far as I can see, libarchive can deal with verbatim paths while it
can't with NT ones.

Fixes #2274.

(cherry picked from commit e4068fb87cb9cc2f557f65081f505a805fdcdcda)

9 months agoconfigure.ac: remove incorrect 4th argument to `AC_CHECK_FUNCS` (#2334)
Michał Górny [Fri, 11 Oct 2024 06:17:01 +0000 (08:17 +0200)] 
configure.ac: remove incorrect 4th argument to `AC_CHECK_FUNCS` (#2334)

Remove the incorrect 4th argument from `AC_CHECK_FUNCS` calls. The macro
uses only three arguments, so it was ignored anyway. Furthermore, in at
least once instance it was wrong -- due to a typo in `attr/xatr.h`
header name.

(cherry picked from commit 94da78b0847a6c49b4980a83e53f2b731db2039e)

9 months agoDon't crash on truncated tar archives (#2364)
Tim Kientzle [Fri, 11 Oct 2024 06:16:12 +0000 (23:16 -0700)] 
Don't crash on truncated tar archives (#2364)

The tar header parsing overhaul in #2127 introduced a systematic
mishandling of truncated files: the code incorrectly checks for whether
a given read operation failed, and ends up dereferencing a NULL pointer
in this case. I've gone back and double-checked how
`__archive_read_ahead` actually works (it returns NULL precisely when it
was unable to satisfy the read request) and reworked the error handling
for each call to this function in archive_read_support_format_tar.c

Resolves #2353
Resolves https://issues.oss-fuzz.com/issues/42537231

(cherry picked from commit 565b5aea491671ae33df1ca63697c10d54c00165)

9 months agoSanity-check gzip header field length (#2366)
Tim Kientzle [Fri, 11 Oct 2024 06:14:58 +0000 (23:14 -0700)] 
Sanity-check gzip header field length (#2366)

OSS-Fuzz managed to construct a small gzip input that decompresses into
another gzip input with an extremely large filename field. This causes
libarchive to hang processing the inner gzip.

Address this by rejecting any gzip input where the filename or comment
fields exceed 1MiB.

Credit: OSS-Fuzz
(cherry picked from commit b34c1f4def427e21b821dd0837208ede51532281)

9 months agoClarify crc32 variable names (#2367)
Tim Kientzle [Fri, 11 Oct 2024 06:13:00 +0000 (23:13 -0700)] 
Clarify crc32 variable names (#2367)

No functional change, just a tiny style improvement.

Use `crc32_computed` to refer to the crc32 that the reader has computed
and `crc32_read` to refer to the value that we read from the archive.
That hopefully makes this code a tiny bit easier to follow. (It confused
me recently when I was double-checking something in this area, so I
thought an improvement here might help others.)

(cherry picked from commit 35e630174e18442f3b1ec432cef78a5b9b6818aa)

9 months agoFix error message printing (#2368)
Tim Kientzle [Fri, 11 Oct 2024 06:11:43 +0000 (23:11 -0700)] 
Fix error message printing (#2368)

We always print the error message with or without -v, but for some
reason, we were omitting the path being processed. Simplify so that we
always print the full error including context.

(cherry picked from commit 41a2d01453e0245f8b391b082ab412e3fb0299c6)

9 months agoDon't use Windows bcrypt when building for Windows XP or older (#2374)
Steve Lhomme [Wed, 9 Oct 2024 04:06:57 +0000 (21:06 -0700)] 
Don't use Windows bcrypt when building for Windows XP or older (#2374)

The header may be detected but we can't use the calls.

The same check is already done in many places but not all of them.

(cherry picked from commit 08ab094ea79ec59abfc458df54f62866e8221491)

9 months agobsdcpio should exit with an error code if an entry can't be extracted (#2371)
Mostyn Bramley-Moore [Mon, 7 Oct 2024 15:51:17 +0000 (17:51 +0200)] 
bsdcpio should exit with an error code if an entry can't be extracted (#2371)

For example if --insecure is not specified, and one of the security
checks fails.

(cherry picked from commit a65f765f177d9db6c79eaa2b305fd9d2792740e8)

9 months agoAdd absolute path test for bsdtar (#2370)
Mostyn Bramley-Moore [Mon, 7 Oct 2024 03:35:28 +0000 (05:35 +0200)] 
Add absolute path test for bsdtar (#2370)

Check that extracting archive entries with absolute paths uses mangled
relative paths unless -P / --absolute-paths is specified.

(cherry picked from commit d6dd082adfb93716c31e5093b189fdedb64e5efe)

9 months agoSimplify tests added in #2363, use testworkdir (#2369)
Mostyn Bramley-Moore [Mon, 7 Oct 2024 03:34:58 +0000 (05:34 +0200)] 
Simplify tests added in #2363, use testworkdir (#2369)

(cherry picked from commit 62ce582d1c22c8affa9453bbd549776b60c669fa)

9 months agoFix pathname overwrite in header_old_tar() (#2360)
Martin Matuška [Mon, 7 Oct 2024 03:31:38 +0000 (05:31 +0200)] 
Fix pathname overwrite in header_old_tar() (#2360)

Fixes #2359

(cherry picked from commit 9d5289ae9ee38a70bf3c94b57aacd72e4165f75b)

9 months agoMiscellaneous code cleanup (#2285)
Dag-Erling Smørgrav [Fri, 4 Oct 2024 15:45:58 +0000 (17:45 +0200)] 
Miscellaneous code cleanup (#2285)

This fixes various code quality issues I encountered while chasing a
memory leak reported by test automation. I failed to reproduce the
memory leak, but I hope you find this useful nonetheless.

(cherry picked from commit a90e9d84ec147be2ef6a720955f3b315cb54bca3)

9 months agoFix ARCHIVE_EXTRACT_SECURE_NOABSOLUTEPATHS on windows (#2363)
Mostyn Bramley-Moore [Fri, 4 Oct 2024 15:36:56 +0000 (17:36 +0200)] 
Fix ARCHIVE_EXTRACT_SECURE_NOABSOLUTEPATHS on windows (#2363)

(cherry picked from commit 2fd35b0fdb517ef4c78f779be4bba019f5b27a86)

9 months agoReenable CI tests for MSVC (#2356)
Mostyn Bramley-Moore [Mon, 30 Sep 2024 04:36:48 +0000 (06:36 +0200)] 
Reenable CI tests for MSVC (#2356)

These were disabled when migrating from Cirrus CI. Let's enable them for
github workflows, disable any failing tests on this configuration and
leave TODO notes to fix them.

This was the only failure that I found:
```
  684/764 Test #684: bsdtar_test_option_ignore_zeros_mode_c ...................................***Failed    0.10 sec

  If tests fail or crash, details will be in:
     C:\Users\RUNNER~1\AppData\Local\Temp/bsdtar_test.exe.2024-09-29T11.42.13-000

  Reference files will be read from: D:/a/libarchive/libarchive/tar/test
  Running tests on: "D:\a\libarchive\libarchive\build_ci\cmake\bin\Release\bsdtar.exe"
  Exercising: bsdtar 3.8.0 - libarchive 3.8.0dev zlib/1.3 liblzma/5.4.4 bz2lib/1.1.0 libzstd/1.5.5

   39: test_option_ignore_zeros_mode_c
  D:\a\libarchive\libarchive\tar\test\test_option_ignore_zeros.c(99): File should be empty: test-c.err
      File size: 112
      Contents:
  0000 62 73 64 74 61 72 2e 65 78 65 3a 20 61 3a 20 43 bsdtar.exe: a: C
  0010 61 6e 27 74 20 74 72 61 6e 73 6c 61 74 65 20 75 an't translate u
  0020 6e 61 6d 65 20 27 28 6e 75 6c 6c 29 27 20 74 6f name '(null)' to
  0030 20 55 54 46 2d 38 0d 0a 62 73 64 74 61 72 2e 65  UTF-8..bsdtar.e
  0040 78 65 3a 20 62 3a 20 43 61 6e 27 74 20 74 72 61 xe: b: Can't tra
  0050 6e 73 6c 61 74 65 20 75 6e 61 6d 65 20 27 28 6e nslate uname '(n
  0060 75 6c 6c 29 27 20 74 6f 20 55 54 46 2d 38 0d 0a ull)' to UTF-8..

  Totals:
    Tests run:                1
    Tests failed:             1
    Assertions checked:      21
    Assertions failed:        1
    Skips reported:           0
```

(cherry picked from commit 6567375f27cc18797062c836f4b0953dfc4b25f3)

9 months agoRemove two unnecessary strings from the tar state (#2345)
Tim Kientzle [Wed, 25 Sep 2024 02:12:11 +0000 (19:12 -0700)] 
Remove two unnecessary strings from the tar state (#2345)

`pax_global` is not used at all and can be removed.

`longname` is only used locally within one function, so convert it to a
local variable there.

(cherry picked from commit 4b6dd229c6a931c641bc40ee6d59e99af15a9432)

10 months agoRelease 3.7.6 v3.7.6
Martin Matuska [Mon, 23 Sep 2024 07:04:27 +0000 (09:04 +0200)] 
Release 3.7.6

10 months agotar/write.h: Support `sys/xattr.h` (#2335)
Michał Górny [Sat, 21 Sep 2024 02:44:06 +0000 (04:44 +0200)] 
tar/write.h: Support `sys/xattr.h` (#2335)

Synchronize the last use of `attr/xattr.h` to support using
`sys/xattr.h` instead. The former header is deprecated on GNU/Linux, and
this replacement makes it possible to build libarchive without the
`attr` package.

(cherry picked from commit fa7e9cd7cbcd41386c30cc75a706805dd4e42716)

10 months agoClean up linkpath between entries (#2343)
Tim Kientzle [Sun, 22 Sep 2024 23:06:34 +0000 (16:06 -0700)] 
Clean up linkpath between entries (#2343)

PR #2127 failed to clean up the linkpath storage between entries. As a
result, after the first hard/symlink entry in a pax format archive, all
subsequent entries would get the same link information.

I'm really unsure how this bug failed to trip CI. I'll do some digging
in the test suite before I merge this.

Resolves #2331 , #2337

P.S. Thanks to Brad King for noting that the linkpath wasn't being
managed correctly, which was a big hint for me.

(cherry picked from commit 75cdc5947073f346d6926939d94347c8592a913b)

10 months agotar: fix memory leaks when processing symlinks or parsing pax headers (#2341)
Martin Matuška [Sun, 22 Sep 2024 23:04:09 +0000 (01:04 +0200)] 
tar: fix memory leaks when processing symlinks or parsing pax headers (#2341)

Fix memory leaks introduced by #2127:

* `struct tar` member `entry_linkpath` was moved at the same time as
other members were removed, but its cleanup was accidentally removed
with the others.

* `header_pax_extension` local variable `attr_name` was not cleaned up.

Resolves #2336

(cherry picked from commit 7c3980367e79c3f89e9ba595bbe67b3983b26215)

Co-authored-by: Brad King <brad.king@kitware.com>
10 months agoBe more cautious about parsing ISO-9660 timestamps (#2340)
Martin Matuška [Sun, 22 Sep 2024 23:03:39 +0000 (01:03 +0200)] 
Be more cautious about parsing ISO-9660 timestamps (#2340)

Some ISO images don't have valid timestamps for the root directory
entry. Parsing such timestamps can generate nonsensical results, which
in one case showed up as an unexpected overflow on a 32-bit system.

Add some validation logic that can check whether a 7-byte or 17-byte
timestamp is reasonable-looking, and use this to ignore invalid
timestamps in various locations. This also requires us to be a little
more careful about tracking which timestamps are actually known.

Resolves issue #2329

(cherry picked from commit e939c97a579131aa021166ef5876b303bccd8472)

Co-authored-by: Tim Kientzle <kientzle@acm.org>
10 months agoRelease 3.7.5 release v3.7.5
Martin Matuska [Fri, 13 Sep 2024 20:20:55 +0000 (22:20 +0200)] 
Release 3.7.5

10 months agocmake: do not require zlib (#2327)
Mostyn Bramley-Moore [Fri, 13 Sep 2024 19:28:05 +0000 (21:28 +0200)] 
cmake: do not require zlib (#2327)

Followup to #2318 which accidentally made zlib required.

Tested locally by increasing the version in CMakeLists.txt to 1.4.1
(which does not exist yet), and confirming that the build reports that a
suitable version of zlib was not found, while the build continued..

10 months agoFix SOVERSION computation logic in CMake to match libtool's (#1976)
jaimergp [Fri, 13 Sep 2024 19:24:48 +0000 (21:24 +0200)] 
Fix SOVERSION computation logic in CMake to match libtool's (#1976)

Fix SOVERSION computation logic in CMake to match libtool's

Closes #1857

Co-authored-by: isuruf <isuruf@users.noreply.github.com>
Co-authored-by: Timothy Lyanguzov <theta682@gmail.com>
10 months agoarchive_write: validate header before arguments (#2315)
Emil Velikov [Fri, 13 Sep 2024 02:15:34 +0000 (03:15 +0100)] 
archive_write: validate header before arguments (#2315)

Fixes: 575e2eab ("Fix handling a negative bytes_per_block values
(#2206)")

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
10 months agoFix Windows path when writing zip entries (#2309)
yyyy [Thu, 12 Sep 2024 22:05:01 +0000 (06:05 +0800)] 
Fix Windows path when writing zip entries (#2309)

Before writing a zip entry, its' pathname might be modified for two
reasons:

1. Path using Windows path separators will be converted to POSIX style.
2. Path using local encoding will be transcoded if a target charset is
set.

Must make sure these two mechanisms can coexist without overwriting each
other.

10 months agocmake: look for zlib >= 1.2.1 (#2318)
Mostyn Bramley-Moore [Thu, 12 Sep 2024 21:56:34 +0000 (23:56 +0200)] 
cmake: look for zlib >= 1.2.1 (#2318)

zlib 1.2.0 added this improvement for inflate:
"Raw inflate no longer needs an extra dummy byte at end"

libarchive does not feed zlib extra data beyond end of stream, so it
does not work with zlib < 1.2.0.

10 months agoFix ar archive entries having no type (#2290)
наб [Sun, 1 Sep 2024 04:11:23 +0000 (06:11 +0200)] 
Fix ar archive entries having no type (#2290)

Also removes some whitespace damage.

Closes #2241