Skip to content

Commit

Permalink
main/libarchive: backport upstream fix
Browse files Browse the repository at this point in the history
  • Loading branch information
ncopa committed Mar 30, 2024
1 parent 3a8c670 commit 71d684e
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 2 deletions.
7 changes: 5 additions & 2 deletions main/libarchive/APKBUILD
Expand Up @@ -2,7 +2,7 @@
# Maintainer: Natanael Copa <ncopa@alpinelinux.org>
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"
Expand 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:
Expand Down Expand Up @@ -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
"
@@ -0,0 +1,26 @@
From e200fd8abfb4cf895a1cab4d89b67e6eefe83942 Mon Sep 17 00:00:00 2001
From: Ed Maste <emaste@FreeBSD.org>
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;

0 comments on commit 71d684e

Please sign in to comment.