diff --git a/main/libarchive/APKBUILD b/main/libarchive/APKBUILD index 4c4f69d4f9ec..dd1044d6e8e7 100644 --- a/main/libarchive/APKBUILD +++ b/main/libarchive/APKBUILD @@ -2,7 +2,7 @@ # Maintainer: Natanael Copa pkgname=libarchive pkgver=3.7.2 -pkgrel=0 +pkgrel=1 pkgdesc="library that can create and read several streaming archive formats" url="https://libarchive.org/" arch="all" @@ -20,7 +20,9 @@ makedepends=" zstd-dev " subpackages="$pkgname-static $pkgname-dev $pkgname-doc $pkgname-tools" -source="https://libarchive.org/downloads/libarchive-$pkgver.tar.xz" +source="https://libarchive.org/downloads/libarchive-$pkgver.tar.xz + tar-make-error-reporting-more-robust-and-use-correct-errno.patch + " options="!check" # secfixes: @@ -60,4 +62,5 @@ tools() { sha512sums=" a21bebb27b808cb7d2ed13a70739904a1b7b55661d8dea83c9897a0129cf71e20c962f13666c571782ff0f4f753ca885619c2097d9e7691c2dee4e6e4b9a2971 libarchive-3.7.2.tar.xz +5ecfc835895b36b715a5e40094c6295d2580fed93f0cb3602dafcc177645458870091dbe70509ef880bd6a3cc43ef2e8166c155dfd64f801f40f54eb573c12c9 tar-make-error-reporting-more-robust-and-use-correct-errno.patch " diff --git a/main/libarchive/tar-make-error-reporting-more-robust-and-use-correct-errno.patch b/main/libarchive/tar-make-error-reporting-more-robust-and-use-correct-errno.patch new file mode 100644 index 000000000000..4e6f70104c51 --- /dev/null +++ b/main/libarchive/tar-make-error-reporting-more-robust-and-use-correct-errno.patch @@ -0,0 +1,26 @@ +From e200fd8abfb4cf895a1cab4d89b67e6eefe83942 Mon Sep 17 00:00:00 2001 +From: Ed Maste +Date: Fri, 29 Mar 2024 16:38:11 -0400 +Subject: [PATCH] tar: make error reporting more robust and use correct errno + +As discussed in #1609. +--- + tar/read.c | 5 +++-- + 1 file changed, 3 insertions(+), 2 deletions(-) + +diff --git a/tar/read.c b/tar/read.c +index af3d3f423..a7f14a07b 100644 +--- a/tar/read.c ++++ b/tar/read.c +@@ -371,8 +371,9 @@ read_archive(struct bsdtar *bsdtar, char mode, struct archive *writer) + if (r != ARCHIVE_OK) { + if (!bsdtar->verbose) + safe_fprintf(stderr, "%s", archive_entry_pathname(entry)); +- fprintf(stderr, ": %s: ", archive_error_string(a)); +- fprintf(stderr, "%s", strerror(errno)); ++ safe_fprintf(stderr, ": %s: %s", ++ archive_error_string(a), ++ strerror(archive_errno(a))); + if (!bsdtar->verbose) + fprintf(stderr, "\n"); + bsdtar->return_value = 1;