cpio: treat read() errors properly

Resolves: #996150
Version: 2.11-24
This commit is contained in:
Pavel Raiskup 2013-09-30 09:18:27 +02:00
parent ddd988f59b
commit 1aa0682c3e
2 changed files with 50 additions and 2 deletions

View File

@ -0,0 +1,41 @@
commit 57288911a7882d663d6aa231158a3616f2ab2ed9
Author: Pavel Raiskup <praiskup@redhat.com>
AuthorDate: Mon Sep 23 15:35:30 2013 +0200
Commit: Pavel Raiskup <praiskup@redhat.com>
CommitDate: Mon Sep 23 16:42:11 2013 +0200
Use ssize_t for input buffer size
Bug report: https://bugzilla.redhat.com/show_bug.cgi?id=996150
* src/global.c: Use ssize_t rather than size_t for input_size.
* src/extern.h: Likewise.
diff --git a/src/extern.h b/src/extern.h
index ef00242..1e7193e 100644
--- a/src/extern.h
+++ b/src/extern.h
@@ -83,7 +83,8 @@ extern int debug_flag;
extern char *input_buffer, *output_buffer;
extern char *in_buff, *out_buff;
extern size_t input_buffer_size;
-extern size_t input_size, output_size;
+extern ssize_t input_size;
+extern size_t output_size;
extern off_t input_bytes, output_bytes;
extern char *directory_name;
diff --git a/src/global.c b/src/global.c
index e08e188..a08006e 100644
--- a/src/global.c
+++ b/src/global.c
@@ -156,7 +156,8 @@ size_t input_buffer_size;
char *in_buff, *out_buff;
/* Current number of bytes stored at `input_buff' and `output_buff'. */
-size_t input_size, output_size;
+ssize_t input_size;
+size_t output_size;
off_t input_bytes, output_bytes;

View File

@ -1,7 +1,7 @@
Summary: A GNU archiving program Summary: A GNU archiving program
Name: cpio Name: cpio
Version: 2.11 Version: 2.11
Release: 23%{?dist} Release: 24%{?dist}
License: GPLv3+ License: GPLv3+
Group: Applications/Archiving Group: Applications/Archiving
URL: http://www.gnu.org/software/cpio/ URL: http://www.gnu.org/software/cpio/
@ -30,6 +30,11 @@ Patch8: cpio-2.11-crc-fips-nit.patch
# ~> downstream # ~> downstream
Patch9: cpio-2.11-crc-large-files.patch Patch9: cpio-2.11-crc-large-files.patch
# Allow treat read() errors by changing type of input_size to signed integer.
# ~> downstream
# ~> http://lists.gnu.org/archive/html/bug-cpio/2013-09/msg00005.html
Patch10: cpio-2.11-treat-read-errors.patch
Requires(post): /sbin/install-info Requires(post): /sbin/install-info
Requires(preun): /sbin/install-info Requires(preun): /sbin/install-info
Provides: bundled(gnulib) Provides: bundled(gnulib)
@ -62,6 +67,7 @@ Install cpio if you need a program to manage file archives.
%patch7 -p1 -b .longnames %patch7 -p1 -b .longnames
%patch8 -p1 -b .sum32-fips %patch8 -p1 -b .sum32-fips
%patch9 -p1 -b .crc-big-files %patch9 -p1 -b .crc-big-files
%patch10 -p1 -b .treat-read-errors
autoreconf -v autoreconf -v
@ -110,9 +116,10 @@ fi
%{_infodir}/*.info* %{_infodir}/*.info*
%changelog %changelog
* Fri Sep 20 2013 Pavel Raiskup <praiskup@redhat.com> - 2.11-23 * Mon Sep 30 2013 Pavel Raiskup <praiskup@redhat.com> - 2.11-24
- properly trim "crc" checksum to 32 bits (#1001965) - properly trim "crc" checksum to 32 bits (#1001965)
- remove unneeded patch for config.gues/config.sub (#951442) - remove unneeded patch for config.gues/config.sub (#951442)
- allow treat read() errors (#996150)
* Sat Aug 03 2013 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 2.11-21 * Sat Aug 03 2013 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 2.11-21
- Rebuilt for https://fedoraproject.org/wiki/Fedora_20_Mass_Rebuild - Rebuilt for https://fedoraproject.org/wiki/Fedora_20_Mass_Rebuild