File: robust-error-reporting.patch

package info (click to toggle)
libarchive 3.6.2-1%2Bdeb12u3
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 26,108 kB
  • sloc: ansic: 159,258; sh: 5,417; makefile: 1,763; awk: 770; cpp: 41
file content (20 lines) | stat: -rw-r--r-- 759 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
Description: tar: make error reporting more robust and use correct errno
Debian-Bug: https://bugs.debian.org/1068047
Origin: upstream, https://github.com/libarchive/libarchive/commit/6110e9c82d8ba830c3440f36b990483ceaaea52c
Author: Ed Maste <emaste@freebsd.org>
Last-Update: 2024-03-30

--- a/tar/read.c
+++ b/tar/read.c
@@ -372,8 +372,9 @@
 			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;