diff options
author | Michał Górny <mgorny@gentoo.org> | 2024-03-31 17:20:09 +0200 |
---|---|---|
committer | Michał Górny <mgorny@gentoo.org> | 2024-03-31 17:20:09 +0200 |
commit | 43c399629fb022b7519d70194cb6c0364809764d (patch) | |
tree | 8c8ad2886e579df94f1a91d5e0f7e9465a29dcb4 /app-arch/libarchive | |
parent | games-emulation/pcsx2: update live (diff) | |
download | gentoo-43c399629fb022b7519d70194cb6c0364809764d.tar.gz gentoo-43c399629fb022b7519d70194cb6c0364809764d.tar.bz2 gentoo-43c399629fb022b7519d70194cb6c0364809764d.zip |
app-arch/libarchive: Backport tar error handling fix
Closes: https://bugs.gentoo.org/928146
Signed-off-by: Michał Górny <mgorny@gentoo.org>
Diffstat (limited to 'app-arch/libarchive')
-rw-r--r-- | app-arch/libarchive/files/libarchive-3.7.2-safe-fprintf.patch | 27 | ||||
-rw-r--r-- | app-arch/libarchive/libarchive-3.7.2-r3.ebuild (renamed from app-arch/libarchive/libarchive-3.7.2-r2.ebuild) | 2 |
2 files changed, 29 insertions, 0 deletions
diff --git a/app-arch/libarchive/files/libarchive-3.7.2-safe-fprintf.patch b/app-arch/libarchive/files/libarchive-3.7.2-safe-fprintf.patch new file mode 100644 index 000000000000..6a351ba37fea --- /dev/null +++ b/app-arch/libarchive/files/libarchive-3.7.2-safe-fprintf.patch @@ -0,0 +1,27 @@ +From 6110e9c82d8ba830c3440f36b990483ceaaea52c Mon Sep 17 00:00:00 2001 +From: Ed Maste <emaste@freebsd.org> +Date: Fri, 29 Mar 2024 18:02:06 -0400 +Subject: [PATCH] tar: make error reporting more robust and use correct errno + (#2101) + +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; diff --git a/app-arch/libarchive/libarchive-3.7.2-r2.ebuild b/app-arch/libarchive/libarchive-3.7.2-r3.ebuild index 0e17daa7457c..5387e642a60c 100644 --- a/app-arch/libarchive/libarchive-3.7.2-r2.ebuild +++ b/app-arch/libarchive/libarchive-3.7.2-r3.ebuild @@ -76,6 +76,8 @@ PATCHES=( # https://github.com/libarchive/libarchive/issues/2069 # (we can simply update the command since we don't support old lrzip) "${FILESDIR}/${P}-lrzip.patch" + # https://github.com/libarchive/libarchive/pull/2101 + "${FILESDIR}/${P}-safe-fprintf.patch" ) src_prepare() { |