From f0f11f233d1e4fafd372a8eed03b7d08e9403e58 Mon Sep 17 00:00:00 2001 From: CentOS Sources Date: Oct 21 2019 05:13:46 +0000 Subject: import cpio-2.11-27.el7 --- diff --git a/.cpio.metadata b/.cpio.metadata new file mode 100644 index 0000000..47407a4 --- /dev/null +++ b/.cpio.metadata @@ -0,0 +1 @@ +6f1934b0079dc1e85ddff89cabdf01adb3a74abb SOURCES/cpio-2.11.tar.bz2 diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..abfa2cd --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +SOURCES/cpio-2.11.tar.bz2 diff --git a/SOURCES/cpio-2.10-longnames-split.patch b/SOURCES/cpio-2.10-longnames-split.patch new file mode 100644 index 0000000..d4517b1 --- /dev/null +++ b/SOURCES/cpio-2.10-longnames-split.patch @@ -0,0 +1,20 @@ +diff --git a/src/tar.c b/src/tar.c +index 97d74bc..6de8961 100644 +--- a/src/tar.c ++++ b/src/tar.c +@@ -48,10 +48,12 @@ split_long_name (const char *name, size_t length) + { + size_t i; + +- if (length > TARPREFIXSIZE) +- length = TARPREFIXSIZE+2; ++ if (length > TARPREFIXSIZE + 1) ++ length = TARPREFIXSIZE + 1; ++ else if (ISSLASH (name[length - 1])) ++ length--; + for (i = length - 1; i > 0; i--) +- if (name[i] == '/') ++ if (ISSLASH (name[i])) + break; + return i; + } diff --git a/SOURCES/cpio-2.10-patternnamesigsegv.patch b/SOURCES/cpio-2.10-patternnamesigsegv.patch new file mode 100644 index 0000000..c3b9420 --- /dev/null +++ b/SOURCES/cpio-2.10-patternnamesigsegv.patch @@ -0,0 +1,41 @@ +diff -urNp cpio-2.10-orig/src/copyin.c cpio-2.10/src/copyin.c +--- cpio-2.10-orig/src/copyin.c 2010-02-22 12:57:59.000000000 +0100 ++++ cpio-2.10/src/copyin.c 2010-02-22 12:55:26.000000000 +0100 +@@ -944,20 +944,23 @@ read_pattern_file () + pattern_fp = fopen (pattern_file_name, "r"); + if (pattern_fp == NULL) + open_error (pattern_file_name); +- while (ds_fgetstr (pattern_fp, &pattern_name, '\n') != NULL) +- { +- if (new_num_patterns >= max_new_patterns) +- { +- max_new_patterns += 1; +- new_save_patterns = (char **) +- xrealloc ((char *) new_save_patterns, +- max_new_patterns * sizeof (char *)); +- } +- new_save_patterns[new_num_patterns] = xstrdup (pattern_name.ds_string); +- ++new_num_patterns; +- } +- if (ferror (pattern_fp) || fclose (pattern_fp) == EOF) +- close_error (pattern_file_name); ++ else ++ { ++ while (ds_fgetstr (pattern_fp, &pattern_name, '\n') != NULL) ++ { ++ if (new_num_patterns >= max_new_patterns) ++ { ++ max_new_patterns += 1; ++ new_save_patterns = (char **) ++ xrealloc ((char *) new_save_patterns, ++ max_new_patterns * sizeof (char *)); ++ } ++ new_save_patterns[new_num_patterns] = xstrdup (pattern_name.ds_string); ++ ++new_num_patterns; ++ } ++ if (ferror (pattern_fp) || fclose (pattern_fp) == EOF) ++ close_error (pattern_file_name); ++ } + + for (i = 0; i < num_patterns; ++i) + new_save_patterns[i] = save_patterns[i]; diff --git a/SOURCES/cpio-2.11-CVE-2014-9112.patch b/SOURCES/cpio-2.11-CVE-2014-9112.patch new file mode 100644 index 0000000..64fec9f --- /dev/null +++ b/SOURCES/cpio-2.11-CVE-2014-9112.patch @@ -0,0 +1,212 @@ +diff --git a/src/copyin.c b/src/copyin.c +index d505407..db8ee66 100644 +--- a/src/copyin.c ++++ b/src/copyin.c +@@ -124,10 +124,30 @@ tape_skip_padding (int in_file_des, off_t offset) + if (pad != 0) + tape_toss_input (in_file_des, pad); + } +- ++ ++static char * ++get_link_name (struct cpio_file_stat *file_hdr, int in_file_des) ++{ ++ char *link_name; ++ ++ if (file_hdr->c_filesize < 0 || file_hdr->c_filesize > SIZE_MAX-1) ++ { ++ error (0, 0, _("%s: stored filename length is out of range"), ++ file_hdr->c_name); ++ link_name = NULL; ++ } ++ else ++ { ++ link_name = xmalloc (file_hdr->c_filesize + 1); ++ tape_buffered_read (link_name, in_file_des, file_hdr->c_filesize); ++ link_name[file_hdr->c_filesize] = '\0'; ++ tape_skip_padding (in_file_des, file_hdr->c_filesize); ++ } ++ return link_name; ++} + + static void +-list_file(struct cpio_file_stat* file_hdr, int in_file_des) ++list_file (struct cpio_file_stat* file_hdr, int in_file_des) + { + if (verbose_flag) + { +@@ -136,21 +156,16 @@ list_file(struct cpio_file_stat* file_hdr, int in_file_des) + { + if (archive_format != arf_tar && archive_format != arf_ustar) + { +- char *link_name = NULL; /* Name of hard and symbolic links. */ +- +- link_name = (char *) xmalloc ((unsigned int) file_hdr->c_filesize + 1); +- link_name[file_hdr->c_filesize] = '\0'; +- tape_buffered_read (link_name, in_file_des, file_hdr->c_filesize); +- long_format (file_hdr, link_name); +- free (link_name); +- tape_skip_padding (in_file_des, file_hdr->c_filesize); +- return; ++ char *link_name = get_link_name (file_hdr, in_file_des); ++ if (link_name) ++ { ++ long_format (file_hdr, link_name); ++ free (link_name); ++ } + } + else +- { +- long_format (file_hdr, file_hdr->c_tar_linkname); +- return; +- } ++ long_format (file_hdr, file_hdr->c_tar_linkname); ++ return; + } + else + #endif +@@ -650,10 +665,7 @@ copyin_link(struct cpio_file_stat *file_hdr, int in_file_des) + + if (archive_format != arf_tar && archive_format != arf_ustar) + { +- link_name = (char *) xmalloc ((unsigned int) file_hdr->c_filesize + 1); +- link_name[file_hdr->c_filesize] = '\0'; +- tape_buffered_read (link_name, in_file_des, file_hdr->c_filesize); +- tape_skip_padding (in_file_des, file_hdr->c_filesize); ++ link_name = get_link_name (file_hdr, in_file_des); + } + else + { +diff --git a/tests/Makefile.am b/tests/Makefile.am +index b3e8e60..cf186da 100644 +--- a/tests/Makefile.am ++++ b/tests/Makefile.am +@@ -52,6 +52,8 @@ TESTSUITE_AT = \ + setstat04.at\ + setstat05.at\ + symlink.at\ ++ symlink-bad-length.at\ ++ symlink-long.at\ + version.at + + TESTSUITE = $(srcdir)/testsuite +diff --git a/tests/symlink-bad-length.at b/tests/symlink-bad-length.at +new file mode 100644 +index 0000000..cbf4aa7 +--- /dev/null ++++ b/tests/symlink-bad-length.at +@@ -0,0 +1,49 @@ ++# Process this file with autom4te to create testsuite. -*- Autotest -*- ++# Copyright (C) 2014 Free Software Foundation, Inc. ++ ++# This program is free software; you can redistribute it and/or modify ++# it under the terms of the GNU General Public License as published by ++# the Free Software Foundation; either version 3, or (at your option) ++# any later version. ++ ++# This program is distributed in the hope that it will be useful, ++# but WITHOUT ANY WARRANTY; without even the implied warranty of ++# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++# GNU General Public License for more details. ++ ++# You should have received a copy of the GNU General Public License ++# along with this program; if not, write to the Free Software ++# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA ++# 02110-1301 USA. ++ ++# Cpio v2.11 did segfault with badly set symlink length. ++# References: ++# http://lists.gnu.org/archive/html/bug-cpio/2014-11/msg00007.html ++ ++AT_SETUP([symlink-bad-length]) ++AT_KEYWORDS([symlink-long copyout]) ++ ++AT_DATA([ARCHIVE.base64], ++[x3EjAIBAtIEtJy8nAQAAAHRUYW0FAAAADQBGSUxFAABzb21lIGNvbnRlbnQKAMdxIwBgQ/+hLScv ++JwEAAAB0VEhuBQD/////TElOSwAARklMRcdxAAAAAAAAAAAAAAEAAAAAAAAACwAAAAAAVFJBSUxF ++UiEhIQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA ++AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA ++AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA ++AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA ++AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA ++AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA ++AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA= ++]) ++ ++AT_CHECK([ ++base64 -d ARCHIVE.base64 > ARCHIVE || AT_SKIP_TEST ++cpio -ntv < ARCHIVE ++test $? -eq 2 ++], ++[0], ++[-rw-rw-r-- 1 10029 10031 13 Nov 25 13:52 FILE ++],[cpio: LINK: stored filename length is out of range ++cpio: premature end of file ++]) ++ ++AT_CLEANUP +diff --git a/tests/symlink-long.at b/tests/symlink-long.at +new file mode 100644 +index 0000000..d3def2d +--- /dev/null ++++ b/tests/symlink-long.at +@@ -0,0 +1,46 @@ ++# Process this file with autom4te to create testsuite. -*- Autotest -*- ++# Copyright (C) 2014 Free Software Foundation, Inc. ++ ++# This program is free software; you can redistribute it and/or modify ++# it under the terms of the GNU General Public License as published by ++# the Free Software Foundation; either version 3, or (at your option) ++# any later version. ++ ++# This program is distributed in the hope that it will be useful, ++# but WITHOUT ANY WARRANTY; without even the implied warranty of ++# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++# GNU General Public License for more details. ++ ++# You should have received a copy of the GNU General Public License ++# along with this program; if not, write to the Free Software ++# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA ++# 02110-1301 USA. ++ ++# Cpio v2.11.90 changed the way symlink name is read from archive. ++# References: ++# http://lists.gnu.org/archive/html/bug-cpio/2014-11/msg00007.html ++ ++AT_SETUP([symlink-long]) ++AT_KEYWORDS([symlink-long copyout]) ++ ++AT_CHECK([ ++ ++# len(dirname) > READBUFSIZE ++dirname= ++for i in {1..52}; do ++ dirname="xxxxxxxxx/$dirname" ++ mkdir "$dirname" ++done ++ln -s "$dirname" x || AT_SKIP_TEST ++ ++echo x | cpio -o > ar ++list=`cpio -tv < ar | sed 's|.*-> ||'` ++test "$list" = "$dirname" && echo success || echo fail ++], ++[0], ++[success ++],[2 blocks ++2 blocks ++]) ++ ++AT_CLEANUP +diff --git a/tests/testsuite.at b/tests/testsuite.at +index 8f3330b..590bdcb 100644 +--- a/tests/testsuite.at ++++ b/tests/testsuite.at +@@ -31,6 +31,8 @@ m4_include([version.at]) + + m4_include([inout.at]) + m4_include([symlink.at]) ++m4_include([symlink-bad-length.at]) ++m4_include([symlink-long.at]) + m4_include([interdir.at]) + + m4_include([setstat01.at]) diff --git a/SOURCES/cpio-2.11-arm-config-sub-guess.patch b/SOURCES/cpio-2.11-arm-config-sub-guess.patch new file mode 100644 index 0000000..e9d4651 --- /dev/null +++ b/SOURCES/cpio-2.11-arm-config-sub-guess.patch @@ -0,0 +1,1232 @@ +diff --git a/build-aux/config.guess b/build-aux/config.guess +index c2246a4..1804e9f 100755 +--- a/build-aux/config.guess ++++ b/build-aux/config.guess +@@ -1,14 +1,14 @@ + #! /bin/sh + # Attempt to guess a canonical system name. + # Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, +-# 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010 +-# Free Software Foundation, Inc. ++# 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, ++# 2011, 2012, 2013 Free Software Foundation, Inc. + +-timestamp='2009-12-30' ++timestamp='2012-12-29' + + # This file is free software; you can redistribute it and/or modify it + # under the terms of the GNU General Public License as published by +-# the Free Software Foundation; either version 2 of the License, or ++# the Free Software Foundation; either version 3 of the License, or + # (at your option) any later version. + # + # This program is distributed in the hope that it will be useful, but +@@ -17,26 +17,22 @@ timestamp='2009-12-30' + # General Public License for more details. + # + # You should have received a copy of the GNU General Public License +-# along with this program; if not, write to the Free Software +-# Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA +-# 02110-1301, USA. ++# along with this program; if not, see . + # + # As a special exception to the GNU General Public License, if you + # distribute this file as part of a program that contains a + # configuration script generated by Autoconf, you may include it under +-# the same distribution terms that you use for the rest of that program. +- +- +-# Originally written by Per Bothner. Please send patches (context +-# diff format) to and include a ChangeLog +-# entry. ++# the same distribution terms that you use for the rest of that ++# program. This Exception is an additional permission under section 7 ++# of the GNU General Public License, version 3 ("GPLv3"). + # +-# This script attempts to guess a canonical system name similar to +-# config.sub. If it succeeds, it prints the system name on stdout, and +-# exits with 0. Otherwise, it exits with 1. ++# Originally written by Per Bothner. + # + # You can get the latest version of this script from: + # http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.guess;hb=HEAD ++# ++# Please send patches with a ChangeLog entry to config-patches@gnu.org. ++ + + me=`echo "$0" | sed -e 's,.*/,,'` + +@@ -57,8 +53,8 @@ GNU config.guess ($timestamp) + + Originally written by Per Bothner. + Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, +-2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010 Free +-Software Foundation, Inc. ++2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, ++2012, 2013 Free Software Foundation, Inc. + + This is free software; see the source for copying conditions. There is NO + warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE." +@@ -145,7 +141,7 @@ UNAME_VERSION=`(uname -v) 2>/dev/null` || UNAME_VERSION=unknown + case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in + *:NetBSD:*:*) + # NetBSD (nbsd) targets should (where applicable) match one or +- # more of the tupples: *-*-netbsdelf*, *-*-netbsdaout*, ++ # more of the tuples: *-*-netbsdelf*, *-*-netbsdaout*, + # *-*-netbsdecoff* and *-*-netbsd*. For targets that recently + # switched to ELF, *-*-netbsd* would select the old + # object file format. This provides both forward +@@ -181,7 +177,7 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in + fi + ;; + *) +- os=netbsd ++ os=netbsd + ;; + esac + # The OS release +@@ -202,6 +198,10 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in + # CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM is used. + echo "${machine}-${os}${release}" + exit ;; ++ *:Bitrig:*:*) ++ UNAME_MACHINE_ARCH=`arch | sed 's/Bitrig.//'` ++ echo ${UNAME_MACHINE_ARCH}-unknown-bitrig${UNAME_RELEASE} ++ exit ;; + *:OpenBSD:*:*) + UNAME_MACHINE_ARCH=`arch | sed 's/OpenBSD.//'` + echo ${UNAME_MACHINE_ARCH}-unknown-openbsd${UNAME_RELEASE} +@@ -224,7 +224,7 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in + UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $3}'` + ;; + *5.*) +- UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $4}'` ++ UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $4}'` + ;; + esac + # According to Compaq, /usr/sbin/psrinfo has been available on +@@ -270,7 +270,10 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in + # A Xn.n version is an unreleased experimental baselevel. + # 1.2 uses "1.2" for uname -r. + echo ${UNAME_MACHINE}-dec-osf`echo ${UNAME_RELEASE} | sed -e 's/^[PVTX]//' | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` +- exit ;; ++ # Reset EXIT trap before exiting to avoid spurious non-zero exit code. ++ exitcode=$? ++ trap '' 0 ++ exit $exitcode ;; + Alpha\ *:Windows_NT*:*) + # How do we know it's Interix rather than the generic POSIX subsystem? + # Should we change UNAME_MACHINE based on the output of uname instead +@@ -296,12 +299,12 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in + echo s390-ibm-zvmoe + exit ;; + *:OS400:*:*) +- echo powerpc-ibm-os400 ++ echo powerpc-ibm-os400 + exit ;; + arm:RISC*:1.[012]*:*|arm:riscix:1.[012]*:*) + echo arm-acorn-riscix${UNAME_RELEASE} + exit ;; +- arm:riscos:*:*|arm:RISCOS:*:*) ++ arm*:riscos:*:*|arm*:RISCOS:*:*) + echo arm-unknown-riscos + exit ;; + SR2?01:HI-UX/MPP:*:* | SR8000:HI-UX/MPP:*:*) +@@ -395,23 +398,23 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in + # MiNT. But MiNT is downward compatible to TOS, so this should + # be no problem. + atarist[e]:*MiNT:*:* | atarist[e]:*mint:*:* | atarist[e]:*TOS:*:*) +- echo m68k-atari-mint${UNAME_RELEASE} ++ echo m68k-atari-mint${UNAME_RELEASE} + exit ;; + atari*:*MiNT:*:* | atari*:*mint:*:* | atarist[e]:*TOS:*:*) + echo m68k-atari-mint${UNAME_RELEASE} +- exit ;; ++ exit ;; + *falcon*:*MiNT:*:* | *falcon*:*mint:*:* | *falcon*:*TOS:*:*) +- echo m68k-atari-mint${UNAME_RELEASE} ++ echo m68k-atari-mint${UNAME_RELEASE} + exit ;; + milan*:*MiNT:*:* | milan*:*mint:*:* | *milan*:*TOS:*:*) +- echo m68k-milan-mint${UNAME_RELEASE} +- exit ;; ++ echo m68k-milan-mint${UNAME_RELEASE} ++ exit ;; + hades*:*MiNT:*:* | hades*:*mint:*:* | *hades*:*TOS:*:*) +- echo m68k-hades-mint${UNAME_RELEASE} +- exit ;; ++ echo m68k-hades-mint${UNAME_RELEASE} ++ exit ;; + *:*MiNT:*:* | *:*mint:*:* | *:*TOS:*:*) +- echo m68k-unknown-mint${UNAME_RELEASE} +- exit ;; ++ echo m68k-unknown-mint${UNAME_RELEASE} ++ exit ;; + m68k:machten:*:*) + echo m68k-apple-machten${UNAME_RELEASE} + exit ;; +@@ -481,8 +484,8 @@ EOF + echo m88k-motorola-sysv3 + exit ;; + AViiON:dgux:*:*) +- # DG/UX returns AViiON for all architectures +- UNAME_PROCESSOR=`/usr/bin/uname -p` ++ # DG/UX returns AViiON for all architectures ++ UNAME_PROCESSOR=`/usr/bin/uname -p` + if [ $UNAME_PROCESSOR = mc88100 ] || [ $UNAME_PROCESSOR = mc88110 ] + then + if [ ${TARGET_BINARY_INTERFACE}x = m88kdguxelfx ] || \ +@@ -495,7 +498,7 @@ EOF + else + echo i586-dg-dgux${UNAME_RELEASE} + fi +- exit ;; ++ exit ;; + M88*:DolphinOS:*:*) # DolphinOS (SVR3) + echo m88k-dolphin-sysv3 + exit ;; +@@ -552,7 +555,7 @@ EOF + echo rs6000-ibm-aix3.2 + fi + exit ;; +- *:AIX:*:[456]) ++ *:AIX:*:[4567]) + IBM_CPU_ID=`/usr/sbin/lsdev -C -c processor -S available | sed 1q | awk '{ print $1 }'` + if /usr/sbin/lsattr -El ${IBM_CPU_ID} | grep ' POWER' >/dev/null 2>&1; then + IBM_ARCH=rs6000 +@@ -595,52 +598,52 @@ EOF + 9000/[678][0-9][0-9]) + if [ -x /usr/bin/getconf ]; then + sc_cpu_version=`/usr/bin/getconf SC_CPU_VERSION 2>/dev/null` +- sc_kernel_bits=`/usr/bin/getconf SC_KERNEL_BITS 2>/dev/null` +- case "${sc_cpu_version}" in +- 523) HP_ARCH="hppa1.0" ;; # CPU_PA_RISC1_0 +- 528) HP_ARCH="hppa1.1" ;; # CPU_PA_RISC1_1 +- 532) # CPU_PA_RISC2_0 +- case "${sc_kernel_bits}" in +- 32) HP_ARCH="hppa2.0n" ;; +- 64) HP_ARCH="hppa2.0w" ;; ++ sc_kernel_bits=`/usr/bin/getconf SC_KERNEL_BITS 2>/dev/null` ++ case "${sc_cpu_version}" in ++ 523) HP_ARCH="hppa1.0" ;; # CPU_PA_RISC1_0 ++ 528) HP_ARCH="hppa1.1" ;; # CPU_PA_RISC1_1 ++ 532) # CPU_PA_RISC2_0 ++ case "${sc_kernel_bits}" in ++ 32) HP_ARCH="hppa2.0n" ;; ++ 64) HP_ARCH="hppa2.0w" ;; + '') HP_ARCH="hppa2.0" ;; # HP-UX 10.20 +- esac ;; +- esac ++ esac ;; ++ esac + fi + if [ "${HP_ARCH}" = "" ]; then + eval $set_cc_for_build +- sed 's/^ //' << EOF >$dummy.c ++ sed 's/^ //' << EOF >$dummy.c + +- #define _HPUX_SOURCE +- #include +- #include ++ #define _HPUX_SOURCE ++ #include ++ #include + +- int main () +- { +- #if defined(_SC_KERNEL_BITS) +- long bits = sysconf(_SC_KERNEL_BITS); +- #endif +- long cpu = sysconf (_SC_CPU_VERSION); ++ int main () ++ { ++ #if defined(_SC_KERNEL_BITS) ++ long bits = sysconf(_SC_KERNEL_BITS); ++ #endif ++ long cpu = sysconf (_SC_CPU_VERSION); + +- switch (cpu) +- { +- case CPU_PA_RISC1_0: puts ("hppa1.0"); break; +- case CPU_PA_RISC1_1: puts ("hppa1.1"); break; +- case CPU_PA_RISC2_0: +- #if defined(_SC_KERNEL_BITS) +- switch (bits) +- { +- case 64: puts ("hppa2.0w"); break; +- case 32: puts ("hppa2.0n"); break; +- default: puts ("hppa2.0"); break; +- } break; +- #else /* !defined(_SC_KERNEL_BITS) */ +- puts ("hppa2.0"); break; +- #endif +- default: puts ("hppa1.0"); break; +- } +- exit (0); +- } ++ switch (cpu) ++ { ++ case CPU_PA_RISC1_0: puts ("hppa1.0"); break; ++ case CPU_PA_RISC1_1: puts ("hppa1.1"); break; ++ case CPU_PA_RISC2_0: ++ #if defined(_SC_KERNEL_BITS) ++ switch (bits) ++ { ++ case 64: puts ("hppa2.0w"); break; ++ case 32: puts ("hppa2.0n"); break; ++ default: puts ("hppa2.0"); break; ++ } break; ++ #else /* !defined(_SC_KERNEL_BITS) */ ++ puts ("hppa2.0"); break; ++ #endif ++ default: puts ("hppa1.0"); break; ++ } ++ exit (0); ++ } + EOF + (CCOPTS= $CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null) && HP_ARCH=`$dummy` + test -z "$HP_ARCH" && HP_ARCH=hppa +@@ -731,22 +734,22 @@ EOF + exit ;; + C1*:ConvexOS:*:* | convex:ConvexOS:C1*:*) + echo c1-convex-bsd +- exit ;; ++ exit ;; + C2*:ConvexOS:*:* | convex:ConvexOS:C2*:*) + if getsysinfo -f scalar_acc + then echo c32-convex-bsd + else echo c2-convex-bsd + fi +- exit ;; ++ exit ;; + C34*:ConvexOS:*:* | convex:ConvexOS:C34*:*) + echo c34-convex-bsd +- exit ;; ++ exit ;; + C38*:ConvexOS:*:* | convex:ConvexOS:C38*:*) + echo c38-convex-bsd +- exit ;; ++ exit ;; + C4*:ConvexOS:*:* | convex:ConvexOS:C4*:*) + echo c4-convex-bsd +- exit ;; ++ exit ;; + CRAY*Y-MP:*:*:*) + echo ymp-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' + exit ;; +@@ -770,14 +773,14 @@ EOF + exit ;; + F30[01]:UNIX_System_V:*:* | F700:UNIX_System_V:*:*) + FUJITSU_PROC=`uname -m | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` +- FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'` +- FUJITSU_REL=`echo ${UNAME_RELEASE} | sed -e 's/ /_/'` +- echo "${FUJITSU_PROC}-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}" +- exit ;; ++ FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'` ++ FUJITSU_REL=`echo ${UNAME_RELEASE} | sed -e 's/ /_/'` ++ echo "${FUJITSU_PROC}-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}" ++ exit ;; + 5000:UNIX_System_V:4.*:*) +- FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'` +- FUJITSU_REL=`echo ${UNAME_RELEASE} | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/ /_/'` +- echo "sparc-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}" ++ FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'` ++ FUJITSU_REL=`echo ${UNAME_RELEASE} | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/ /_/'` ++ echo "sparc-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}" + exit ;; + i*86:BSD/386:*:* | i*86:BSD/OS:*:* | *:Ascend\ Embedded/OS:*:*) + echo ${UNAME_MACHINE}-pc-bsdi${UNAME_RELEASE} +@@ -789,30 +792,35 @@ EOF + echo ${UNAME_MACHINE}-unknown-bsdi${UNAME_RELEASE} + exit ;; + *:FreeBSD:*:*) +- case ${UNAME_MACHINE} in +- pc98) +- echo i386-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;; ++ UNAME_PROCESSOR=`/usr/bin/uname -p` ++ case ${UNAME_PROCESSOR} in + amd64) + echo x86_64-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;; + *) +- echo ${UNAME_MACHINE}-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;; ++ echo ${UNAME_PROCESSOR}-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;; + esac + exit ;; + i*:CYGWIN*:*) + echo ${UNAME_MACHINE}-pc-cygwin + exit ;; ++ *:MINGW64*:*) ++ echo ${UNAME_MACHINE}-pc-mingw64 ++ exit ;; + *:MINGW*:*) + echo ${UNAME_MACHINE}-pc-mingw32 + exit ;; ++ i*:MSYS*:*) ++ echo ${UNAME_MACHINE}-pc-msys ++ exit ;; + i*:windows32*:*) +- # uname -m includes "-pc" on this system. +- echo ${UNAME_MACHINE}-mingw32 ++ # uname -m includes "-pc" on this system. ++ echo ${UNAME_MACHINE}-mingw32 + exit ;; + i*:PW*:*) + echo ${UNAME_MACHINE}-pc-pw32 + exit ;; + *:Interix*:*) +- case ${UNAME_MACHINE} in ++ case ${UNAME_MACHINE} in + x86) + echo i586-pc-interix${UNAME_RELEASE} + exit ;; +@@ -858,6 +866,13 @@ EOF + i*86:Minix:*:*) + echo ${UNAME_MACHINE}-pc-minix + exit ;; ++ aarch64:Linux:*:*) ++ echo ${UNAME_MACHINE}-unknown-linux-gnu ++ exit ;; ++ aarch64_be:Linux:*:*) ++ UNAME_MACHINE=aarch64_be ++ echo ${UNAME_MACHINE}-unknown-linux-gnu ++ exit ;; + alpha:Linux:*:*) + case `sed -n '/^cpu model/s/^.*: \(.*\)/\1/p' < /proc/cpuinfo` in + EV5) UNAME_MACHINE=alphaev5 ;; +@@ -867,7 +882,7 @@ EOF + EV6) UNAME_MACHINE=alphaev6 ;; + EV67) UNAME_MACHINE=alphaev67 ;; + EV68*) UNAME_MACHINE=alphaev68 ;; +- esac ++ esac + objdump --private-headers /bin/sh | grep -q ld.so.1 + if test "$?" = 0 ; then LIBC="libc1" ; else LIBC="" ; fi + echo ${UNAME_MACHINE}-unknown-linux-gnu${LIBC} +@@ -879,20 +894,29 @@ EOF + then + echo ${UNAME_MACHINE}-unknown-linux-gnu + else +- echo ${UNAME_MACHINE}-unknown-linux-gnueabi ++ if echo __ARM_PCS_VFP | $CC_FOR_BUILD -E - 2>/dev/null \ ++ | grep -q __ARM_PCS_VFP ++ then ++ echo ${UNAME_MACHINE}-unknown-linux-gnueabi ++ else ++ echo ${UNAME_MACHINE}-unknown-linux-gnueabihf ++ fi + fi + exit ;; + avr32*:Linux:*:*) + echo ${UNAME_MACHINE}-unknown-linux-gnu + exit ;; + cris:Linux:*:*) +- echo cris-axis-linux-gnu ++ echo ${UNAME_MACHINE}-axis-linux-gnu + exit ;; + crisv32:Linux:*:*) +- echo crisv32-axis-linux-gnu ++ echo ${UNAME_MACHINE}-axis-linux-gnu + exit ;; + frv:Linux:*:*) +- echo frv-unknown-linux-gnu ++ echo ${UNAME_MACHINE}-unknown-linux-gnu ++ exit ;; ++ hexagon:Linux:*:*) ++ echo ${UNAME_MACHINE}-unknown-linux-gnu + exit ;; + i*86:Linux:*:*) + LIBC=gnu +@@ -934,7 +958,7 @@ EOF + test x"${CPU}" != x && { echo "${CPU}-unknown-linux-gnu"; exit; } + ;; + or32:Linux:*:*) +- echo or32-unknown-linux-gnu ++ echo ${UNAME_MACHINE}-unknown-linux-gnu + exit ;; + padre:Linux:*:*) + echo sparc-unknown-linux-gnu +@@ -960,7 +984,7 @@ EOF + echo ${UNAME_MACHINE}-ibm-linux + exit ;; + sh64*:Linux:*:*) +- echo ${UNAME_MACHINE}-unknown-linux-gnu ++ echo ${UNAME_MACHINE}-unknown-linux-gnu + exit ;; + sh*:Linux:*:*) + echo ${UNAME_MACHINE}-unknown-linux-gnu +@@ -968,14 +992,17 @@ EOF + sparc:Linux:*:* | sparc64:Linux:*:*) + echo ${UNAME_MACHINE}-unknown-linux-gnu + exit ;; ++ tile*:Linux:*:*) ++ echo ${UNAME_MACHINE}-unknown-linux-gnu ++ exit ;; + vax:Linux:*:*) + echo ${UNAME_MACHINE}-dec-linux-gnu + exit ;; + x86_64:Linux:*:*) +- echo x86_64-unknown-linux-gnu ++ echo ${UNAME_MACHINE}-unknown-linux-gnu + exit ;; + xtensa*:Linux:*:*) +- echo ${UNAME_MACHINE}-unknown-linux-gnu ++ echo ${UNAME_MACHINE}-unknown-linux-gnu + exit ;; + i*86:DYNIX/ptx:4*:*) + # ptx 4.0 does uname -s correctly, with DYNIX/ptx in there. +@@ -984,11 +1011,11 @@ EOF + echo i386-sequent-sysv4 + exit ;; + i*86:UNIX_SV:4.2MP:2.*) +- # Unixware is an offshoot of SVR4, but it has its own version +- # number series starting with 2... +- # I am not positive that other SVR4 systems won't match this, ++ # Unixware is an offshoot of SVR4, but it has its own version ++ # number series starting with 2... ++ # I am not positive that other SVR4 systems won't match this, + # I just have to hope. -- rms. +- # Use sysv4.2uw... so that sysv4* matches it. ++ # Use sysv4.2uw... so that sysv4* matches it. + echo ${UNAME_MACHINE}-pc-sysv4.2uw${UNAME_VERSION} + exit ;; + i*86:OS/2:*:*) +@@ -1020,7 +1047,7 @@ EOF + fi + exit ;; + i*86:*:5:[678]*) +- # UnixWare 7.x, OpenUNIX and OpenServer 6. ++ # UnixWare 7.x, OpenUNIX and OpenServer 6. + case `/bin/uname -X | grep "^Machine"` in + *486*) UNAME_MACHINE=i486 ;; + *Pentium) UNAME_MACHINE=i586 ;; +@@ -1048,13 +1075,13 @@ EOF + exit ;; + pc:*:*:*) + # Left here for compatibility: +- # uname -m prints for DJGPP always 'pc', but it prints nothing about +- # the processor, so we play safe by assuming i586. ++ # uname -m prints for DJGPP always 'pc', but it prints nothing about ++ # the processor, so we play safe by assuming i586. + # Note: whatever this is, it MUST be the same as what config.sub + # prints for the "djgpp" host, or else GDB configury will decide that + # this is a cross-build. + echo i586-pc-msdosdjgpp +- exit ;; ++ exit ;; + Intel:Mach:3*:*) + echo i386-pc-mach3 + exit ;; +@@ -1089,8 +1116,8 @@ EOF + /bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \ + && { echo i586-ncr-sysv4.3${OS_REL}; exit; } ;; + 3[34]??:*:4.0:* | 3[34]??,*:*:4.0:*) +- /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ +- && { echo i486-ncr-sysv4; exit; } ;; ++ /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ ++ && { echo i486-ncr-sysv4; exit; } ;; + NCR*:*:4.2:* | MPRAS*:*:4.2:*) + OS_REL='.3' + test -r /etc/.relid \ +@@ -1133,10 +1160,10 @@ EOF + echo ns32k-sni-sysv + fi + exit ;; +- PENTIUM:*:4.0*:*) # Unisys `ClearPath HMP IX 4000' SVR4/MP effort +- # says +- echo i586-unisys-sysv4 +- exit ;; ++ PENTIUM:*:4.0*:*) # Unisys `ClearPath HMP IX 4000' SVR4/MP effort ++ # says ++ echo i586-unisys-sysv4 ++ exit ;; + *:UNIX_System_V:4*:FTX*) + # From Gerald Hewes . + # How about differentiating between stratus architectures? -djm +@@ -1162,11 +1189,11 @@ EOF + exit ;; + R[34]000:*System_V*:*:* | R4000:UNIX_SYSV:*:* | R*000:UNIX_SV:*:*) + if [ -d /usr/nec ]; then +- echo mips-nec-sysv${UNAME_RELEASE} ++ echo mips-nec-sysv${UNAME_RELEASE} + else +- echo mips-unknown-sysv${UNAME_RELEASE} ++ echo mips-unknown-sysv${UNAME_RELEASE} + fi +- exit ;; ++ exit ;; + BeBox:BeOS:*:*) # BeOS running on hardware made by Be, PPC only. + echo powerpc-be-beos + exit ;; +@@ -1179,6 +1206,9 @@ EOF + BePC:Haiku:*:*) # Haiku running on Intel PC compatible. + echo i586-pc-haiku + exit ;; ++ x86_64:Haiku:*:*) ++ echo x86_64-unknown-haiku ++ exit ;; + SX-4:SUPER-UX:*:*) + echo sx4-nec-superux${UNAME_RELEASE} + exit ;; +@@ -1231,7 +1261,10 @@ EOF + *:QNX:*:4*) + echo i386-pc-qnx + exit ;; +- NSE-?:NONSTOP_KERNEL:*:*) ++ NEO-?:NONSTOP_KERNEL:*:*) ++ echo neo-tandem-nsk${UNAME_RELEASE} ++ exit ;; ++ NSE-*:NONSTOP_KERNEL:*:*) + echo nse-tandem-nsk${UNAME_RELEASE} + exit ;; + NSR-?:NONSTOP_KERNEL:*:*) +@@ -1276,13 +1309,13 @@ EOF + echo pdp10-unknown-its + exit ;; + SEI:*:*:SEIUX) +- echo mips-sei-seiux${UNAME_RELEASE} ++ echo mips-sei-seiux${UNAME_RELEASE} + exit ;; + *:DragonFly:*:*) + echo ${UNAME_MACHINE}-unknown-dragonfly`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` + exit ;; + *:*VMS:*:*) +- UNAME_MACHINE=`(uname -p) 2>/dev/null` ++ UNAME_MACHINE=`(uname -p) 2>/dev/null` + case "${UNAME_MACHINE}" in + A*) echo alpha-dec-vms ; exit ;; + I*) echo ia64-dec-vms ; exit ;; +@@ -1300,11 +1333,11 @@ EOF + i*86:AROS:*:*) + echo ${UNAME_MACHINE}-pc-aros + exit ;; ++ x86_64:VMkernel:*:*) ++ echo ${UNAME_MACHINE}-unknown-esx ++ exit ;; + esac + +-#echo '(No uname command or uname output not recognized.)' 1>&2 +-#echo "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" 1>&2 +- + eval $set_cc_for_build + cat >$dummy.c < + printf ("m68k-sony-newsos%s\n", + #ifdef NEWSOS4 +- "4" ++ "4" + #else +- "" ++ "" + #endif +- ); exit (0); ++ ); exit (0); + #endif + #endif + +diff --git a/build-aux/config.sub b/build-aux/config.sub +index c2d1257..52f04bc 100755 +--- a/build-aux/config.sub ++++ b/build-aux/config.sub +@@ -1,38 +1,33 @@ + #! /bin/sh + # Configuration validation subroutine script. + # Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, +-# 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010 +-# Free Software Foundation, Inc. ++# 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, ++# 2011, 2012, 2013 Free Software Foundation, Inc. + +-timestamp='2010-01-22' ++timestamp='2012-12-29' + +-# This file is (in principle) common to ALL GNU software. +-# The presence of a machine in this file suggests that SOME GNU software +-# can handle that machine. It does not imply ALL GNU software can. +-# +-# This file is free software; you can redistribute it and/or modify +-# it under the terms of the GNU General Public License as published by +-# the Free Software Foundation; either version 2 of the License, or ++# This file is free software; you can redistribute it and/or modify it ++# under the terms of the GNU General Public License as published by ++# the Free Software Foundation; either version 3 of the License, or + # (at your option) any later version. + # +-# This program is distributed in the hope that it will be useful, +-# but WITHOUT ANY WARRANTY; without even the implied warranty of +-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +-# GNU General Public License for more details. ++# This program is distributed in the hope that it will be useful, but ++# WITHOUT ANY WARRANTY; without even the implied warranty of ++# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ++# General Public License for more details. + # + # You should have received a copy of the GNU General Public License +-# along with this program; if not, write to the Free Software +-# Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA +-# 02110-1301, USA. ++# along with this program; if not, see . + # + # As a special exception to the GNU General Public License, if you + # distribute this file as part of a program that contains a + # configuration script generated by Autoconf, you may include it under +-# the same distribution terms that you use for the rest of that program. ++# the same distribution terms that you use for the rest of that ++# program. This Exception is an additional permission under section 7 ++# of the GNU General Public License, version 3 ("GPLv3"). + + +-# Please send patches to . Submit a context +-# diff and a properly formatted GNU ChangeLog entry. ++# Please send patches with a ChangeLog entry to config-patches@gnu.org. + # + # Configuration subroutine to validate and canonicalize a configuration type. + # Supply the specified configuration type as an argument. +@@ -76,8 +71,8 @@ version="\ + GNU config.sub ($timestamp) + + Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, +-2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010 Free +-Software Foundation, Inc. ++2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, ++2012, 2013 Free Software Foundation, Inc. + + This is free software; see the source for copying conditions. There is NO + warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE." +@@ -124,13 +119,18 @@ esac + # Here we must recognize all the valid KERNEL-OS combinations. + maybe_os=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\2/'` + case $maybe_os in +- nto-qnx* | linux-gnu* | linux-dietlibc | linux-newlib* | linux-uclibc* | \ +- uclinux-uclibc* | uclinux-gnu* | kfreebsd*-gnu* | knetbsd*-gnu* | netbsd*-gnu* | \ ++ nto-qnx* | linux-gnu* | linux-android* | linux-dietlibc | linux-newlib* | \ ++ linux-musl* | linux-uclibc* | uclinux-uclibc* | uclinux-gnu* | kfreebsd*-gnu* | \ ++ knetbsd*-gnu* | netbsd*-gnu* | \ + kopensolaris*-gnu* | \ + storm-chaos* | os2-emx* | rtmk-nova*) + os=-$maybe_os + basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'` + ;; ++ android-linux) ++ os=-linux-android ++ basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'`-unknown ++ ;; + *) + basic_machine=`echo $1 | sed 's/-[^-]*$//'` + if [ $basic_machine != $1 ] +@@ -153,12 +153,12 @@ case $os in + -convergent* | -ncr* | -news | -32* | -3600* | -3100* | -hitachi* |\ + -c[123]* | -convex* | -sun | -crds | -omron* | -dg | -ultra | -tti* | \ + -harris | -dolphin | -highlevel | -gould | -cbm | -ns | -masscomp | \ +- -apple | -axis | -knuth | -cray | -microblaze) ++ -apple | -axis | -knuth | -cray | -microblaze*) + os= + basic_machine=$1 + ;; +- -bluegene*) +- os=-cnk ++ -bluegene*) ++ os=-cnk + ;; + -sim | -cisco | -oki | -wec | -winbond) + os= +@@ -174,10 +174,10 @@ case $os in + os=-chorusos + basic_machine=$1 + ;; +- -chorusrdb) +- os=-chorusrdb ++ -chorusrdb) ++ os=-chorusrdb + basic_machine=$1 +- ;; ++ ;; + -hiux*) + os=-hiuxwe2 + ;; +@@ -222,6 +222,12 @@ case $os in + -isc*) + basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` + ;; ++ -lynx*178) ++ os=-lynxos178 ++ ;; ++ -lynx*5) ++ os=-lynxos5 ++ ;; + -lynx*) + os=-lynxos + ;; +@@ -246,20 +252,27 @@ case $basic_machine in + # Some are omitted here because they have special meanings below. + 1750a | 580 \ + | a29k \ ++ | aarch64 | aarch64_be \ + | alpha | alphaev[4-8] | alphaev56 | alphaev6[78] | alphapca5[67] \ + | alpha64 | alpha64ev[4-8] | alpha64ev56 | alpha64ev6[78] | alpha64pca5[67] \ + | am33_2.0 \ +- | arc | arm | arm[bl]e | arme[lb] | armv[2345] | armv[345][lb] | avr | avr32 \ ++ | arc \ ++ | arm | arm[bl]e | arme[lb] | armv[2-8] | armv[3-8][lb] | armv7[arm] \ ++ | avr | avr32 \ ++ | be32 | be64 \ + | bfin \ + | c4x | clipper \ + | d10v | d30v | dlx | dsp16xx \ ++ | epiphany \ + | fido | fr30 | frv \ + | h8300 | h8500 | hppa | hppa1.[01] | hppa2.0 | hppa2.0[nw] | hppa64 \ ++ | hexagon \ + | i370 | i860 | i960 | ia64 \ + | ip2k | iq2000 \ ++ | le32 | le64 \ + | lm32 \ + | m32c | m32r | m32rle | m68000 | m68k | m88k \ +- | maxq | mb | microblaze | mcore | mep | metag \ ++ | maxq | mb | microblaze | microblazeel | mcore | mep | metag \ + | mips | mipsbe | mipseb | mipsel | mipsle \ + | mips16 \ + | mips64 | mips64el \ +@@ -282,29 +295,39 @@ case $basic_machine in + | moxie \ + | mt \ + | msp430 \ ++ | nds32 | nds32le | nds32be \ + | nios | nios2 \ + | ns16k | ns32k \ ++ | open8 \ + | or32 \ + | pdp10 | pdp11 | pj | pjl \ +- | powerpc | powerpc64 | powerpc64le | powerpcle | ppcbe \ ++ | powerpc | powerpc64 | powerpc64le | powerpcle \ + | pyramid \ +- | rx \ ++ | rl78 | rx \ + | score \ + | sh | sh[1234] | sh[24]a | sh[24]aeb | sh[23]e | sh[34]eb | sheb | shbe | shle | sh[1234]le | sh3ele \ + | sh64 | sh64le \ + | sparc | sparc64 | sparc64b | sparc64v | sparc86x | sparclet | sparclite \ + | sparcv8 | sparcv9 | sparcv9b | sparcv9v \ +- | spu | strongarm \ +- | tahoe | thumb | tic4x | tic80 | tron \ ++ | spu \ ++ | tahoe | tic4x | tic54x | tic55x | tic6x | tic80 | tron \ + | ubicom32 \ +- | v850 | v850e \ ++ | v850 | v850e | v850e1 | v850e2 | v850es | v850e2v3 \ + | we32k \ +- | x86 | xc16x | xscale | xscalee[bl] | xstormy16 | xtensa \ ++ | x86 | xc16x | xstormy16 | xtensa \ + | z8k | z80) + basic_machine=$basic_machine-unknown + ;; +- m6811 | m68hc11 | m6812 | m68hc12 | picochip) +- # Motorola 68HC11/12. ++ c54x) ++ basic_machine=tic54x-unknown ++ ;; ++ c55x) ++ basic_machine=tic55x-unknown ++ ;; ++ c6x) ++ basic_machine=tic6x-unknown ++ ;; ++ m6811 | m68hc11 | m6812 | m68hc12 | m68hcs12x | picochip) + basic_machine=$basic_machine-unknown + os=-none + ;; +@@ -314,6 +337,21 @@ case $basic_machine in + basic_machine=mt-unknown + ;; + ++ strongarm | thumb | xscale) ++ basic_machine=arm-unknown ++ ;; ++ xgate) ++ basic_machine=$basic_machine-unknown ++ os=-none ++ ;; ++ xscaleeb) ++ basic_machine=armeb-unknown ++ ;; ++ ++ xscaleel) ++ basic_machine=armel-unknown ++ ;; ++ + # We use `pc' rather than `unknown' + # because (1) that's what they normally are, and + # (2) the word "unknown" tends to confuse beginning users. +@@ -328,25 +366,30 @@ case $basic_machine in + # Recognize the basic CPU types with company name. + 580-* \ + | a29k-* \ ++ | aarch64-* | aarch64_be-* \ + | alpha-* | alphaev[4-8]-* | alphaev56-* | alphaev6[78]-* \ + | alpha64-* | alpha64ev[4-8]-* | alpha64ev56-* | alpha64ev6[78]-* \ + | alphapca5[67]-* | alpha64pca5[67]-* | arc-* \ + | arm-* | armbe-* | armle-* | armeb-* | armv*-* \ + | avr-* | avr32-* \ ++ | be32-* | be64-* \ + | bfin-* | bs2000-* \ +- | c[123]* | c30-* | [cjt]90-* | c4x-* | c54x-* | c55x-* | c6x-* \ ++ | c[123]* | c30-* | [cjt]90-* | c4x-* \ + | clipper-* | craynv-* | cydra-* \ + | d10v-* | d30v-* | dlx-* \ + | elxsi-* \ + | f30[01]-* | f700-* | fido-* | fr30-* | frv-* | fx80-* \ + | h8300-* | h8500-* \ + | hppa-* | hppa1.[01]-* | hppa2.0-* | hppa2.0[nw]-* | hppa64-* \ ++ | hexagon-* \ + | i*86-* | i860-* | i960-* | ia64-* \ + | ip2k-* | iq2000-* \ ++ | le32-* | le64-* \ + | lm32-* \ + | m32c-* | m32r-* | m32rle-* \ + | m68000-* | m680[012346]0-* | m68360-* | m683?2-* | m68k-* \ +- | m88110-* | m88k-* | maxq-* | mcore-* | metag-* | microblaze-* \ ++ | m88110-* | m88k-* | maxq-* | mcore-* | metag-* \ ++ | microblaze-* | microblazeel-* \ + | mips-* | mipsbe-* | mipseb-* | mipsel-* | mipsle-* \ + | mips16-* \ + | mips64-* | mips64el-* \ +@@ -368,26 +411,29 @@ case $basic_machine in + | mmix-* \ + | mt-* \ + | msp430-* \ ++ | nds32-* | nds32le-* | nds32be-* \ + | nios-* | nios2-* \ + | none-* | np1-* | ns16k-* | ns32k-* \ ++ | open8-* \ + | orion-* \ + | pdp10-* | pdp11-* | pj-* | pjl-* | pn-* | power-* \ +- | powerpc-* | powerpc64-* | powerpc64le-* | powerpcle-* | ppcbe-* \ ++ | powerpc-* | powerpc64-* | powerpc64le-* | powerpcle-* \ + | pyramid-* \ +- | romp-* | rs6000-* | rx-* \ ++ | rl78-* | romp-* | rs6000-* | rx-* \ + | sh-* | sh[1234]-* | sh[24]a-* | sh[24]aeb-* | sh[23]e-* | sh[34]eb-* | sheb-* | shbe-* \ + | shle-* | sh[1234]le-* | sh3ele-* | sh64-* | sh64le-* \ + | sparc-* | sparc64-* | sparc64b-* | sparc64v-* | sparc86x-* | sparclet-* \ + | sparclite-* \ +- | sparcv8-* | sparcv9-* | sparcv9b-* | sparcv9v-* | strongarm-* | sv1-* | sx?-* \ +- | tahoe-* | thumb-* \ ++ | sparcv8-* | sparcv9-* | sparcv9b-* | sparcv9v-* | sv1-* | sx?-* \ ++ | tahoe-* \ + | tic30-* | tic4x-* | tic54x-* | tic55x-* | tic6x-* | tic80-* \ +- | tile-* | tilegx-* \ ++ | tile*-* \ + | tron-* \ + | ubicom32-* \ +- | v850-* | v850e-* | vax-* \ ++ | v850-* | v850e-* | v850e1-* | v850es-* | v850e2-* | v850e2v3-* \ ++ | vax-* \ + | we32k-* \ +- | x86-* | x86_64-* | xc16x-* | xps100-* | xscale-* | xscalee[bl]-* \ ++ | x86-* | x86_64-* | xc16x-* | xps100-* \ + | xstormy16-* | xtensa*-* \ + | ymp-* \ + | z8k-* | z80-*) +@@ -412,7 +458,7 @@ case $basic_machine in + basic_machine=a29k-amd + os=-udi + ;; +- abacus) ++ abacus) + basic_machine=abacus-unknown + ;; + adobe68k) +@@ -482,11 +528,20 @@ case $basic_machine in + basic_machine=powerpc-ibm + os=-cnk + ;; ++ c54x-*) ++ basic_machine=tic54x-`echo $basic_machine | sed 's/^[^-]*-//'` ++ ;; ++ c55x-*) ++ basic_machine=tic55x-`echo $basic_machine | sed 's/^[^-]*-//'` ++ ;; ++ c6x-*) ++ basic_machine=tic6x-`echo $basic_machine | sed 's/^[^-]*-//'` ++ ;; + c90) + basic_machine=c90-cray + os=-unicos + ;; +- cegcc) ++ cegcc) + basic_machine=arm-unknown + os=-cegcc + ;; +@@ -518,7 +573,7 @@ case $basic_machine in + basic_machine=craynv-cray + os=-unicosmp + ;; +- cr16) ++ cr16 | cr16-*) + basic_machine=cr16-unknown + os=-elf + ;; +@@ -676,7 +731,6 @@ case $basic_machine in + i370-ibm* | ibm*) + basic_machine=i370-ibm + ;; +-# I'm not sure what "Sysv32" means. Should this be sysv3.2? + i*86v32) + basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` + os=-sysv32 +@@ -734,9 +788,13 @@ case $basic_machine in + basic_machine=ns32k-utek + os=-sysv + ;; +- microblaze) ++ microblaze*) + basic_machine=microblaze-xilinx + ;; ++ mingw64) ++ basic_machine=x86_64-pc ++ os=-mingw64 ++ ;; + mingw32) + basic_machine=i386-pc + os=-mingw32 +@@ -773,10 +831,18 @@ case $basic_machine in + ms1-*) + basic_machine=`echo $basic_machine | sed -e 's/ms1-/mt-/'` + ;; ++ msys) ++ basic_machine=i386-pc ++ os=-msys ++ ;; + mvs) + basic_machine=i370-ibm + os=-mvs + ;; ++ nacl) ++ basic_machine=le32-unknown ++ os=-nacl ++ ;; + ncr3000) + basic_machine=i486-ncr + os=-sysv4 +@@ -841,6 +907,12 @@ case $basic_machine in + np1) + basic_machine=np1-gould + ;; ++ neo-tandem) ++ basic_machine=neo-tandem ++ ;; ++ nse-tandem) ++ basic_machine=nse-tandem ++ ;; + nsr-tandem) + basic_machine=nsr-tandem + ;; +@@ -923,9 +995,10 @@ case $basic_machine in + ;; + power) basic_machine=power-ibm + ;; +- ppc) basic_machine=powerpc-unknown ++ ppc | ppcbe) basic_machine=powerpc-unknown + ;; +- ppc-*) basic_machine=powerpc-`echo $basic_machine | sed 's/^[^-]*-//'` ++ ppc-* | ppcbe-*) ++ basic_machine=powerpc-`echo $basic_machine | sed 's/^[^-]*-//'` + ;; + ppcle | powerpclittle | ppc-le | powerpc-little) + basic_machine=powerpcle-unknown +@@ -935,7 +1008,7 @@ case $basic_machine in + ;; + ppc64) basic_machine=powerpc64-unknown + ;; +- ppc64-*) basic_machine=powerpc64-`echo $basic_machine | sed 's/^[^-]*-//'` ++ ppc64-* | ppc64p7-*) basic_machine=powerpc64-`echo $basic_machine | sed 's/^[^-]*-//'` + ;; + ppc64le | powerpc64little | ppc64-le | powerpc64-little) + basic_machine=powerpc64le-unknown +@@ -950,7 +1023,11 @@ case $basic_machine in + basic_machine=i586-unknown + os=-pw32 + ;; +- rdos) ++ rdos | rdos64) ++ basic_machine=x86_64-pc ++ os=-rdos ++ ;; ++ rdos32) + basic_machine=i386-pc + os=-rdos + ;; +@@ -1019,6 +1096,9 @@ case $basic_machine in + basic_machine=i860-stratus + os=-sysv4 + ;; ++ strongarm-* | thumb-*) ++ basic_machine=arm-`echo $basic_machine | sed 's/^[^-]*-//'` ++ ;; + sun2) + basic_machine=m68000-sun + ;; +@@ -1075,25 +1155,8 @@ case $basic_machine in + basic_machine=t90-cray + os=-unicos + ;; +- tic54x | c54x*) +- basic_machine=tic54x-unknown +- os=-coff +- ;; +- tic55x | c55x*) +- basic_machine=tic55x-unknown +- os=-coff +- ;; +- tic6x | c6x*) +- basic_machine=tic6x-unknown +- os=-coff +- ;; +- # This must be matched before tile*. +- tilegx*) +- basic_machine=tilegx-unknown +- os=-linux-gnu +- ;; + tile*) +- basic_machine=tile-unknown ++ basic_machine=$basic_machine-unknown + os=-linux-gnu + ;; + tx39) +@@ -1163,6 +1226,9 @@ case $basic_machine in + xps | xps100) + basic_machine=xps100-honeywell + ;; ++ xscale-* | xscalee[bl]-*) ++ basic_machine=`echo $basic_machine | sed 's/^xscale/arm/'` ++ ;; + ymp) + basic_machine=ymp-cray + os=-unicos +@@ -1260,11 +1326,11 @@ esac + if [ x"$os" != x"" ] + then + case $os in +- # First match some system type aliases +- # that might get confused with valid system types. ++ # First match some system type aliases ++ # that might get confused with valid system types. + # -solaris* is a basic system type, with this one exception. +- -auroraux) +- os=-auroraux ++ -auroraux) ++ os=-auroraux + ;; + -solaris1 | -solaris1.*) + os=`echo $os | sed -e 's|solaris1|sunos4|'` +@@ -1294,14 +1360,15 @@ case $os in + | -nindy* | -vxsim* | -vxworks* | -ebmon* | -hms* | -mvs* \ + | -clix* | -riscos* | -uniplus* | -iris* | -rtu* | -xenix* \ + | -hiux* | -386bsd* | -knetbsd* | -mirbsd* | -netbsd* \ +- | -openbsd* | -solidbsd* \ ++ | -bitrig* | -openbsd* | -solidbsd* \ + | -ekkobsd* | -kfreebsd* | -freebsd* | -riscix* | -lynxos* \ + | -bosx* | -nextstep* | -cxux* | -aout* | -elf* | -oabi* \ + | -ptx* | -coff* | -ecoff* | -winnt* | -domain* | -vsta* \ + | -udi* | -eabi* | -lites* | -ieee* | -go32* | -aux* \ + | -chorusos* | -chorusrdb* | -cegcc* \ +- | -cygwin* | -pe* | -psos* | -moss* | -proelf* | -rtems* \ +- | -mingw32* | -linux-gnu* | -linux-newlib* | -linux-uclibc* \ ++ | -cygwin* | -msys* | -pe* | -psos* | -moss* | -proelf* | -rtems* \ ++ | -mingw32* | -mingw64* | -linux-gnu* | -linux-android* \ ++ | -linux-newlib* | -linux-musl* | -linux-uclibc* \ + | -uxpv* | -beos* | -mpeix* | -udk* \ + | -interix* | -uwin* | -mks* | -rhapsody* | -darwin* | -opened* \ + | -openstep* | -oskit* | -conix* | -pw32* | -nonstopux* \ +@@ -1348,7 +1415,7 @@ case $os in + -opened*) + os=-openedition + ;; +- -os400*) ++ -os400*) + os=-os400 + ;; + -wince*) +@@ -1397,7 +1464,7 @@ case $os in + -sinix*) + os=-sysv4 + ;; +- -tpf*) ++ -tpf*) + os=-tpf + ;; + -triton*) +@@ -1442,8 +1509,8 @@ case $os in + -dicos*) + os=-dicos + ;; +- -nacl*) +- ;; ++ -nacl*) ++ ;; + -none) + ;; + *) +@@ -1466,10 +1533,10 @@ else + # system, and we'll never get to this point. + + case $basic_machine in +- score-*) ++ score-*) + os=-elf + ;; +- spu-*) ++ spu-*) + os=-elf + ;; + *-acorn) +@@ -1481,8 +1548,20 @@ case $basic_machine in + arm*-semi) + os=-aout + ;; +- c4x-* | tic4x-*) +- os=-coff ++ c4x-* | tic4x-*) ++ os=-coff ++ ;; ++ hexagon-*) ++ os=-elf ++ ;; ++ tic54x-*) ++ os=-coff ++ ;; ++ tic55x-*) ++ os=-coff ++ ;; ++ tic6x-*) ++ os=-coff + ;; + # This must come before the *-dec entry. + pdp10-*) +@@ -1502,14 +1581,11 @@ case $basic_machine in + ;; + m68000-sun) + os=-sunos3 +- # This also exists in the configure program, but was not the +- # default. +- # os=-sunos4 + ;; + m68*-cisco) + os=-aout + ;; +- mep-*) ++ mep-*) + os=-elf + ;; + mips*-cisco) +@@ -1536,7 +1612,7 @@ case $basic_machine in + *-ibm) + os=-aix + ;; +- *-knuth) ++ *-knuth) + os=-mmixware + ;; + *-wec) diff --git a/SOURCES/cpio-2.11-crc-big-files.patch b/SOURCES/cpio-2.11-crc-big-files.patch new file mode 100644 index 0000000..27d02e7 --- /dev/null +++ b/SOURCES/cpio-2.11-crc-big-files.patch @@ -0,0 +1,118 @@ +From 610e732bda06aef9ff3b16df757ddc32d8368a1a Mon Sep 17 00:00:00 2001 +From: Sergey Poznyakoff +Date: Mon, 20 Feb 2012 19:51:27 +0200 +Subject: [PATCH] Always use 32 bit CRC + +* src/cpiohdr.h (cpio_file_stat) : Change type to +uint32_t. +* src/extern.h (crc): Change type to uint32_t. +* src/global.c: Likewise. +* src/copyout.c (read_for_checksum): Return uint32_t. +* src/copyin.c: Fix printf formats. +--- + src/copyin.c | 8 ++++---- + src/copyout.c | 4 ++-- + src/cpiohdr.h | 2 +- + src/extern.h | 2 +- + src/global.c | 2 +- + 5 files changed, 9 insertions(+), 9 deletions(-) + +diff --git a/src/copyin.c b/src/copyin.c +index 29d0fb1..db8ee66 100644 +--- a/src/copyin.c ++++ b/src/copyin.c +@@ -193,7 +193,7 @@ list_file (struct cpio_file_stat* file_hdr, int in_file_des) + #endif + if (crc != file_hdr->c_chksum) + { +- error (0, 0, _("%s: checksum error (0x%lx, should be 0x%lx)"), ++ error (0, 0, _("%s: checksum error (0x%x, should be 0x%x)"), + file_hdr->c_name, crc, file_hdr->c_chksum); + } + } +@@ -540,7 +540,7 @@ copyin_regular_file (struct cpio_file_stat* file_hdr, int in_file_des) + if (archive_format == arf_crcascii) + { + if (crc != file_hdr->c_chksum) +- error (0, 0, _("%s: checksum error (0x%lx, should be 0x%lx)"), ++ error (0, 0, _("%s: checksum error (0x%x, should be 0x%x)"), + file_hdr->c_name, crc, file_hdr->c_chksum); + } + tape_skip_padding (in_file_des, file_hdr->c_filesize); +@@ -565,7 +565,7 @@ copyin_regular_file (struct cpio_file_stat* file_hdr, int in_file_des) + if (archive_format == arf_crcascii) + { + if (crc != file_hdr->c_chksum) +- error (0, 0, _("%s: checksum error (0x%lx, should be 0x%lx)"), ++ error (0, 0, _("%s: checksum error (0x%x, should be 0x%x)"), + file_hdr->c_name, crc, file_hdr->c_chksum); + } + +@@ -1454,7 +1454,7 @@ process_copy_in () + tape_skip_padding (in_file_des, file_hdr.c_filesize); + if (crc != file_hdr.c_chksum) + { +- error (0, 0, _("%s: checksum error (0x%lx, should be 0x%lx)"), ++ error (0, 0, _("%s: checksum error (0x%x, should be 0x%x)"), + file_hdr.c_name, crc, file_hdr.c_chksum); + } + /* Debian hack: -v and -V now work with --only-verify-crc. +diff --git a/src/copyout.c b/src/copyout.c +index 72f1989..03eaf88 100644 +--- a/src/copyout.c ++++ b/src/copyout.c +@@ -33,10 +33,10 @@ + /* Read FILE_SIZE bytes of FILE_NAME from IN_FILE_DES and + compute and return a checksum for them. */ + +-static unsigned long ++static uint32_t + read_for_checksum (int in_file_des, int file_size, char *file_name) + { +- unsigned long crc; ++ uint32_t crc; + char buf[BUFSIZ]; + int bytes_left; + int bytes_read; +diff --git a/src/cpiohdr.h b/src/cpiohdr.h +index bb1ad6b..1c11998 100644 +--- a/src/cpiohdr.h ++++ b/src/cpiohdr.h +@@ -123,7 +123,7 @@ struct cpio_file_stat /* Internal representation of a CPIO header */ + long c_rdev_maj; + long c_rdev_min; + size_t c_namesize; +- unsigned long c_chksum; ++ uint32_t c_chksum; + char *c_name; + char *c_tar_linkname; + }; +diff --git a/src/extern.h b/src/extern.h +index 4f94d40..3530bf6 100644 +--- a/src/extern.h ++++ b/src/extern.h +@@ -75,7 +75,7 @@ extern char *new_media_message_after_number; + extern int archive_des; + extern char *archive_name; + extern char *rsh_command_option; +-extern unsigned long crc; ++extern uint32_t crc; + extern int delayed_seek_count; + #ifdef DEBUG_CPIO + extern int debug_flag; +diff --git a/src/global.c b/src/global.c +index cff9720..336941e 100644 +--- a/src/global.c ++++ b/src/global.c +@@ -144,7 +144,7 @@ char *archive_name = NULL; + char *rsh_command_option = NULL; + + /* CRC checksum. */ +-unsigned long crc; ++uint32_t crc; + + /* Input and output buffers. */ + char *input_buffer, *output_buffer; +-- +2.9.3 + diff --git a/SOURCES/cpio-2.11-crc-fips-nit.patch b/SOURCES/cpio-2.11-crc-fips-nit.patch new file mode 100644 index 0000000..56efa35 --- /dev/null +++ b/SOURCES/cpio-2.11-crc-fips-nit.patch @@ -0,0 +1,13 @@ +diff --git a/src/main.c b/src/main.c +index 38fb3eb..9b9bf74 100644 +--- a/src/main.c ++++ b/src/main.c +@@ -151,7 +151,7 @@ static struct argp_option options[] = { + {"pattern-file", 'E', N_("FILE"), 0, + N_("Read additional patterns specifying filenames to extract or list from FILE"), 210}, + {"only-verify-crc", ONLY_VERIFY_CRC_OPTION, 0, 0, +- N_("When reading a CRC format archive, only verify the CRC's of each file in the archive, don't actually extract the files"), 210}, ++ N_("When reading a CRC format archive, only verify the checksum of each file in the archive, don't actually extract the files"), 210}, + {"rename", 'r', 0, 0, + N_("Interactively rename files"), GRID+1 }, + {"rename-batch-file", RENAME_BATCH_FILE_OPTION, N_("FILE"), OPTION_HIDDEN, diff --git a/SOURCES/cpio-2.11-recovery.patch b/SOURCES/cpio-2.11-recovery.patch new file mode 100644 index 0000000..1109bba --- /dev/null +++ b/SOURCES/cpio-2.11-recovery.patch @@ -0,0 +1,104 @@ +From 5e1e4fae6a9eab069866eb46b2f91d60fae34efe Mon Sep 17 00:00:00 2001 +From: Sergey Poznyakoff +Date: Thu, 11 Dec 2014 12:51:21 +0200 +Subject: [PATCH] Fix error recovery in copy-in mode + +(+ complete sync of symlink-bad-length.at test) + +* src/copyin.c (copyin_link): Fix null dereference. +(read_in_header): Fix error recovery (bug introduced by +27e0ae55). +* tests/symlink-bad-length.at: Test error recovery. +Catch various architecture-dependent error messages (suggested +by Pavel Raiskup). +--- + src/copyin.c | 10 ++++++---- + tests/symlink-bad-length.at | 16 ++++++++++++---- + 2 files changed, 18 insertions(+), 8 deletions(-) + +diff --git a/src/copyin.c b/src/copyin.c +index 29d0fb1..274bd49 100644 +--- a/src/copyin.c ++++ b/src/copyin.c +@@ -655,7 +655,7 @@ copyin_device (struct cpio_file_stat* file_hdr) + } + + static void +-copyin_link(struct cpio_file_stat *file_hdr, int in_file_des) ++copyin_link (struct cpio_file_stat *file_hdr, int in_file_des) + { + char *link_name = NULL; /* Name of hard and symbolic links. */ + int res; /* Result of various function calls. */ +@@ -666,6 +666,8 @@ copyin_link(struct cpio_file_stat *file_hdr, int in_file_des) + if (archive_format != arf_tar && archive_format != arf_ustar) + { + link_name = get_link_name (file_hdr, in_file_des); ++ if (!link_name) ++ return; + } + else + { +@@ -1020,7 +1022,7 @@ read_in_header (struct cpio_file_stat *file_hdr, int in_des) + + file_hdr->c_tar_linkname = NULL; + +- tape_buffered_read (magic.str, in_des, 6L); ++ tape_buffered_read (magic.str, in_des, sizeof (magic.str)); + while (1) + { + if (append_flag) +@@ -1065,8 +1067,8 @@ read_in_header (struct cpio_file_stat *file_hdr, int in_des) + break; + } + bytes_skipped++; +- memmove (magic.str, magic.str + 1, 5); +- tape_buffered_read (magic.str, in_des, 1L); ++ memmove (magic.str, magic.str + 1, sizeof (magic.str) - 1); ++ tape_buffered_read (magic.str + sizeof (magic.str) - 1, in_des, 1L); + } + } + +diff --git a/tests/symlink-bad-length.at b/tests/symlink-bad-length.at +index 84123a4..fd2c87e 100644 +--- a/tests/symlink-bad-length.at ++++ b/tests/symlink-bad-length.at +@@ -1,5 +1,5 @@ + # Process this file with autom4te to create testsuite. -*- Autotest -*- +-# Copyright (C) 2014 Free Software Foundation, Inc. ++# Copyright (C) 2014-2015, 2017 Free Software Foundation, Inc. + + # This program is free software; you can redistribute it and/or modify + # it under the terms of the GNU General Public License as published by +@@ -35,18 +35,26 @@ AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA= + ]) + ++# The exact error message and exit status depend on the host architecture, ++# therefore strderr is filtered out and error code is not checked. ++ ++# So far the only case when cpio would exit with code 0 is when it skips ++# several bytes and encounters a valid record header. Perhaps it should ++# exit with code 2 (non-critical error), if at least one byte was skipped, ++# but that could hurt backward compatibility. ++ + AT_CHECK([ + base64 -d ARCHIVE.base64 > ARCHIVE || AT_SKIP_TEST +-TZ=UTC cpio -ntv < ARCHIVE 2>stderr +-rc=$? ++TZ=UTC cpio -ntv < ARCHIVE 2>stderr + cat stderr | grep -v \ + -e 'stored filename length is out of range' \ + -e 'premature end of file' \ + -e 'archive header has reverse byte-order' \ + -e 'memory exhausted' \ ++ -e 'skipped [[0-9][0-9]*] bytes of junk' \ ++ -e '[[0-9][0-9]*] block' \ + >&2 + echo >&2 STDERR +-test "$rc" -ne 0 + ], + [0], + [-rw-rw-r-- 1 10029 10031 13 Nov 25 2014 FILE +-- +2.9.3 + diff --git a/SOURCES/cpio-2.11-reproducible.patch b/SOURCES/cpio-2.11-reproducible.patch new file mode 100644 index 0000000..705b772 --- /dev/null +++ b/SOURCES/cpio-2.11-reproducible.patch @@ -0,0 +1,395 @@ +From d249aaececed97d8ed78508ddec27fc73112601f Mon Sep 17 00:00:00 2001 +From: Sergey Poznyakoff +Date: Mon, 1 Dec 2014 15:02:38 +0200 +Subject: [PATCH 1/2] New options to create device and inode-independent + archives. + +* src/util.c (inode_val): New member trans_inode +(find_inode_val): New function. +(find_inode_file): Rewrite using the above. +(add_inode): Initialize the trans_inode member +depending on the value of renumber_inodes_option. +(get_inode_and_dev): New function. +(stat_to_cpio): Use get_inode_and_dev. +(arf_stores_inode_p): New function. +* src/extern.h (renumber_inodes_option) +(ignore_devno_option): New externs. +* src/global.c (renumber_inodes_option) +(ignore_devno_option): New variables. +* src/main.c: Add new options. + +* NEWS: Document changes. +* doc/cpio.1: Document new options. +* doc/cpio.texi: Likewise. +--- + NEWS | 14 +++++++++++ + doc/cpio.texi | 12 +++++++++ + src/extern.h | 8 ++++-- + src/global.c | 3 +++ + src/main.c | 34 +++++++++++++++++++++++-- + src/util.c | 81 +++++++++++++++++++++++++++++++++++++++++++++++++++-------- + 6 files changed, 138 insertions(+), 14 deletions(-) + +diff --git a/NEWS b/NEWS +index 1b068ba..c112d70 100644 +--- a/NEWS ++++ b/NEWS +@@ -5,6 +5,20 @@ See the end of file for copying conditions. + + Please send cpio bug reports to . + ++Downstream backports from newer versions ++* New options for copy-out mode: ++ ++** --ignore-devno ++Store 0 in the device number fields, instead of the actual device ++number. ++ ++** --renumber-inodes ++Renumber inodes when storing them in the archive. ++ ++** --device-independent or --reproducible ++Create reproducible archives. This is equivalent to ++--ignore-devno --renumber-inodes. ++ + Version 2.11 - Sergey Poznyakoff, 2010-03-10 + + * Fix mt build. +diff --git a/doc/cpio.texi b/doc/cpio.texi +index 1af808a..c9b62ee 100644 +--- a/doc/cpio.texi ++++ b/doc/cpio.texi +@@ -342,6 +342,11 @@ Set the I/O block size to @var{io-size} bytes. + @itemx --make-directories + Create leading directories where needed. + ++@item --device-independent ++@itemx --reproducible ++Create reproducible archives. This is equivalent to ++@option{--ignore-devno --renumber-inodes}. ++ + @item -E @var{file} + @itemx --pattern-file=@var{file} + Read additional patterns specifying filenames to extract or list from +@@ -419,6 +424,10 @@ of the remote host. The hostname can be preceded by a username and an @samp{@@} + access the remote tape drive as that user, if you have permission to do + so (typically an entry in that user's @file{~/.rhosts} file). + ++@item --ignore-devno ++Store 0 in the device number field of each archive member, instead of ++the actual device number. ++ + @item -k + Ignored; for compatibility with other versions of cpio. + +@@ -486,6 +495,9 @@ Do not print the number of blocks copied. + @itemx --rename + Interactively rename files. + ++@item --renumber-inodes ++Renumber inodes when storing them in the archive. ++ + @item -R @var{owner} + @itemx --owner @var{owner} + +diff --git a/src/extern.h b/src/extern.h +index 4f94d40..f3a6c47 100644 +--- a/src/extern.h ++++ b/src/extern.h +@@ -56,6 +56,8 @@ extern int only_verify_crc_flag; + extern int no_abs_paths_flag; + extern unsigned int warn_option; + extern mode_t newdir_umask; ++extern int renumber_inodes_option; ++extern int ignore_devno_option; + + /* Values for warn_option */ + #define CPIO_WARN_NONE 0 +@@ -171,8 +173,8 @@ void create_all_directories (char *name); + void prepare_append (int out_file_des); + char *find_inode_file (ino_t node_num, + unsigned long major_num, unsigned long minor_num); +-void add_inode (ino_t node_num, char *file_name, +- unsigned long major_num, unsigned long minor_num); ++struct inode_val *add_inode (ino_t node_num, char *file_name, ++ unsigned long major_num, unsigned long minor_num); + int open_archive (char *file); + void tape_offline (int tape_des); + void get_next_reel (int tape_des); +@@ -217,3 +219,5 @@ void delay_set_stat (char const *file_name, struct stat *st, + int repair_delayed_set_stat (struct cpio_file_stat *file_hdr); + void apply_delayed_set_stat (void); + ++int arf_stores_inode_p (enum archive_format arf); ++ +diff --git a/src/global.c b/src/global.c +index cff9720..fb074fb 100644 +--- a/src/global.c ++++ b/src/global.c +@@ -193,3 +193,6 @@ int (*xstat) (); + + /* Which copy operation to perform. (-i, -o, -p) */ + void (*copy_function) () = 0; ++ ++int renumber_inodes_option; ++int ignore_devno_option; +diff --git a/src/main.c b/src/main.c +index 9b9bf74..6945c7d 100644 +--- a/src/main.c ++++ b/src/main.c +@@ -57,7 +57,10 @@ enum cpio_options { + FORCE_LOCAL_OPTION, + DEBUG_OPTION, + BLOCK_SIZE_OPTION, +- TO_STDOUT_OPTION ++ TO_STDOUT_OPTION, ++ RENUMBER_INODES_OPTION, ++ IGNORE_DEVNO_OPTION, ++ DEVICE_INDEPENDENT_OPTION + }; + + const char *program_authors[] = +@@ -175,6 +178,13 @@ static struct argp_option options[] = { + N_("Append to an existing archive."), GRID+1 }, + {NULL, 'O', N_("[[USER@]HOST:]FILE-NAME"), 0, + N_("Archive filename to use instead of standard output. Optional USER and HOST specify the user and host names in case of a remote archive"), GRID+1 }, ++ {"renumber-inodes", RENUMBER_INODES_OPTION, NULL, 0, ++ N_("Renumber inodes") }, ++ {"ignore-devno", IGNORE_DEVNO_OPTION, NULL, 0, ++ N_("Don't store device numbers") }, ++ {"device-independent", DEVICE_INDEPENDENT_OPTION, NULL, 0, ++ N_("Create device-independent (reproducible) archives") }, ++ {"reproducible", 0, NULL, OPTION_ALIAS }, + #undef GRID + + /* ********** */ +@@ -432,7 +442,19 @@ crc newc odc bin ustar tar (all-caps also recognized)"), arg); + error (PAXEXIT_FAILURE, 0, _("Mode already defined")); + copy_function = process_copy_pass; + break; +- ++ ++ case IGNORE_DEVNO_OPTION: ++ ignore_devno_option = 1; ++ break; ++ ++ case RENUMBER_INODES_OPTION: ++ renumber_inodes_option = 1; ++ break; ++ ++ case DEVICE_INDEPENDENT_OPTION: ++ ignore_devno_option = renumber_inodes_option = 1; ++ break; ++ + case RSH_COMMAND_OPTION: + rsh_command_option = arg; + break; +@@ -575,6 +597,8 @@ process_args (int argc, char *argv[]) + CHECK_USAGE(xstat != lstat, "--dereference", "--extract"); + CHECK_USAGE(append_flag, "--append", "--extract"); + CHECK_USAGE(output_archive_name, "-O", "--extract"); ++ CHECK_USAGE (renumber_inodes_option, "--renumber-inodes", "--extract"); ++ CHECK_USAGE (ignore_devno_option, "--ignore-devno", "--extract"); + if (to_stdout_option) + { + CHECK_USAGE(create_dir_flag, "--make-directories", "--to-stdout"); +@@ -630,6 +654,9 @@ process_args (int argc, char *argv[]) + archive_format = arf_binary; + if (output_archive_name) + archive_name = output_archive_name; ++ ++ if (!arf_stores_inode_p (archive_format)) ++ renumber_inodes_option = ignore_devno_option = 0; + } + else + { +@@ -655,6 +682,9 @@ process_args (int argc, char *argv[]) + CHECK_USAGE(no_abs_paths_flag, "--absolute-pathnames", + "--pass-through"); + CHECK_USAGE(to_stdout_option, "--to-stdout", "--pass-through"); ++ CHECK_USAGE (renumber_inodes_option, "--renumber-inodes", ++ "--pass-through"); ++ CHECK_USAGE (ignore_devno_option, "--ignore-devno", "--pass-through"); + + directory_name = argv[index]; + } +diff --git a/src/util.c b/src/util.c +index 2a821c7..ce45842 100644 +--- a/src/util.c ++++ b/src/util.c +@@ -689,6 +689,7 @@ struct inode_val + ino_t inode; + unsigned long major_num; + unsigned long minor_num; ++ ino_t trans_inode; + char *file_name; + }; + +@@ -712,8 +713,8 @@ inode_val_compare (const void *val1, const void *val2) + && ival1->minor_num == ival2->minor_num; + } + +-char * +-find_inode_file (ino_t node_num, unsigned long major_num, ++static struct inode_val * ++find_inode_val (ino_t node_num, unsigned long major_num, + unsigned long minor_num) + { + struct inode_val sample; +@@ -725,32 +726,78 @@ find_inode_file (ino_t node_num, unsigned long major_num, + sample.inode = node_num; + sample.major_num = major_num; + sample.minor_num = minor_num; +- ival = hash_lookup (hash_table, &sample); ++ return hash_lookup (hash_table, &sample); ++} ++ ++char * ++find_inode_file (ino_t node_num, unsigned long major_num, ++ unsigned long minor_num) ++{ ++ struct inode_val *ival = find_inode_val (node_num, major_num, minor_num); + return ival ? ival->file_name : NULL; + } + + /* Associate FILE_NAME with the inode NODE_NUM. (Insert into hash table.) */ + +-void ++static ino_t next_inode; ++ ++struct inode_val * + add_inode (ino_t node_num, char *file_name, unsigned long major_num, + unsigned long minor_num) + { + struct inode_val *temp; +- struct inode_val *e; ++ struct inode_val *e = NULL; + + /* Create new inode record. */ + temp = (struct inode_val *) xmalloc (sizeof (struct inode_val)); + temp->inode = node_num; + temp->major_num = major_num; + temp->minor_num = minor_num; +- temp->file_name = xstrdup (file_name); ++ temp->file_name = file_name ? xstrdup (file_name) : NULL; ++ ++ if (renumber_inodes_option) ++ temp->trans_inode = next_inode++; ++ else ++ temp->trans_inode = temp->inode; + + if (!((hash_table + || (hash_table = hash_initialize (0, 0, inode_val_hasher, + inode_val_compare, 0))) + && (e = hash_insert (hash_table, temp)))) + xalloc_die (); +- /* FIXME: e is not used */ ++ return e; ++} ++ ++static ino_t ++get_inode_and_dev (struct cpio_file_stat *hdr, struct stat *st) ++{ ++ if (renumber_inodes_option) ++ { ++ if (st->st_nlink > 1) ++ { ++ struct inode_val *ival = find_inode_val (st->st_ino, ++ major (st->st_dev), ++ minor (st->st_dev)); ++ if (!ival) ++ ival = add_inode (st->st_ino, NULL, ++ major (st->st_dev), minor (st->st_dev)); ++ hdr->c_ino = ival->trans_inode; ++ } ++ else ++ hdr->c_ino = next_inode++; ++ } ++ else ++ hdr->c_ino = st->st_ino; ++ if (ignore_devno_option) ++ { ++ hdr->c_dev_maj = 0; ++ hdr->c_dev_min = 0; ++ } ++ else ++ { ++ hdr->c_dev_maj = major (st->st_dev); ++ hdr->c_dev_min = minor (st->st_dev); ++ } + } + + +@@ -1220,9 +1267,8 @@ sparse_write (int fildes, char *buf, unsigned int nbyte) + void + stat_to_cpio (struct cpio_file_stat *hdr, struct stat *st) + { +- hdr->c_dev_maj = major (st->st_dev); +- hdr->c_dev_min = minor (st->st_dev); +- hdr->c_ino = st->st_ino; ++ get_inode_and_dev (hdr, st); ++ + /* For POSIX systems that don't define the S_IF macros, + we can't assume that S_ISfoo means the standard Unix + S_IFfoo bit(s) are set. So do it manually, with a +@@ -1618,3 +1664,18 @@ cpio_create_dir (struct cpio_file_stat *file_hdr, int existing_dir) + return 0; + } + ++/* Return true if the archive format ARF stores inode numbers */ ++int ++arf_stores_inode_p (enum archive_format arf) ++{ ++ switch (arf) ++ { ++ case arf_tar: ++ case arf_ustar: ++ return 0; ++ ++ default: ++ break; ++ } ++ return 1; ++} +-- +2.9.3 + + +From 8d468d9c5134415b187dc5738a7fdaec17f87cf5 Mon Sep 17 00:00:00 2001 +From: Pavel Raiskup +Date: Mon, 6 Feb 2017 08:43:18 +0100 +Subject: [PATCH 2/2] build: lint warnings in --device-independent + +Complements: 3945f9db44c935608caa5f0 + +* src/util.c (find_inode_val): Drop unused variable. +(get_inode_and_dev): Function doesn't return any value, drop the +return value in definition. +--- + src/util.c | 3 +-- + 1 file changed, 1 insertion(+), 2 deletions(-) + +diff --git a/src/util.c b/src/util.c +index ce45842..f3efc6c 100644 +--- a/src/util.c ++++ b/src/util.c +@@ -718,7 +718,6 @@ find_inode_val (ino_t node_num, unsigned long major_num, + unsigned long minor_num) + { + struct inode_val sample; +- struct inode_val *ival; + + if (!hash_table) + return NULL; +@@ -768,7 +767,7 @@ add_inode (ino_t node_num, char *file_name, unsigned long major_num, + return e; + } + +-static ino_t ++static void + get_inode_and_dev (struct cpio_file_stat *hdr, struct stat *st) + { + if (renumber_inodes_option) +-- +2.9.3 + diff --git a/SOURCES/cpio-2.11-ru-translation.patch b/SOURCES/cpio-2.11-ru-translation.patch new file mode 100644 index 0000000..f05ab7a --- /dev/null +++ b/SOURCES/cpio-2.11-ru-translation.patch @@ -0,0 +1,13 @@ +diff --git a/po/ru.po b/po/ru.po +index 8bb24e2..39110a3 100644 +--- a/po/ru.po ++++ b/po/ru.po +@@ -1132,7 +1132,7 @@ msgid "" + "You must specify one of -oipt options.\n" + "Try `%s --help' or `%s --usage' for more information.\n" + msgstr "" +-"Необходимо указать один из апарметров -oipt.\n" ++"Необходимо указать один из параметров -oipt.\n" + "Попробуйте указать `%s --help' или `%s --usage',\n" + "чтобы получить дополнительную информацию.\n" + diff --git a/SOURCES/cpio-2.11-stdio.in.patch b/SOURCES/cpio-2.11-stdio.in.patch new file mode 100644 index 0000000..f7016ba --- /dev/null +++ b/SOURCES/cpio-2.11-stdio.in.patch @@ -0,0 +1,13 @@ +diff -urNp cpio-2.11-orig/gnu/stdio.in.h cpio-2.11/gnu/stdio.in.h +--- cpio-2.11-orig/gnu/stdio.in.h 2010-03-10 10:27:03.000000000 +0100 ++++ cpio-2.11/gnu/stdio.in.h 2012-06-04 10:23:23.804471185 +0200 +@@ -139,7 +139,9 @@ _GL_WARN_ON_USE (fflush, "fflush is not + so any use of gets warrants an unconditional warning. Assume it is + always declared, since it is required by C89. */ + #undef gets ++#if HAVE_RAW_DECL_GETS + _GL_WARN_ON_USE (gets, "gets is a security hole - use fgets instead"); ++#endif + + #if @GNULIB_FOPEN@ + # if @REPLACE_FOPEN@ diff --git a/SOURCES/cpio-2.11-testsuite-CVE-2014-9112.patch b/SOURCES/cpio-2.11-testsuite-CVE-2014-9112.patch new file mode 100644 index 0000000..d59ad1f --- /dev/null +++ b/SOURCES/cpio-2.11-testsuite-CVE-2014-9112.patch @@ -0,0 +1,30 @@ +diff --git a/tests/symlink-bad-length.at b/tests/symlink-bad-length.at +index cbf4aa7..d8d250b 100644 +--- a/tests/symlink-bad-length.at ++++ b/tests/symlink-bad-length.at +@@ -37,13 +37,20 @@ AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA= + + AT_CHECK([ + base64 -d ARCHIVE.base64 > ARCHIVE || AT_SKIP_TEST +-cpio -ntv < ARCHIVE +-test $? -eq 2 ++TZ=UTC cpio -ntv < ARCHIVE 2>stderr ++rc=$? ++cat stderr | grep -v \ ++ -e 'stored filename length is out of range' \ ++ -e 'premature end of file' \ ++ -e 'archive header has reverse byte-order' \ ++ -e 'memory exhausted' \ ++ >&2 ++echo >&2 STDERR ++test "$rc" -ne 0 + ], + [0], +-[-rw-rw-r-- 1 10029 10031 13 Nov 25 13:52 FILE +-],[cpio: LINK: stored filename length is out of range +-cpio: premature end of file ++[-rw-rw-r-- 1 10029 10031 13 Nov 25 2014 FILE ++],[STDERR + ]) + + AT_CLEANUP diff --git a/SOURCES/cpio-2.11-treat-read-errors.patch b/SOURCES/cpio-2.11-treat-read-errors.patch new file mode 100644 index 0000000..b01e60a --- /dev/null +++ b/SOURCES/cpio-2.11-treat-read-errors.patch @@ -0,0 +1,22 @@ +diff --git a/src/util.c b/src/util.c +index ab49890..7332891 100644 +--- a/src/util.c ++++ b/src/util.c +@@ -203,7 +203,7 @@ tape_fill_input_buffer (int in_des, int num_bytes) + get_next_reel (in_des); + input_size = rmtread (in_des, input_buffer, num_bytes); + } +- if (input_size < 0) ++ if (input_size == SAFE_READ_ERROR) + error (1, errno, _("read error")); + if (input_size == 0) + { +@@ -224,7 +224,7 @@ disk_fill_input_buffer (int in_des, off_t num_bytes) + in_buff = input_buffer; + num_bytes = (num_bytes < DISK_IO_BLOCK_SIZE) ? num_bytes : DISK_IO_BLOCK_SIZE; + input_size = read (in_des, input_buffer, num_bytes); +- if (input_size < 0) ++ if (input_size == SAFE_READ_ERROR) + { + input_size = 0; + return (-1); diff --git a/SOURCES/cpio-2.9-dev_number.patch b/SOURCES/cpio-2.9-dev_number.patch new file mode 100644 index 0000000..5eb751b --- /dev/null +++ b/SOURCES/cpio-2.9-dev_number.patch @@ -0,0 +1,23 @@ +diff -ruN cpio-2.9.90.orig/src/copyin.c cpio-2.9.90/src/copyin.c +--- cpio-2.9.90.orig/src/copyin.c 2008-07-11 13:20:27.000000000 +0200 ++++ cpio-2.9.90/src/copyin.c 2008-07-18 10:16:24.000000000 +0200 +@@ -1269,15 +1269,15 @@ + swab_array ((char *) short_hdr, 13); + } + +- file_hdr->c_dev_maj = major (short_hdr->c_dev); +- file_hdr->c_dev_min = minor (short_hdr->c_dev); ++ file_hdr->c_dev_maj = major ((unsigned short)short_hdr->c_dev); ++ file_hdr->c_dev_min = minor ((unsigned short)short_hdr->c_dev); + file_hdr->c_ino = short_hdr->c_ino; + file_hdr->c_mode = short_hdr->c_mode; + file_hdr->c_uid = short_hdr->c_uid; + file_hdr->c_gid = short_hdr->c_gid; + file_hdr->c_nlink = short_hdr->c_nlink; +- file_hdr->c_rdev_maj = major (short_hdr->c_rdev); +- file_hdr->c_rdev_min = minor (short_hdr->c_rdev); ++ file_hdr->c_rdev_maj = major ((unsigned short)short_hdr->c_rdev); ++ file_hdr->c_rdev_min = minor ((unsigned short)short_hdr->c_rdev); + file_hdr->c_mtime = (unsigned long) short_hdr->c_mtimes[0] << 16 + | short_hdr->c_mtimes[1]; + diff --git a/SOURCES/cpio-2.9-exitCode.patch b/SOURCES/cpio-2.9-exitCode.patch new file mode 100644 index 0000000..4a05ecf --- /dev/null +++ b/SOURCES/cpio-2.9-exitCode.patch @@ -0,0 +1,11 @@ +--- cpio-2.9/src/copyout.c.exitCode 2007-06-28 10:54:43.000000000 +0200 ++++ cpio-2.9/src/copyout.c 2007-07-16 16:23:05.000000000 +0200 +@@ -297,7 +297,7 @@ to_ascii (char *where, uintmax_t v, size + static void + field_width_error (const char *filename, const char *fieldname) + { +- error (0, 0, _("%s: field width not sufficient for storing %s"), ++ error (1, 0, _("%s: field width not sufficient for storing %s"), + filename, fieldname); + } + diff --git a/SOURCES/cpio-2.9-rh.patch b/SOURCES/cpio-2.9-rh.patch new file mode 100644 index 0000000..02b9be0 --- /dev/null +++ b/SOURCES/cpio-2.9-rh.patch @@ -0,0 +1,31 @@ +--- cpio-2.9/doc/cpio.info.rh 2007-06-28 15:25:08.000000000 +0200 ++++ cpio-2.9/doc/cpio.info 2007-07-16 15:10:20.000000000 +0200 +@@ -266,7 +266,8 @@ File: cpio.info, Node: Options, Prev: + Set the I/O block size to BLOCK-SIZE * 512 bytes. + + `-c' +- Use the old portable (ASCII) archive format. ++ Identical to "-H newc", use the new (SVR4) portable format. ++ If you wish the old portable (ASCII) archive format, use "-H odc" instead. + + `-C IO-SIZE' + `--io-size=IO-SIZE' +--- cpio-2.9/src/main.c.rh 2007-06-28 12:46:41.000000000 +0200 ++++ cpio-2.9/src/main.c 2007-07-16 15:09:10.000000000 +0200 +@@ -111,7 +111,7 @@ static struct argp_option options[] = { + {"block-size", BLOCK_SIZE_OPTION, N_("BLOCK-SIZE"), 0, + N_("Set the I/O block size to BLOCK-SIZE * 512 bytes"), GRID+1 }, + {NULL, 'c', NULL, 0, +- N_("Use the old portable (ASCII) archive format"), GRID+1 }, ++ N_("Identical to \"-H newc\", use the new (SVR4) portable format.If you wish the old portable (ASCII) archive format, use \"-H odc\" instead."), GRID+1 }, + {"dot", 'V', NULL, 0, + N_("Print a \".\" for each file processed"), GRID+1 }, + {"io-size", 'C', N_("NUMBER"), 0, +@@ -338,6 +338,7 @@ parse_opt (int key, char *arg, struct ar + case 'c': /* Use the old portable ASCII format. */ + if (archive_format != arf_unknown) + error (0, EXIT_FAILURE, _("Archive format multiply defined")); ++#define SVR4_COMPAT + #ifdef SVR4_COMPAT + archive_format = arf_newascii; /* -H newc. */ + #else diff --git a/SOURCES/cpio-2.9.90-defaultremoteshell.patch b/SOURCES/cpio-2.9.90-defaultremoteshell.patch new file mode 100644 index 0000000..6733c3b --- /dev/null +++ b/SOURCES/cpio-2.9.90-defaultremoteshell.patch @@ -0,0 +1,14 @@ +diff -urNp cpio-2.9.90-orig/lib/rtapelib.c cpio-2.9.90/lib/rtapelib.c +--- cpio-2.9.90-orig/lib/rtapelib.c 2007-08-12 09:57:15.000000000 +0200 ++++ cpio-2.9.90/lib/rtapelib.c 2009-03-09 18:06:43.000000000 +0100 +@@ -59,6 +59,10 @@ + # include + #endif + ++#ifndef REMOTE_SHELL ++# define REMOTE_SHELL "/usr/bin/ssh" ++#endif ++ + #include + #include + diff --git a/SOURCES/cpio.1 b/SOURCES/cpio.1 new file mode 100644 index 0000000..3449be9 --- /dev/null +++ b/SOURCES/cpio.1 @@ -0,0 +1,410 @@ +.TH CPIO 1L \" -*- nroff -*- +.SH NAME +cpio \- copy files to and from archives +.SH SYNOPSIS +\&\fBCopy-out mode\fR +.PP +In copy-out mode, cpio copies files into an archive. It reads a list +of filenames, one per line, on the standard input, and writes the +archive onto the standard output. A typical way to generate the list +of filenames is with the find command; you should give find the \-depth +option to minimize problems with permissions on directories that are +unreadable. see \*(lqOptions\*(rq. +.PP +.B cpio +{\-o|\-\-create} [\-0acvABLV] [\-C bytes] [\-H format] +[\-M message] [\-O [[user@]host:]archive] [\-F [[user@]host:]archive] +[\-\-file=[[user@]host:]archive] [\-\-format=format] [\-\-warning=FLAG] +[\-\-message=message][\-\-null] [\-\-reset\-access\-time] [\-\-verbose] +[\-\-dot] [\-\-append] [\-\-block\-size=blocks] [\-\-dereference] +[\-\-io\-size=bytes] [\-\-rsh\-command=command] [\-\-license] [\-\-usage] +[\-\-help] [\-\-version] +< name-list [> archive] +.PP +\&\fBCopy-in mode\fR +.PP +In copy-in mode, cpio copies files out of an archive or lists the +archive contents. It reads the archive from the standard input. Any +non-option command line arguments are shell globbing patterns; only +files in the archive whose names match one or more of those patterns are +copied from the archive. Unlike in the shell, an initial `\fB.\fR' in a +filename does match a wildcard at the start of a pattern, and a `\fB/\fR' in a +filename can match wildcards. If no patterns are given, all files are +extracted. see \*(lqOptions\*(rq. +.PP +.B cpio +{\-i|\-\-extract} [\-bcdfmnrtsuvBSV] [\-C bytes] [\-E file] [\-H format] +[\-M message] [\-R [user][:.][group]] [\-I [[user@]host:]archive] +[\-F [[user@]host:]archive] [\-\-file=[[user@]host:]archive] +[\-\-make-directories] [\-\-nonmatching] [\-\-preserve-modification-time] +[\-\-numeric-uid-gid] [\-\-rename] [\-t|\-\-list] [\-\-swap-bytes] [\-\-swap] +[\-\-dot] [\-\-warning=FLAG] [\-\-unconditional] [\-\-verbose] +[\-\-block-size=blocks] [\-\-swap-halfwords] [\-\-io-size=bytes] +[\-\-pattern-file=file] [\-\-format=format] [\-\-owner=[user][:.][group]] +[\-\-no-preserve-owner] [\-\-message=message] +[\-\-force\-local] [\-\-no\-absolute\-filenames] [\-\-absolute\-filenames] +[\-\-sparse] [\-\-only\-verify\-crc] [\-\-to\-stdout] [\-\-quiet] +[\-\-rsh-command=command] [\-\-license] [\-\-usage] [\-\-help] +[\-\-version] [pattern...] [< archive] +.PP +\&\fBCopy-pass mode\fR +.PP +In copy-pass mode, cpio copies files from one directory tree to +another, combining the copy-out and copy-in steps without actually +using an archive. It reads the list of files to copy from the standard +input; the directory into which it will copy them is given as a +non-option argument. see \*(lqOptions\*(rq. +.PP +.B cpio +{\-p|\-\-pass-through} [\-0adlmuvLV] [\-R [user][:.][group]] +[\-\-null] [\-\-reset-access-time] [\-\-make-directories] [\-\-link] [\-\-quiet] +[\-\-preserve-modification-time] [\-\-unconditional] [\-\-verbose] [\-\-dot] +[\-\-warning=FLAG] [\-\-dereference] [\-\-owner=[user][:.][group]] +[\-\-no-preserve-owner] [\-\-sparse] [\-\-license] [\-\-usage] [\-\-help] +[\-\-version] destination-directory < name-list +.PP +.SH DESCRIPTION +GNU cpio is a tool for creating and extracting archives, or copying +files from one place to another. It handles a number of cpio formats as +well as reading and writing tar files. +.PP +Following archive formats are supported: binary, old ASCII, new ASCII, crc, HPUX binary, HPUX old +ASCII, old tar, and POSIX.1 tar. The tar format is provided for compatibility with the tar program. By +default, cpio creates binary format archives, for compatibility with older cpio programs. When extracting +from archives, cpio automatically recognizes which kind of archive it is reading and can read archives created +on machines with a different byte-order. +.PP +.SH OPTIONS +.TP +`\fB\-0, \-\-null\fR' +Read a list of filenames terminated by a null character, instead +of a newline, so that files whose names contain newlines can be +archived. \s-1GNU\s0 find is one way to produce a list of +null-terminated filenames. This option may be used in copy-out +and copy-pass modes. +.TP +`\fB\-a, \-\-reset\-access\-time\fR' +Reset the access times of files after reading them, so that it +does not look like they have just been read. +.TP +`\fB\-A, \-\-append\fR' +Append to an existing archive. Only works in copy-out mode. The +archive must be a disk file specified with the \-O or \-F (\-file) +option. +.TP +`\fB\-b, \-\-swap\fR' +Swap both halfwords of words and bytes of halfwords in the data. +Equivalent to \-sS. This option may be used in copy-in mode. Use +this option to convert 32\-bit integers between big-endian and +little-endian machines. +.TP +`\fB\-B\fR' +Set the I/O block size to 5120 bytes. Initially the block size is +512 bytes. +.TP +`\fB\-\-block\-size=BLOCK\-SIZE\fR' +Set the I/O block size to BLOCK-SIZE * 512 bytes. +.TP +`\fB\-c\fR' +Identical to \*(lq\-H newc\*(rq, use the new (\s-1SVR4\s0) portable format. +If you wish the old portable (\s-1ASCII\s0) archive format, use \*(lq\-H odc\*(rq instead. +.TP +`\fB\-C \s-1IO\-SIZE\s0, \-\-io\-size=IO\-SIZE\fR' +Set the I/O block size to IO-SIZE bytes. +.TP +`\fB\-d, \-\-make\-directories\fR' +Create leading directories where needed. +.TP +`\fB\-\-device\-independent, \-\-reproducible\fR' +Create reproducible archives. This is equivalent to \fB\-\-ignore\-devno +\-\-renumber\-inodes\fR. +.TP +`\fB\-E \s-1FILE\s0, \-\-pattern\-file=FILE\fR' +Read additional patterns specifying filenames to extract or list +from \s-1FILE\s0. The lines of \s-1FILE\s0 are treated as if they had been +non-option arguments to cpio. This option is used in copy-in mode, +.TP +`\fB\-f, \-\-nonmatching\fR' +Only copy files that do not match any of the given patterns. +.TP +`\fB\-F, \-\-file=archive\fR' +Archive filename to use instead of standard input or output. To +use a tape drive on another machine as the archive, use a filename +that starts with `\fB\s-1HOSTNAME:\s0\fR'. The hostname can be preceded by a +username and an `\fB@\fR' to access the remote tape drive as that user, +if you have permission to do so (typically an entry in that user's +`\fB~/.rhosts\fR' file). +.TP +`\fB\-\-force\-local\fR' +With \-F, \-I, or \-O, take the archive file name to be a local file +even if it contains a colon, which would ordinarily indicate a +remote host name. +.TP +`\fB\-H \s-1FORMAT\s0, \-\-format=FORMAT\fR' +Use archive format \s-1FORMAT\s0. The valid formats are listed below; +the same names are also recognized in all\-caps. The default in +copy-in mode is to automatically detect the archive format, and in +copy-out mode is `\fBbin\fR'. +.TP +`bin' +The obsolete binary format. +.TP +`odc' +The old (\s-1POSIX\s0.1) portable format. +.TP +`newc' +The new (\s-1SVR4\s0) portable format, which supports file systems +having more than 65536 i\-nodes. +.TP +`crc' +The new (\s-1SVR4\s0) portable format with a checksum (Sum32) added. +.TP +`tar' +The old tar format. +.TP +`ustar' +The \s-1POSIX\s0.1 tar format. Also recognizes \s-1GNU\s0 tar archives, +which are similar but not identical. +.TP +`hpbin' +The obsolete binary format used by \s-1HPUX\s0's cpio (which stores +device files differently). +.TP +`hpodc' +The portable format used by \s-1HPUX\s0's cpio (which stores device +files differently). +.TP +`\fB\-i, \-\-extract\fR' +Run in copy-in mode. see \*(lqCopy\-in mode\*(rq. +.TP +`\fB\-I archive\fR' +Archive filename to use instead of standard input. To use a tape +drive on another machine as the archive, use a filename that +starts with `\fB\s-1HOSTNAME:\s0\fR'. The hostname can be preceded by a +username and an `\fB@\fR' to access the remote tape drive as that user, +if you have permission to do so (typically an entry in that user's +`\fB~/.rhosts\fR' file). +.TP +`\fB\-\-ignore\-devno\fR' +Store 0 in the device number field of each archive member, instead of the +actual device number. +.TP +`\fB\-k\fR' +Ignored; for compatibility with other versions of cpio. +.TP +`\fB\-l, \-\-link\fR' +Link files instead of copying them, when possible. +.TP +`\fB\-L, \-\-dereference\fR' +Copy the file that a symbolic link points to, rather than the +symbolic link itself. +.TP +`\fB\-m, \-\-preserve\-modification\-time\fR' +Retain previous file modification times when creating files. +.TP +`\fB\-M \s-1MESSAGE\s0, \-\-message=MESSAGE\fR' +Print \s-1MESSAGE\s0 when the end of a volume of the backup media (such +as a tape or a floppy disk) is reached, to prompt the user to +insert a new volume. If \s-1MESSAGE\s0 contains the string \*(lq%d\*(rq, it is +replaced by the current volume number (starting at 1). +.TP +`\fB\-n, \-\-numeric\-uid\-gid\fR' +Show numeric \s-1UID\s0 and \s-1GID\s0 instead of translating them into names +when using the `\fB\-\-verbose option\fR'. +.TP +`\fB\-\-no\-absolute\-filenames\fR' +Create all files relative to the current directory in copy-in +mode, even if they have an absolute file name in the archive. +.TP +`\fB\-\-absolute\-filenames\fR' (default) +Do not strip leading file name components that contain \*(lq..\*(rq +and leading slashes from file names in copy-in mode +.TP +`\fB\-\-no\-preserve\-owner\fR' +Do not change the ownership of the files; leave them owned by the +user extracting them. This is the default for non-root users, so +that users on System V don't inadvertently give away files. This +option can be used in copy-in mode and copy-pass mode +.TP +`\fB\-o, \-\-create\fR' +Run in copy-out mode. see \*(lqCopy\-out mode\*(rq. +.TP +`\fB\-O archive\fR' +Archive filename to use instead of standard output. To use a tape +drive on another machine as the archive, use a filename that +starts with `\fB\s-1HOSTNAME:\s0\fR'. The hostname can be preceded by a +username and an `\fB@\fR' to access the remote tape drive as that user, +if you have permission to do so (typically an entry in that user's +`\fB~/.rhosts\fR' file). +.TP +`\fB\-\-only\-verify\-crc\fR' +Verify the \s-1Sum32 checksum\s0's of each file in the archive, when reading a +\s-1crc\s0 format archive. Don't actually extract the files. +.TP +`\fB\-p, \-\-pass\-through\fR' +Run in copy-pass mode. see \*(lqCopy\-pass mode\*(rq. +.TP +`\fB\-\-quiet\fR' +Do not print the number of blocks copied. +.TP +`\fB\-r, \-\-rename\fR' +Interactively rename files. +.TP +`\fB\-\-renumber\-inodes\fR' +Renumber inodes when storing them in the archive. +.TP +`\fB\-R [user][:.][group], \-\-owner [user][:.][group]\fR' +Set the ownership of all files created to the specified user and/or +group in copy-out and copy-pass modes. Either the user, the +group, or both, must be present. If the group is omitted but the +\&\*(lq:\*(rq or \*(lq.\*(rq separator is given, use the given user's login group. +Only the super-user can change files' ownership. +.TP +`\fB\-\-rsh\-command=COMMAND\fR' +Notifies cpio that is should use \s-1COMMAND\s0 to communicate with remote +devices. +.TP +`\fB\-s, \-\-swap\-bytes\fR' +Swap the bytes of each halfword (pair of bytes) in the files.This +option can be used in copy-in mode. +.TP +`\fB\-S, \-\-swap\-halfwords\fR' +Swap the halfwords of each word (4 bytes) in the files. This +option may be used in copy-in mode. +.TP +`\fB\-\-sparse\fR' +Write files with large blocks of zeros as sparse files. This +option is used in copy-in and copy-pass modes. +.TP +`\fB\-t, \-\-list\fR' +Print a table of contents of the input. +.TP +`\fB\-\-to\-stdout\fR' +Extract files to standard output. This option may be used in +copy-in mode. +.TP +`\fB\-u, \-\-unconditional\fR' +Replace all files, without asking whether to replace existing +newer files with older files. +.TP +`\fB\-v, \-\-verbose\fR' +List the files processed, or with `\fB\-t\fR', give an `\fBls \-l\fR' style +table of contents listing. In a verbose table of contents of a +ustar archive, user and group names in the archive that do not +exist on the local system are replaced by the names that +correspond locally to the numeric \s-1UID\s0 and \s-1GID\s0 stored in the +archive. +.TP +`\fB\-V, \-\-dot\fR' +Print a `\fB.\fR' for each file processed. +.TP +`\fB\-W, \-\-warning\fR' +Control warning display. Currently FLAG is one of 'none', 'truncate', 'all'. Multiple options accumulate. +.TP +`\fB\-\-license\fR' +Print license and exit. +.TP +`\fB?, \-\-help\fR' +Give a help page similar to this manpage. +.TP +`\fB\-\-usage\fR' +Give a short usage message. +.TP +`\fB\-\-version\fR' +Print the cpio program version number and exit. + +.PP +.SH EXAMPLES +When creating an archive, cpio takes the list of files to be +processed from the standard input, and then sends the archive to the +standard output, or to the device defined by the `\fB\-F\fR' option. +Usually find or ls is used to provide this list to +the standard input. In the following example you can see the +possibilities for archiving the contents of a single directory. +.PP +.B % ls | cpio \-ov > directory.cpio +.PP +The `\fB\-o\fR' option creates the archive, and the `\fB\-v\fR' option prints the +names of the files archived as they are added. Notice that the options +can be put together after a single `\fB\-\fR' or can be placed separately on +the command line. The `\fB>\fR' redirects the cpio output to the file +`\fBdirectory.cpio\fR'. +.PP +If you wanted to archive an entire directory tree, the find command +can provide the file list to cpio: +.PP +.B % find . \-print \-depth | cpio \-ov > tree.cpio +.PP +This will take all the files in the current directory, the +directories below and place them in the archive tree.cpio. Again the +`\fB\-o\fR' creates an archive, and the `\fB\-v\fR' option shows you the name of the +files as they are archived. see \*(lqCopy\-out mode\*(rq. Using the `\fB.\fR' in +the find statement will give you more flexibility when doing restores, +as it will save file names with a relative path vice a hard wired, +absolute path. The `\fB\-depth\fR' option forces `\fBfind\fR' to print of the +entries in a directory before printing the directory itself. This +limits the effects of restrictive directory permissions by printing the +directory entries in a directory before the directory name itself. +.PP +Extracting an archive requires a bit more thought because cpio will +not create directories by default. Another characteristic, is it will +not overwrite existing files unless you tell it to. +.PP +.B % cpio \-iv < directory.cpio +.PP +This will retrieve the files archived in the file directory.cpio and +place them in the present directory. The `\fB\-i\fR' option extracts the +archive and the `\fB\-v\fR' shows the file names as they are extracted. If +you are dealing with an archived directory tree, you need to use the +`\fB\-d\fR' option to create directories as necessary, something like: +.PP +.B % cpio \-idv < tree.cpio +.PP +This will take the contents of the archive tree.cpio and extract it +to the current directory. If you try to extract the files on top of +files of the same name that already exist (and have the same or later +modification time) cpio will not extract the file unless told to do so +by the \-u option. see \*(lqCopy\-in mode\*(rq. +.PP +In copy-pass mode, cpio copies files from one directory tree to +another, combining the copy-out and copy-in steps without actually +using an archive. It reads the list of files to copy from the standard +input; the directory into which it will copy them is given as a +non-option argument. see \*(lqCopy\-pass mode\*(rq. +.PP +.B % find . \-depth \-print0 | cpio \-\-null \-pvd new-dir +.PP +The example shows copying the files of the present directory, and +sub-directories to a new directory called new\-dir. Some new options are +the `\fB\-print0\fR' available with \s-1GNU\s0 find, combined with the `\fB\-\-null\fR' +option of cpio. These two options act together to send file names +between find and cpio, even if special characters are embedded in the +file names. Another is `\fB\-p\fR', which tells cpio to pass the files it +finds to the directory `\fBnew-dir\fR'. + +.SH BUGS +The GNU folks, in general, abhor man pages, and create info documents instead. The maintainer of +.B cpio +falls +into this category. Thus this man page may not be complete, nor current, and was included in the Red Hat +CVS tree because man is a great tool :). +.PP +.SH REPORTING BUGS +Please report bugs via https://bugzilla.redhat.com. +.PP +.SH SEE ALSO +The full documentation for +.B cpio +is maintained as a Texinfo manual. If the +.B info +and +.B cpio +programs are properly installed at your site, the command +.IP +.B info cpio +.PP +should give you access to the complete manual. The online copy of the documentation +is available at the following address: +.PP +http://www.gnu.org/software/cpio/manual + diff --git a/SPECS/cpio.spec b/SPECS/cpio.spec new file mode 100644 index 0000000..71e1e81 --- /dev/null +++ b/SPECS/cpio.spec @@ -0,0 +1,509 @@ +Summary: A GNU archiving program +Name: cpio +Version: 2.11 +Release: 27%{?dist} +License: GPLv3+ +Group: Applications/Archiving +URL: http://www.gnu.org/software/cpio/ +Source: ftp://ftp.gnu.org/gnu/cpio/cpio-%{version}.tar.bz2 +# help2man generated manual page distributed only in RHEL/Fedora +Source1: cpio.1 +#We use SVR4 portable format as default . +Patch1: cpio-2.9-rh.patch +#fix warn_if_file_changed() and set exit code to 1 when cpio +# fails to store file > 4GB (#183224) +Patch2: cpio-2.9-exitCode.patch +#Support major/minor device numbers over 127 (bz#450109) +Patch3: cpio-2.9-dev_number.patch +#define default remote shell as /usr/bin/ssh(#452904) +Patch4: cpio-2.9.90-defaultremoteshell.patch +#fix segfault with nonexisting file with patternnames(#567022) +Patch5: cpio-2.10-patternnamesigsegv.patch +#fix rawhide buildfailure by updating gnulib's stdio.in.h +Patch6: cpio-2.11-stdio.in.patch +# fix bad file name splitting while creating ustar archive (#866467) +Patch7: cpio-2.10-longnames-split.patch +# cpio does Sum32 checksum, not CRC +Patch8: cpio-2.11-crc-fips-nit.patch + +# use the config.guess/config.sub files from actual automake-1.13 +# ~> #925189 +Patch9: cpio-2.11-arm-config-sub-guess.patch + +# "really" check for read() return value +Patch10: cpio-2.11-treat-read-errors.patch + +# Small typo in RU translation +# ~> #1075510 +# ~> downstream? +Patch11: cpio-2.11-ru-translation.patch + +Patch12: cpio-2.11-CVE-2014-9112.patch +Patch13: cpio-2.11-testsuite-CVE-2014-9112.patch + +# Correct crc checksum (rhbz#1415081) +# ~> upstream ccec71ec318f +Patch14: cpio-2.11-crc-big-files.patch + +# Reproducible archives (rhbz#1386662) +# ~> upstream 3945f9db4 + small warning patch. +Patch15: cpio-2.11-reproducible.patch + +# Don't segfault during recovery +# ~> upstream fd262d116c4564c1796 +Patch16: cpio-2.11-recovery.patch + +Requires(post): /sbin/install-info +Requires(preun): /sbin/install-info +Provides: bundled(gnulib) +Provides: /bin/cpio +BuildRequires: texinfo, autoconf, automake, gettext, rmt +Buildroot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) + +%description +GNU cpio copies files into or out of a cpio or tar archive. Archives +are files which contain a collection of other files plus information +about them, such as their file name, owner, timestamps, and access +permissions. The archive can be another file on the disk, a magnetic +tape, or a pipe. GNU cpio supports the following archive formats: binary, +old ASCII, new ASCII, crc, HPUX binary, HPUX old ASCII, old tar and POSIX.1 +tar. By default, cpio creates binary format archives, so that they are +compatible with older cpio programs. When it is extracting files from +archives, cpio automatically recognizes which kind of archive it is reading +and can read archives created on machines with a different byte-order. + +Install cpio if you need a program to manage file archives. + +%prep +%setup -q +%patch1 -p1 -b .rh +%patch2 -p1 -b .exitCode +%patch3 -p1 -b .dev_number +%patch4 -p1 -b .defaultremote +%patch5 -p1 -b .patternsegv +%patch6 -p1 -b .gnulib %{?_rawbuild} +%patch7 -p1 -b .longnames +%patch8 -p1 -b .sum32-fips +%patch9 -p1 -b .arm-config-guess-sub +%patch10 -p1 -b .safe-read-check +%patch11 -p1 -b .ru-translation +%patch12 -p1 -b .CVE-2014-9112 +%patch13 -p1 -b .CVE-2014-9112-test +%patch14 -p1 -b .crc-big-files +%patch15 -p1 -b .reproducible +%patch16 -p1 -b .recovery + +autoreconf -v + +%build + +CFLAGS="$RPM_OPT_FLAGS -D_GNU_SOURCE -D_FILE_OFFSET_BITS=64 -D_LARGEFILE64_SOURCE -pedantic -fno-strict-aliasing -Wall" %configure --with-rmt="%{_sysconfdir}/rmt" +make %{?_smp_mflags} +(cd po && make update-gmo) + + +%install +rm -rf ${RPM_BUILD_ROOT} + +make DESTDIR=$RPM_BUILD_ROOT INSTALL="install -p" install + + +rm -f $RPM_BUILD_ROOT%{_libexecdir}/rmt +rm -f $RPM_BUILD_ROOT%{_infodir}/dir +rm -f $RPM_BUILD_ROOT%{_mandir}/man1/*.1* +install -c -p -m 0644 %{SOURCE1} ${RPM_BUILD_ROOT}%{_mandir}/man1 + +%find_lang %{name} + +%clean +rm -rf ${RPM_BUILD_ROOT} + +%check +rm -f ${RPM_BUILD_ROOT}/test/testsuite +make check + + +%post +if [ -f %{_infodir}/cpio.info.gz ]; then + /sbin/install-info %{_infodir}/cpio.info.gz %{_infodir}/dir || : +fi + +%preun +if [ $1 = 0 ]; then + if [ -f %{_infodir}/cpio.info.gz ]; then + /sbin/install-info --delete %{_infodir}/cpio.info.gz %{_infodir}/dir || : + fi +fi + +%files -f %{name}.lang +%doc AUTHORS ChangeLog NEWS README THANKS TODO COPYING +%{_bindir}/* +%{_mandir}/man*/* +%{_infodir}/*.info* + +%changelog +* Mon Feb 06 2017 Pavel Raiskup - 2.11-27 +- don't segfault during recovery (rhbz#1318084) + +* Mon Feb 06 2017 Pavel Raiskup - 2.11-26 +- reproducible archives (rhbz#1386662) + +* Mon Feb 06 2017 Pavel Raiskup - 2.11-25 +- fix crc checksum for files ~200M+ (rhbz#1415081) + +* Wed Jul 08 2015 Pavel Raiskup - 2.11-24 +- fix for CVE-2014-9112 + +* Wed May 20 2015 Pavel Raiskup - 2.11-23 +- better check for read() error (rhbz#1138148) +- fix ru translation (rhbz#1075513) + +* Fri Jan 24 2014 Daniel Mach - 2.11-22 +- Mass rebuild 2014-01-24 + +* Fri Dec 27 2013 Daniel Mach - 2.11-21 +- Mass rebuild 2013-12-27 + +* Wed Mar 27 2013 Pavel Raiskup - 2.11-20 +- fix another bogus date in changelog +- update config.guess/config.sub for aarm64 build (#925189) +- run autoreconf instead of autoheader + +* Fri Mar 15 2013 Pavel Raiskup - 2.11-19 +- revert the fix for memory leak (at least for now) #921725 + +* Tue Mar 12 2013 Pavel Raiskup - 2.11-18 +- explicitly provide /bin/cpio for packages that are dependant on this file + +* Mon Mar 11 2013 Pavel Raiskup - 2.11-17 +- fix small memory leak in copyin.c (#919454) +- remove %%defattr and install 'cpio' to real %%{_bindir} +- CovScan: add %%{?_rawbuild} + +* Wed Feb 13 2013 Fedora Release Engineering - 2.11-16 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_19_Mass_Rebuild + +* Mon Nov 05 2012 Pavel Raiskup - 2.11-15 +- disable the temporary O_SYNC fix (glibc is fixed - #872366) + +* Fri Nov 02 2012 Pavel Raiskup - 2.11-14 +- fix bad changelog entries +- allow to build in Fedora Rawhide (temporarily because of #872336) (the value + is guessed from from /usr/include/asm-generic/fcntl.h) + +* Mon Oct 22 2012 Pavel Raiskup 2.11-13 +- move RH-only manual page cpio.1 from look-aside cache into dist-git repository + +* Thu Oct 18 2012 Pavel Raiskup 2.11-12 +- fix for bad file name splitting while creating ustar archive (#866467) + +* Wed Aug 29 2012 Ondrej Vasik 2.11-11 +- add missing options to manpage (#852765) + +* Wed Jul 18 2012 Fedora Release Engineering - 2.11-10 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_18_Mass_Rebuild + +* Mon Jun 04 2012 Ondrej Vasik 2.11-9 +- fix build failure in rawhide build system (gets undefined) + +* Wed May 30 2012 Ondrej Vasik 2.11-8 +- drop unnecessary patches: cpio-2.9-dir_perm.patch and + cpio-2.9-sys_umask.patch - reported by M.Castellini + +* Tue May 15 2012 Ondrej Vasik 2.11-7 +- add virtual provides for bundled(gnulib) copylib (#821749) + +* Thu Jan 12 2012 Fedora Release Engineering - 2.11-6 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_17_Mass_Rebuild + +* Fri Oct 14 2011 Ondrej Vasik 2.11-5 +- update manpage to reflect new option, polish the style (#746209) + +* Mon Mar 07 2011 Ondrej Vasik 2.11-4 +- fix several typos and manpage syntax(Ville Skyttä, #682470) + +* Tue Feb 08 2011 Fedora Release Engineering - 2.11-3 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_15_Mass_Rebuild + +* Mon May 31 2010 Ondrej Vasik 2.11-2 +- built with fno-strict-aliasing(#596153) + +* Thu Mar 11 2010 Ondrej Vasik 2.11-1 +- new upstream release 2.11 +- removed applied patches, run test suite + +* Wed Mar 10 2010 Ondrej Vasik 2.10-6 +- CVE-2010-0624 fix heap-based buffer overflow by expanding + a specially-crafted archive(#572150) +- comment patches + +* Thu Feb 25 2010 Ondrej Vasik 2.10-5 +- remove redundant setLocale patch +- fix segfault with nonexisting file with patternnames + (#567022) + +* Wed Jan 06 2010 Ondrej Vasik 2.10-4 +- do not fail with new POSIX 2008 utimens() glibc call + (#552320) + +* Thu Aug 06 2009 Ondrej Vasik 2.10-3 +- do process install-info only without --excludedocs(#515924) + +* Fri Jul 24 2009 Fedora Release Engineering - 2.10-2 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_12_Mass_Rebuild + +* Mon Jun 22 2009 Ondrej Vasik 2.10-1 +- new upstream release 2.10 + +* Mon Mar 9 2009 Ondrej Vasik 2.9.90-5 +- define default remote shell as /usr/bin/ssh(#452904) +- use /etc/rmt as default rmt command + +* Tue Feb 24 2009 Fedora Release Engineering - 2.9.90-4 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_11_Mass_Rebuild + +* Wed Feb 11 2009 Ondrej Vasik 2.9.90-3 +- make -d honor system umask(#484997) + +* Fri Jul 18 2008 Kamil Dudka 2.9.90-2 +- Support major/minor device numbers over 127 (bz#450109) + +* Tue Jun 03 2008 Ondrej Vasik 2.9.90-1 +- new upstream alpha version 2.9.90 + removed applied patches + +* Mon Mar 03 2008 Radek Brich 2.9-7 +- fix -dir_perm patch to restore permissions correctly even + in passthrough mode -- revert affected code to cpio 2.8 state + (bz#430835) + +* Thu Feb 14 2008 Radek Brich 2.9-6 +- when extracting archive created with 'find -depth', + restore the permissions of directories properly (bz#430835) +- fix for GCC 4.3 + +* Thu Nov 01 2007 Radek Brich 2.9-5 +- upstream patch for CVE-2007-4476 (stack crashing in safer_name_suffix) + +* Tue Sep 04 2007 Radek Brich 2.9-4 +- Updated license tag + +* Wed Aug 29 2007 Fedora Release Engineering - 2.9-3 +- Rebuild for selinux ppc32 issue. + +* Thu Jul 19 2007 Radek Brich 2.9-1.1 +- fix spec, rebuild + +* Thu Jul 19 2007 Radek Brich 2.9-1 +- update to 2.9, GPLv3 + +* Tue Feb 20 2007 Peter Vrabec 2.6-27 +- fix typo in changelog + +* Thu Feb 08 2007 Ruben Kerkhof 2.6-26 +- Preserve timestamps when installing files + +* Thu Feb 08 2007 Peter Vrabec 2.6-25 +- set cpio bindir properly + +* Wed Feb 07 2007 Peter Vrabec 2.6-24 +- fix spec file to meet Fedora standards (#225656) + +* Mon Jan 22 2007 Peter Vrabec 2.6-23 +- fix non-failsafe install-info use in scriptlets (#223682) + +* Sun Dec 10 2006 Peter Vrabec 2.6-22 +- fix rpmlint issue in spec file + +* Tue Dec 05 2006 Peter Vrabec 2.6-21 +- fix setlocale (#200478) + +* Sat Nov 25 2006 Peter Vrabec 2.6-20 +- cpio man page provided by RedHat + +* Tue Jul 18 2006 Peter Vrabec 2.6-19 +- fix cpio --help output (#197597) + +* Wed Jul 12 2006 Jesse Keating - 2.6-18.1 +- rebuild + +* Sat Jun 10 2006 Peter Vrabec 2.6-18 +- autoconf was added to BuildRequires, because autoheader is + used in prep phase (#194737) + +* Tue Mar 28 2006 Peter Vrabec 2.6-17 +- rebuild + +* Sat Mar 25 2006 Peter Vrabec 2.6-15 +- fix (#186339) on ppc and s390 + +* Thu Mar 23 2006 Peter Vrabec 2.6-14 +- init struct file_hdr (#186339) + +* Wed Mar 15 2006 Peter Vrabec 2.6-13 +- merge toAsciiError.patch with writeOutHeaderBufferOverflow.patch +- merge largeFileGrew.patch with lfs.patch +- fix large file support, cpio is able to store files<8GB + in 'old ascii' format (-H odc option) +- adjust warnings.patch + +* Tue Mar 14 2006 Peter Vrabec 2.6-12 +- fix warn_if_file_changed() and set exit code to #1 when + cpio fails to store file > 4GB (#183224) + +* Fri Feb 10 2006 Jesse Keating - 2.6-11.2.1 +- bump again for double-long bug on ppc(64) + +* Tue Feb 07 2006 Jesse Keating - 2.6-11.2 +- rebuilt for new gcc4.1 snapshot and glibc changes + +* Fri Dec 09 2005 Jesse Keating +- rebuilt + +* Wed Nov 23 2005 Peter Vrabec 2.6-11 +- fix previous patch(writeOutHeaderBufferOverflow) + +* Wed Nov 23 2005 Peter Vrabec 2.6-10 +- write_out_header rewritten to fix buffer overflow(#172669) + +* Mon Oct 31 2005 Peter Vrabec 2.6-9 +- fix checksum error on 64-bit machines (#171649) + +* Fri Jul 01 2005 Peter Vrabec 2.6-8 +- fix large file support, archive >4GiB, archive members <4GiB (#160056) +- fix race condition holes, use mode 0700 for dir creation + +* Tue May 17 2005 Peter Vrabec 2.6-7 +- fix #156314 (CAN-2005-1229) cpio directory traversal issue +- fix some gcc warnings + +* Mon Apr 25 2005 Peter Vrabec 2.6-6 +- fix race condition (#155749) +- use find_lang macro + +* Thu Mar 17 2005 Peter Vrabec +- rebuild 2.6-5 + +* Mon Jan 24 2005 Peter Vrabec +- insecure file creation (#145721) + +* Mon Jan 17 2005 Peter Vrabec +- fix symlinks pack (#145225) + +* Fri Jan 14 2005 Peter Vrabec +- new fixed version of lfs patch (#144688) + +* Thu Jan 13 2005 Peter Vrabec +- upgrade to cpio-2.6 + +* Tue Nov 09 2004 Peter Vrabec +- fixed "cpio -oH ustar (or tar) saves bad mtime date after Jan 10 2004" (#114580) + +* Mon Nov 01 2004 Peter Vrabec +- support large files > 2GB (#105617) + +* Thu Oct 21 2004 Peter Vrabec +- fix dependencies in spec + +* Tue Jun 15 2004 Elliot Lee +- rebuilt + +* Fri Feb 13 2004 Elliot Lee +- rebuilt + +* Tue Sep 23 2003 Florian La Roche +- do not link against -lnsl + +* Wed Jun 04 2003 Elliot Lee +- rebuilt + +* Fri Feb 14 2003 Jeff Johnson 2.5-3 +- setlocale for i18n compliance (#79136). + +* Wed Jan 22 2003 Tim Powers +- rebuilt + +* Mon Nov 18 2002 Jeff Johnson 2.5-1 +- update 2.5, restack and consolidate patches. +- don't apply (but include for now) freebsd and #56346 patches. +- add url (#54598). + +* Thu Nov 7 2002 Jeff Johnson 2.4.2-30 +- rebuild from CVS. + +* Fri Jun 21 2002 Tim Powers +- automated rebuild + +* Thu May 23 2002 Tim Powers +- automated rebuild + +* Wed Jan 09 2002 Tim Powers +- automated rebuild + +* Thu Nov 22 2001 Bernhard Rosenkraenzer 2.4.2-25 +- Fix up extraction of multiply linked files when the first link is + excluded (Bug #56346) + +* Mon Oct 1 2001 Bernhard Rosenkraenzer 2.4.2-24 +- Merge and adapt patches from FreeBSD, this should fix FIFO handling + +* Tue Jun 26 2001 Bernhard Rosenkraenzer +- Add and adapt Debian patch (pl36), fixes #45285 and a couple of other issues + +* Sun Jun 24 2001 Elliot Lee +- Bump release + rebuild. + +* Tue Aug 8 2000 Jeff Johnson +- update man page with decription of -c behavior (#10581). + +* Wed Jul 12 2000 Prospector +- automatic rebuild + +* Thu Jun 29 2000 Preston Brown +- patch from HJ Lu for better error codes upon exit + +* Mon Jun 5 2000 Jeff Johnson +- FHS packaging. + +* Wed Feb 9 2000 Jeff Johnson +- missing defattr. + +* Mon Feb 7 2000 Bill Nottingham +- handle compressed manpages + +* Fri Dec 17 1999 Jeff Johnson +- revert the stdout patch (#3358), restoring original GNU cpio behavior + (#6376, #7538), the patch was dumb. + +* Tue Aug 31 1999 Jeff Johnson +- fix infinite loop unpacking empty files with hard links (#4208). +- stdout should contain progress information (#3358). + +* Sun Mar 21 1999 Crstian Gafton +- auto rebuild in the new build environment (release 12) + +* Sat Dec 5 1998 Jeff Johnson +- longlong dev wrong with "-o -H odc" headers (formerly "-oc"). + +* Thu Dec 03 1998 Cristian Gafton +- patch to compile on glibc 2.1, where strdup is a macro + +* Tue Jul 14 1998 Jeff Johnson +- Fiddle bindir/libexecdir to get RH install correct. +- Don't include /sbin/rmt -- use the rmt from dump package. +- Don't include /bin/mt -- use the mt from mt-st package. +- Add prereq's + +* Tue Jun 30 1998 Jeff Johnson +- fix '-c' to duplicate svr4 behavior (problem #438) +- install support programs & info pages + +* Mon Apr 27 1998 Prospector System +- translations modified for de, fr, tr + +* Fri Oct 17 1997 Donnie Barnes +- added BuildRoot +- removed "(used by RPM)" comment in Summary + +* Thu Jun 19 1997 Erik Troan +- built against glibc +- no longer statically linked as RPM doesn't use cpio for unpacking packages