cpio: treat read() errors by checking for SAFE_READ_ERROR
Related: #996150 Version: 2.11-27
This commit is contained in:
parent
8457d4da06
commit
088636f6af
@ -1,41 +1,22 @@
|
|||||||
commit 57288911a7882d663d6aa231158a3616f2ab2ed9
|
diff --git a/src/util.c b/src/util.c
|
||||||
Author: Pavel Raiskup <praiskup@redhat.com>
|
index 00953d5..2a821c7 100644
|
||||||
AuthorDate: Mon Sep 23 15:35:30 2013 +0200
|
--- a/src/util.c
|
||||||
Commit: Pavel Raiskup <praiskup@redhat.com>
|
+++ b/src/util.c
|
||||||
CommitDate: Mon Sep 23 16:42:11 2013 +0200
|
@@ -203,7 +203,7 @@ tape_fill_input_buffer (int in_des, int num_bytes)
|
||||||
|
get_next_reel (in_des);
|
||||||
Use ssize_t for input buffer size
|
input_size = rmtread (in_des, input_buffer, num_bytes);
|
||||||
|
}
|
||||||
Bug report: https://bugzilla.redhat.com/show_bug.cgi?id=996150
|
- if (input_size < 0)
|
||||||
|
+ if (input_size == SAFE_READ_ERROR)
|
||||||
* src/global.c: Use ssize_t rather than size_t for input_size.
|
error (1, errno, _("read error"));
|
||||||
* src/extern.h: Likewise.
|
if (input_size == 0)
|
||||||
|
{
|
||||||
diff --git a/src/extern.h b/src/extern.h
|
@@ -224,7 +224,7 @@ disk_fill_input_buffer (int in_des, off_t num_bytes)
|
||||||
index ef00242..1e7193e 100644
|
in_buff = input_buffer;
|
||||||
--- a/src/extern.h
|
num_bytes = (num_bytes < DISK_IO_BLOCK_SIZE) ? num_bytes : DISK_IO_BLOCK_SIZE;
|
||||||
+++ b/src/extern.h
|
input_size = read (in_des, input_buffer, num_bytes);
|
||||||
@@ -83,7 +83,8 @@ extern int debug_flag;
|
- if (input_size < 0)
|
||||||
extern char *input_buffer, *output_buffer;
|
+ if (input_size == SAFE_READ_ERROR)
|
||||||
extern char *in_buff, *out_buff;
|
{
|
||||||
extern size_t input_buffer_size;
|
input_size = 0;
|
||||||
-extern size_t input_size, output_size;
|
return (-1);
|
||||||
+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;
|
|
||||||
|
|
||||||
|
@ -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: 26%{?dist}
|
Release: 27%{?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,9 +30,10 @@ Patch8: cpio-2.11-crc-fips-nit.patch
|
|||||||
# ~> upstream
|
# ~> upstream
|
||||||
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.
|
# Allow treat read() errors by checking for SAFE_READ_ERROR
|
||||||
# ~> downstream
|
# ~> downstream
|
||||||
# ~> http://lists.gnu.org/archive/html/bug-cpio/2013-09/msg00005.html
|
# ~> http://lists.gnu.org/archive/html/bug-cpio/2013-09/msg00005.html
|
||||||
|
# ~> http://lists.gnu.org/archive/html/bug-cpio/2014-05/msg00001.html
|
||||||
Patch10: cpio-2.11-treat-read-errors.patch
|
Patch10: cpio-2.11-treat-read-errors.patch
|
||||||
|
|
||||||
# Small typo in RU translation
|
# Small typo in RU translation
|
||||||
@ -124,6 +125,9 @@ fi
|
|||||||
%{_infodir}/*.info*
|
%{_infodir}/*.info*
|
||||||
|
|
||||||
%changelog
|
%changelog
|
||||||
|
* Sat May 24 2014 Pavel Raiskup <praiskup@redhat.com> - 2.11-27
|
||||||
|
- better fix for bad read() error checking (#996150)
|
||||||
|
|
||||||
* Mon Apr 07 2014 Pavel Raiskup <praiskup@redhat.com> - 2.11-26
|
* Mon Apr 07 2014 Pavel Raiskup <praiskup@redhat.com> - 2.11-26
|
||||||
- fix manual page to warn users about inode truncation (#952313)
|
- fix manual page to warn users about inode truncation (#952313)
|
||||||
- fix for RU translation (#1075510)
|
- fix for RU translation (#1075510)
|
||||||
|
Loading…
Reference in New Issue
Block a user