diff options
author | Mike Frysinger <vapier@gentoo.org> | 2007-06-29 17:41:12 +0000 |
---|---|---|
committer | Mike Frysinger <vapier@gentoo.org> | 2007-06-29 17:41:12 +0000 |
commit | bcf852a133ffe1698a817bd686418ff94f1f4e8d (patch) | |
tree | 3bb229897d466d0a28457b1567c5922ee2a42c7e /app-arch/cpio | |
parent | Marked ~hppa (bug #159002). (diff) | |
download | historical-bcf852a133ffe1698a817bd686418ff94f1f4e8d.tar.gz historical-bcf852a133ffe1698a817bd686418ff94f1f4e8d.tar.bz2 historical-bcf852a133ffe1698a817bd686418ff94f1f4e8d.zip |
old
Diffstat (limited to 'app-arch/cpio')
-rw-r--r-- | app-arch/cpio/cpio-2.6-r5.ebuild | 52 | ||||
-rw-r--r-- | app-arch/cpio/cpio-2.7-r1.ebuild | 38 | ||||
-rw-r--r-- | app-arch/cpio/files/2.6-isnumber.patch | 34 | ||||
-rw-r--r-- | app-arch/cpio/files/2.6-lstat.patch | 28 | ||||
-rw-r--r-- | app-arch/cpio/files/2.6-rili-big-files.patch | 80 | ||||
-rw-r--r-- | app-arch/cpio/files/2.6-umask.patch | 38 | ||||
-rw-r--r-- | app-arch/cpio/files/cpio-2.6-checksum.patch | 35 | ||||
-rw-r--r-- | app-arch/cpio/files/cpio-2.6-chmodRaceC.patch | 125 | ||||
-rw-r--r-- | app-arch/cpio/files/cpio-2.6-dirTraversal.patch | 199 | ||||
-rw-r--r-- | app-arch/cpio/files/cpio-2.6-gcc4-tests.patch | 13 | ||||
-rw-r--r-- | app-arch/cpio/files/cpio-2.6-stpcpy-hack.patch | 50 | ||||
-rw-r--r-- | app-arch/cpio/files/cpio-2.6-warnings.patch | 174 | ||||
-rw-r--r-- | app-arch/cpio/files/cpio-2.6-writeOutHeaderBufferOverflow.patch | 560 | ||||
-rw-r--r-- | app-arch/cpio/files/digest-cpio-2.6-r5 | 3 | ||||
-rw-r--r-- | app-arch/cpio/files/digest-cpio-2.7-r1 | 3 |
15 files changed, 0 insertions, 1432 deletions
diff --git a/app-arch/cpio/cpio-2.6-r5.ebuild b/app-arch/cpio/cpio-2.6-r5.ebuild deleted file mode 100644 index 345196475406..000000000000 --- a/app-arch/cpio/cpio-2.6-r5.ebuild +++ /dev/null @@ -1,52 +0,0 @@ -# Copyright 1999-2006 Gentoo Foundation -# Distributed under the terms of the GNU General Public License v2 -# $Header: /var/cvsroot/gentoo-x86/app-arch/cpio/cpio-2.6-r5.ebuild,v 1.16 2007/06/26 01:32:19 mr_bones_ Exp $ - -inherit eutils - -DESCRIPTION="A file archival tool which can also read and write tar files" -HOMEPAGE="http://www.gnu.org/software/cpio/cpio.html" -SRC_URI="mirror://gnu/cpio/${P}.tar.bz2" - -LICENSE="GPL-2" -SLOT="0" -KEYWORDS="alpha amd64 arm hppa ia64 m68k mips ppc ppc64 s390 sh sparc ~sparc-fbsd x86 ~x86-fbsd" -IUSE="nls" - -DEPEND="" - -src_unpack() { - unpack ${A} - cd "${S}" - epatch "${FILESDIR}"/${PV}-rili-big-files.patch #68520 - epatch "${FILESDIR}"/${PV}-isnumber.patch #74929 - epatch "${FILESDIR}"/${PV}-umask.patch #79844 - epatch "${FILESDIR}"/${PV}-lstat.patch #80246 - epatch "${FILESDIR}"/${P}-chmodRaceC.patch #90619 - epatch "${FILESDIR}"/${P}-gcc4-tests.patch #89123 - epatch "${FILESDIR}"/${P}-dirTraversal.patch #90619 - epatch "${FILESDIR}"/${P}-checksum.patch - epatch "${FILESDIR}"/${P}-warnings.patch - epatch "${FILESDIR}"/${P}-writeOutHeaderBufferOverflow.patch #112140 - epatch "${FILESDIR}"/${P}-stpcpy-hack.patch #123237 -} - -src_compile() { - # The configure script has a useless check for gethostname in - # libnsl ... but cpio doesn't utilize the lib/func anywhere, - # so let's force the lib to not be detected - ac_cv_lib_nsl_gethostname=no \ - econf \ - $(use_enable nls) \ - --bindir=/bin \ - --with-rmt=/usr/sbin/rmt \ - || die - emake || die -} - -src_install() { - make install DESTDIR="${D}" || die - dodoc ChangeLog NEWS README INSTALL - rm -f "${D}"/usr/share/man/man1/mt.1 - rmdir "${D}"/usr/libexec || die -} diff --git a/app-arch/cpio/cpio-2.7-r1.ebuild b/app-arch/cpio/cpio-2.7-r1.ebuild deleted file mode 100644 index 8714f1dc0783..000000000000 --- a/app-arch/cpio/cpio-2.7-r1.ebuild +++ /dev/null @@ -1,38 +0,0 @@ -# Copyright 1999-2007 Gentoo Foundation -# Distributed under the terms of the GNU General Public License v2 -# $Header: /var/cvsroot/gentoo-x86/app-arch/cpio/cpio-2.7-r1.ebuild,v 1.10 2007/06/23 02:34:05 dsd Exp $ - -inherit eutils - -DESCRIPTION="A file archival tool which can also read and write tar files" -HOMEPAGE="http://www.gnu.org/software/cpio/cpio.html" -SRC_URI="mirror://gnu/cpio/${P}.tar.bz2" - -LICENSE="GPL-2" -SLOT="0" -KEYWORDS="~alpha amd64 arm hppa ia64 m68k mips ppc ppc64 s390 sh ~sparc ~sparc-fbsd x86 ~x86-fbsd" -IUSE="nls" - -DEPEND="" - -src_unpack() { - unpack ${A} - cd "${S}" - epatch "${FILESDIR}"/${PN}-2.7-link-terminate.patch #153782 -} - -src_compile() { - econf \ - $(use_enable nls) \ - --bindir=/bin \ - --with-rmt=/usr/sbin/rmt \ - || die - emake || die -} - -src_install() { - emake install DESTDIR="${D}" || die - dodoc ChangeLog NEWS README - rm -f "${D}"/usr/share/man/man1/mt.1 - rmdir "${D}"/usr/libexec || die -} diff --git a/app-arch/cpio/files/2.6-isnumber.patch b/app-arch/cpio/files/2.6-isnumber.patch deleted file mode 100644 index f3d61862bc2e..000000000000 --- a/app-arch/cpio/files/2.6-isnumber.patch +++ /dev/null @@ -1,34 +0,0 @@ -On systems which define a macro 'isnumber()', cpio goes kaboom! -OS X is on example of where this happens. -http://bugs.gentoo.org/show_bug.cgi?id=74929 - -diff -uNr cpio-2.5.90.orig/src/userspec.c cpio-2.5.90/src/userspec.c ---- cpio-2.5.90.orig/src/userspec.c Wed Dec 29 13:51:30 2004 -+++ cpio-2.5.90/src/userspec.c Wed Dec 29 13:52:13 2004 -@@ -72,7 +72,7 @@ - otherwise return 0. */ - - static int --isnumber (const char *str) -+cpio_isnumber (const char *str) - { - for (; *str; str++) - if (!isdigit (*str)) -@@ -136,7 +136,7 @@ - if (pwd == NULL) - { - -- if (!isnumber (u)) -+ if (!cpio_isnumber (u)) - error_msg = _("invalid user"); - else - { -@@ -182,7 +182,7 @@ - grp = getgrnam (g); - if (grp == NULL) - { -- if (!isnumber (g)) -+ if (!cpio_isnumber (g)) - error_msg = _("invalid group"); - else - *gid = atoi (g); diff --git a/app-arch/cpio/files/2.6-lstat.patch b/app-arch/cpio/files/2.6-lstat.patch deleted file mode 100644 index e9478d6af357..000000000000 --- a/app-arch/cpio/files/2.6-lstat.patch +++ /dev/null @@ -1,28 +0,0 @@ -cpio is acting as if always invoked with -L (copy the file that a symlink -points to, rather the symlink itself) -reason: missing check for lstat function in configure script -see: http://lists.gnu.org/archive/html/bug-cpio/2005-01/msg00003.html - http://bugs.gentoo.org/show_bug.cgi?id=80246 - ---- cpio-2.6-orig/config.h.in -+++ cpio-2.6/config.h.in -@@ -310,6 +310,9 @@ - /* Define to 1 if you have the <unistd.h> header file. */ - #undef HAVE_UNISTD_H - -+/* Define to 1 if you have the `lstat' function. */ -+#undef HAVE_LSTAT -+ - /* Define to 1 if you have the <utime.h> header file. */ - #undef HAVE_UTIME_H - ---- cpio-2.6-orig/configure -+++ cpio-2.6/configure -@@ -1321,6 +1321,7 @@ - gl_func_list="$gl_func_list iswprint" - gl_func_list="$gl_func_list mbsinit" - gl_header_list="$gl_header_list unistd.h" -+gl_func_list="$gl_func_list lstat" - - - diff --git a/app-arch/cpio/files/2.6-rili-big-files.patch b/app-arch/cpio/files/2.6-rili-big-files.patch deleted file mode 100644 index 281e8e886c37..000000000000 --- a/app-arch/cpio/files/2.6-rili-big-files.patch +++ /dev/null @@ -1,80 +0,0 @@ -cpio normally can't cope with huge files on 32bit systems (2gig), -so why don't we fix that eh ? -http://bugs.gentoo.org/show_bug.cgi?id=68520 - -Index: src/extern.h -=================================================================== -RCS file: /cvsroot/cpio/cpio/src/extern.h,v -retrieving revision 1.3 -diff -u -r1.3 extern.h ---- src/extern.h 8 Sep 2004 11:41:40 -0000 1.3 -+++ src/extern.h 17 Dec 2004 19:34:41 -0000 -@@ -165,9 +165,9 @@ - void tape_buffered_read P_((char *in_buf, int in_des, long num_bytes)); - int tape_buffered_peek P_((char *peek_buf, int in_des, int num_bytes)); - void tape_toss_input P_((int in_des, long num_bytes)); --void copy_files_tape_to_disk P_((int in_des, int out_des, long num_bytes)); --void copy_files_disk_to_tape P_((int in_des, int out_des, long num_bytes, char *filename)); --void copy_files_disk_to_disk P_((int in_des, int out_des, long num_bytes, char *filename)); -+void copy_files_tape_to_disk P_((int in_des, int out_des, off_t num_bytes)); -+void copy_files_disk_to_tape P_((int in_des, int out_des, off_t num_bytes, char *filename)); -+void copy_files_disk_to_disk P_((int in_des, int out_des, off_t num_bytes, char *filename)); - void warn_if_file_changed P_((char *file_name, unsigned long old_file_size, - unsigned long old_file_mtime)); - void create_all_directories P_((char *name)); -Index: src/util.c -=================================================================== -RCS file: /cvsroot/cpio/cpio/src/util.c,v -retrieving revision 1.6 -diff -u -r1.6 util.c ---- src/util.c 8 Sep 2004 11:45:38 -0000 1.6 -+++ src/util.c 17 Dec 2004 19:34:42 -0000 -@@ -428,10 +428,10 @@ - NUM_BYTES is the number of bytes to copy. */ - - void --copy_files_tape_to_disk (int in_des, int out_des, long num_bytes) -+copy_files_tape_to_disk (int in_des, int out_des, off_t num_bytes) - { -- long size; -- long k; -+ off_t size; -+ off_t k; - - while (num_bytes > 0) - { -@@ -458,13 +458,13 @@ - NUM_BYTES is the number of bytes to copy. */ - - void --copy_files_disk_to_tape (int in_des, int out_des, long num_bytes, -+copy_files_disk_to_tape (int in_des, int out_des, off_t num_bytes, - char *filename) - { -- long size; -- long k; -+ off_t size; -+ off_t k; - int rc; -- long original_num_bytes; -+ off_t original_num_bytes; - - original_num_bytes = num_bytes; - -@@ -505,12 +505,12 @@ - NUM_BYTES is the number of bytes to copy. */ - - void --copy_files_disk_to_disk (int in_des, int out_des, long num_bytes, -+copy_files_disk_to_disk (int in_des, int out_des, off_t num_bytes, - char *filename) - { -- long size; -- long k; -- long original_num_bytes; -+ off_t size; -+ off_t k; -+ off_t original_num_bytes; - int rc; - - original_num_bytes = num_bytes; diff --git a/app-arch/cpio/files/2.6-umask.patch b/app-arch/cpio/files/2.6-umask.patch deleted file mode 100644 index 585e549c539e..000000000000 --- a/app-arch/cpio/files/2.6-umask.patch +++ /dev/null @@ -1,38 +0,0 @@ -Fix for a wicked old bug (we're talking 1999 here ... that's like -6 years ago ... we should party like it's 1999, but eh, you know). -It seems FreeBSD peeps fixed it in their tree and neglected to tell -the GNU peeps that this issue existed. Not like it matters, who -the hell uses cpio anymore anyways ;). Enough rambling: - -cpio -O ignores the current umask when creating output files. -The output file is being created with mode 0666. - -FreeBSD PR: http://www.freebsd.org/cgi/query-pr.cgi?pr=bin/1391 -CAN-1999-1572: http://cve.mitre.org/cgi-bin/cvename.cgi?name=CAN-1999-1572 -FreeBSD CVS Diff: http://www.freebsd.org/cgi/cvsweb.cgi/src/contrib/cpio/main.c.diff?r1=1.1&r2=1.2 -Gentoo Bug: http://bugs.gentoo.org/show_bug.cgi?id=79844 -GNU Bug: http://savannah.gnu.org/patch/index.php?func=detailitem&item_id=3690 - -Index: src/main.c -=================================================================== -RCS file: /cvsroot/cpio/cpio/src/main.c,v -retrieving revision 1.7 -diff -u -r1.7 main.c ---- src/main.c 23 Nov 2004 02:05:27 -0000 1.7 -+++ src/main.c 29 Jan 2005 04:37:18 -0000 -@@ -740,7 +740,6 @@ - textdomain (PACKAGE); - - program_name = argv[0]; -- umask (0); - - #ifdef __TURBOC__ - _fmode = O_BINARY; /* Put stdin and stdout in binary mode. */ -@@ -751,6 +750,7 @@ - #endif - - process_args (argc, argv); -+ umask (0); - - initialize_buffers (); - diff --git a/app-arch/cpio/files/cpio-2.6-checksum.patch b/app-arch/cpio/files/cpio-2.6-checksum.patch deleted file mode 100644 index 0612e0e140ba..000000000000 --- a/app-arch/cpio/files/cpio-2.6-checksum.patch +++ /dev/null @@ -1,35 +0,0 @@ -Ripped from Fedora - ---- cpio-2.6/src/extern.h.checksum 2005-10-26 11:17:11.000000000 +0200 -+++ cpio-2.6/src/extern.h 2005-10-26 11:15:42.000000000 +0200 -@@ -66,7 +66,7 @@ - extern int archive_des; - extern char *archive_name; - extern char *rsh_command_option; --extern unsigned long crc; -+extern unsigned int crc; - extern int delayed_seek_count; - #ifdef DEBUG_CPIO - extern int debug_flag; ---- cpio-2.6/src/copyout.c.checksum 2005-10-26 11:17:11.000000000 +0200 -+++ cpio-2.6/src/copyout.c 2005-10-26 11:20:01.000000000 +0200 -@@ -311,7 +311,7 @@ - file_hdr->c_gid, file_hdr->c_nlink, file_hdr->c_mtime, - file_hdr->c_filesize, file_hdr->c_dev_maj, file_hdr->c_dev_min, - file_hdr->c_rdev_maj, file_hdr->c_rdev_min, file_hdr->c_namesize, -- file_hdr->c_chksum); -+ file_hdr->c_chksum & 0xffffffff); - tape_buffered_write (ascii_header, out_des, 110L); - - /* Write file name to output. */ ---- cpio-2.6/src/global.c.checksum 2005-10-26 11:17:11.000000000 +0200 -+++ cpio-2.6/src/global.c 2005-10-26 11:15:29.000000000 +0200 -@@ -139,7 +139,7 @@ - char *rsh_command_option = NULL; - - /* CRC checksum. */ --unsigned long crc; -+unsigned int crc; - - /* Input and output buffers. */ - char *input_buffer, *output_buffer; diff --git a/app-arch/cpio/files/cpio-2.6-chmodRaceC.patch b/app-arch/cpio/files/cpio-2.6-chmodRaceC.patch deleted file mode 100644 index 6d9dd1fe6c79..000000000000 --- a/app-arch/cpio/files/cpio-2.6-chmodRaceC.patch +++ /dev/null @@ -1,125 +0,0 @@ -Ripped from Fedora. - -http://bugs.gentoo.org/90619 - ---- cpio-2.6/src/copyin.c.chmodRaceC 2005-04-25 13:19:34.079310381 +0200 -+++ cpio-2.6/src/copyin.c 2005-04-25 14:09:32.514889697 +0200 -@@ -389,19 +389,26 @@ - continue; - } - -- if (close (out_file_des) < 0) -- error (0, errno, "%s", d->header.c_name); -- -+ /* -+ * Avoid race condition. -+ * Set chown and chmod before closing the file desc. -+ * pvrabec@redhat.com -+ */ -+ - /* File is now copied; set attributes. */ - if (!no_chown_flag) -- if ((chown (d->header.c_name, -+ if ((fchown (out_file_des, - set_owner_flag ? set_owner : d->header.c_uid, - set_group_flag ? set_group : d->header.c_gid) < 0) - && errno != EPERM) - error (0, errno, "%s", d->header.c_name); - /* chown may have turned off some permissions we wanted. */ -- if (chmod (d->header.c_name, (int) d->header.c_mode) < 0) -+ if (fchmod (out_file_des, (int) d->header.c_mode) < 0) -+ error (0, errno, "%s", d->header.c_name); -+ -+ if (close (out_file_des) < 0) - error (0, errno, "%s", d->header.c_name); -+ - if (retain_time_flag) - { - times.actime = times.modtime = d->header.c_mtime; -@@ -557,6 +564,25 @@ - write (out_file_des, "", 1); - delayed_seek_count = 0; - } -+ -+ /* -+ * Avoid race condition. -+ * Set chown and chmod before closing the file desc. -+ * pvrabec@redhat.com -+ */ -+ -+ /* File is now copied; set attributes. */ -+ if (!no_chown_flag) -+ if ((fchown (out_file_des, -+ set_owner_flag ? set_owner : file_hdr->c_uid, -+ set_group_flag ? set_group : file_hdr->c_gid) < 0) -+ && errno != EPERM) -+ error (0, errno, "%s", file_hdr->c_name); -+ -+ /* chown may have turned off some permissions we wanted. */ -+ if (fchmod (out_file_des, (int) file_hdr->c_mode) < 0) -+ error (0, errno, "%s", file_hdr->c_name); -+ - if (close (out_file_des) < 0) - error (0, errno, "%s", file_hdr->c_name); - -@@ -567,18 +593,6 @@ - file_hdr->c_name, crc, file_hdr->c_chksum); - } - -- /* File is now copied; set attributes. */ -- if (!no_chown_flag) -- if ((chown (file_hdr->c_name, -- set_owner_flag ? set_owner : file_hdr->c_uid, -- set_group_flag ? set_group : file_hdr->c_gid) < 0) -- && errno != EPERM) -- error (0, errno, "%s", file_hdr->c_name); -- -- /* chown may have turned off some permissions we wanted. */ -- if (chmod (file_hdr->c_name, (int) file_hdr->c_mode) < 0) -- error (0, errno, "%s", file_hdr->c_name); -- - if (retain_time_flag) - { - struct utimbuf times; /* For setting file times. */ -@@ -589,7 +603,7 @@ - if (utime (file_hdr->c_name, ×) < 0) - error (0, errno, "%s", file_hdr->c_name); - } -- -+ - tape_skip_padding (in_file_des, file_hdr->c_filesize); - if (file_hdr->c_nlink > 1 - && (archive_format == arf_newascii || archive_format == arf_crcascii) ) ---- cpio-2.6/src/copypass.c.chmodRaceC 2004-09-06 14:09:04.000000000 +0200 -+++ cpio-2.6/src/copypass.c 2005-04-25 14:09:38.135076926 +0200 -@@ -181,19 +181,25 @@ - } - if (close (in_file_des) < 0) - error (0, errno, "%s", input_name.ds_string); -- if (close (out_file_des) < 0) -- error (0, errno, "%s", output_name.ds_string); -- -+ /* -+ * Avoid race condition. -+ * Set chown and chmod before closing the file desc. -+ * pvrabec@redhat.com -+ */ - /* Set the attributes of the new file. */ - if (!no_chown_flag) -- if ((chown (output_name.ds_string, -+ if ((fchown (out_file_des, - set_owner_flag ? set_owner : in_file_stat.st_uid, - set_group_flag ? set_group : in_file_stat.st_gid) < 0) - && errno != EPERM) - error (0, errno, "%s", output_name.ds_string); - /* chown may have turned off some permissions we wanted. */ -- if (chmod (output_name.ds_string, in_file_stat.st_mode) < 0) -+ if (fchmod (out_file_des, in_file_stat.st_mode) < 0) -+ error (0, errno, "%s", output_name.ds_string); -+ -+ if (close (out_file_des) < 0) - error (0, errno, "%s", output_name.ds_string); -+ - if (reset_time_flag) - { - times.actime = in_file_stat.st_atime; diff --git a/app-arch/cpio/files/cpio-2.6-dirTraversal.patch b/app-arch/cpio/files/cpio-2.6-dirTraversal.patch deleted file mode 100644 index c1b75d71bfb5..000000000000 --- a/app-arch/cpio/files/cpio-2.6-dirTraversal.patch +++ /dev/null @@ -1,199 +0,0 @@ -* Tue May 17 2005 Peter Vrabec <pvrabec@redhat.com> 2.6-7 -- fix #156314 (CAN-2005-1229) cpio directory traversal issue - -http://bugs.gentoo.org/show_bug.cgi?id=90619 -http://www.securityfocus.com/archive/1/396429/2005-04-18/2005-04-24/0 - ---- cpio-2.6/doc/cpio.1 -+++ cpio-2.6/doc/cpio.1 -@@ -20,7 +20,7 @@ - [\-\-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] [\-\-sparse] -+[\-\-force\-local] [\-\-absolute\-filenames] [\-\-sparse] - [\-\-only\-verify\-crc] [\-\-quiet] [\-\-rsh-command=command] [\-\-help] - [\-\-version] [pattern...] [< archive] - ---- cpio-2.6/doc/cpio.info -+++ cpio-2.6/doc/cpio.info -@@ -203,7 +203,7 @@ - [--swap-halfwords] [--io-size=bytes] [--pattern-file=file] - [--format=format] [--owner=[user][:.][group]] - [--no-preserve-owner] [--message=message] [--help] [--version] -- [-no-absolute-filenames] [--sparse] [-only-verify-crc] [-quiet] -+ [--absolute-filenames] [--sparse] [-only-verify-crc] [-quiet] - [--rsh-command=command] [pattern...] [< archive] - - -@@ -359,9 +359,9 @@ - Show numeric UID and GID instead of translating them into names - when using the `--verbose option'. - --`--no-absolute-filenames' -- Create all files relative to the current directory in copy-in -- mode, even if they have an absolute file name in the archive. -+`--absolute-filenames' -+ Do not strip leading file name components that contain ".." -+ and leading slashes from file names in copy-in mode - - `--no-preserve-owner' - Do not change the ownership of the files; leave them owned by the ---- cpio-2.6/src/main.c -+++ cpio-2.6/src/main.c -@@ -41,6 +41,7 @@ - - enum cpio_options { - NO_ABSOLUTE_FILENAMES_OPTION=256, -+ ABSOLUTE_FILENAMES_OPTION, - NO_PRESERVE_OWNER_OPTION, - ONLY_VERIFY_CRC_OPTION, - RENAME_BATCH_FILE_OPTION, -@@ -134,6 +135,8 @@ - N_("In copy-in mode, read additional patterns specifying filenames to extract or list from FILE"), 210}, - {"no-absolute-filenames", NO_ABSOLUTE_FILENAMES_OPTION, 0, 0, - N_("Create all files relative to the current directory"), 210}, -+ {"absolute-filenames", ABSOLUTE_FILENAMES_OPTION, 0, 0, -+ N_("do not strip leading file name components that contain \"..\" and leading slashes from file names"), 210}, - {"only-verify-crc", ONLY_VERIFY_CRC_OPTION, 0, 0, - N_("When reading a CRC format archive in copy-in mode, only verify the CRC's of each file in the archive, don't actually extract the files"), 210}, - {"rename", 'r', 0, 0, -@@ -393,7 +396,11 @@ - break; - - case NO_ABSOLUTE_FILENAMES_OPTION: /* --no-absolute-filenames */ -- no_abs_paths_flag = true; -+ abs_paths_flag = false; -+ break; -+ -+ case ABSOLUTE_FILENAMES_OPTION: /* --absolute-filenames */ -+ abs_paths_flag = true; - break; - - case NO_PRESERVE_OWNER_OPTION: /* --no-preserve-owner */ -@@ -632,7 +639,7 @@ - _("--append is used but no archive file name is given (use -F or -O options"))); - - CHECK_USAGE(rename_batch_file, "--rename-batch-file", "--create"); -- CHECK_USAGE(no_abs_paths_flag, "--no-absolute-pathnames", "--create"); -+ CHECK_USAGE(abs_paths_flag, "--absolute-pathnames", "--create"); - CHECK_USAGE(input_archive_name, "-I", "--create"); - if (archive_name && output_archive_name) - USAGE_ERROR ((0, 0, _("Both -O and -F are used in copy-out mode"))); -@@ -659,7 +666,7 @@ - CHECK_USAGE(rename_flag, "--rename", "--pass-through"); - CHECK_USAGE(append_flag, "--append", "--pass-through"); - CHECK_USAGE(rename_batch_file, "--rename-batch-file", "--pass-through"); -- CHECK_USAGE(no_abs_paths_flag, "--no-absolute-pathnames", -+ CHECK_USAGE(abs_paths_flag, "--absolute-pathnames", - "--pass-through"); - CHECK_USAGE(to_stdout_option, "--to-stdout", "--pass-through"); - ---- cpio-2.6/src/copyin.c -+++ cpio-2.6/src/copyin.c -@@ -25,6 +25,7 @@ - #include "dstring.h" - #include "extern.h" - #include "defer.h" -+#include "dirname.h" - #include <rmt.h> - #ifndef FNM_PATHNAME - #include <fnmatch.h> -@@ -1349,6 +1350,53 @@ - } - } - -+/* Return a safer suffix of FILE_NAME, or "." if it has no safer -+ suffix. Check for fully specified file names and other atrocities. */ -+ -+static const char * -+safer_name_suffix (char const *file_name) -+{ -+ char const *p; -+ -+ /* Skip file system prefixes, leading file name components that contain -+ "..", and leading slashes. */ -+ -+ size_t prefix_len = FILE_SYSTEM_PREFIX_LEN (file_name); -+ -+ for (p = file_name + prefix_len; *p;) -+ { -+ if (p[0] == '.' && p[1] == '.' && (ISSLASH (p[2]) || !p[2])) -+ prefix_len = p + 2 - file_name; -+ -+ do -+ { -+ char c = *p++; -+ if (ISSLASH (c)) -+ break; -+ } -+ while (*p); -+ } -+ -+ for (p = file_name + prefix_len; ISSLASH (*p); p++) -+ continue; -+ prefix_len = p - file_name; -+ -+ if (prefix_len) -+ { -+ char *prefix = alloca (prefix_len + 1); -+ memcpy (prefix, file_name, prefix_len); -+ prefix[prefix_len] = '\0'; -+ -+ -+ error (0, 0, _("Removing leading `%s' from member names"), prefix); -+ } -+ -+ if (!*p) -+ p = "."; -+ -+ return p; -+} -+ - /* Read the collection from standard input and create files - in the file system. */ - -@@ -1459,18 +1507,11 @@ - - /* Do we have to ignore absolute paths, and if so, does the filename - have an absolute path? */ -- if (no_abs_paths_flag && file_hdr.c_name && file_hdr.c_name [0] == '/') -+ if (!abs_paths_flag && file_hdr.c_name && file_hdr.c_name [0]) - { -- char *p; -+ const char *p = safer_name_suffix (file_hdr.c_name); - -- p = file_hdr.c_name; -- while (*p == '/') -- ++p; -- if (*p == '\0') -- { -- strcpy (file_hdr.c_name, "."); -- } -- else -+ if (p != file_hdr.c_name) - { - /* Debian hack: file_hrd.c_name is sometimes set to - point to static memory by code in tar.c. This ---- cpio-2.6/src/extern.h -+++ cpio-2.6/src/extern.h -@@ -46,7 +46,7 @@ - extern int sparse_flag; - extern int quiet_flag; - extern int only_verify_crc_flag; --extern int no_abs_paths_flag; -+extern int abs_paths_flag; - extern unsigned int warn_option; - - /* Values for warn_option */ ---- cpio-2.6/src/global.c -+++ cpio-2.6/src/global.c -@@ -100,7 +100,7 @@ - int only_verify_crc_flag = false; - - /* If true, don't use any absolute paths, prefix them by `./'. */ --int no_abs_paths_flag = false; -+int abs_paths_flag = false; - - #ifdef DEBUG_CPIO - /* If true, print debugging information. */ diff --git a/app-arch/cpio/files/cpio-2.6-gcc4-tests.patch b/app-arch/cpio/files/cpio-2.6-gcc4-tests.patch deleted file mode 100644 index 554478a2227a..000000000000 --- a/app-arch/cpio/files/cpio-2.6-gcc4-tests.patch +++ /dev/null @@ -1,13 +0,0 @@ -Rip out small change from upstream to fix building with GCC4. - -http://bugs.gentoo.org/show_bug.cgi?id=89123 - ---- tests/genfile.c -+++ tests/genfile.c -@@ -62,3 +69,3 @@ - --static const char *argp_program_version = "genfile (" PACKAGE ") " VERSION; --static const char *argp_program_bug_address = "<" PACKAGE_BUGREPORT ">"; -+const char *argp_program_version = "genfile (" PACKAGE ") " VERSION; -+const char *argp_program_bug_address = "<" PACKAGE_BUGREPORT ">"; - static char doc[] = N_("genfile generates data files for GNU paxutils test suite"); diff --git a/app-arch/cpio/files/cpio-2.6-stpcpy-hack.patch b/app-arch/cpio/files/cpio-2.6-stpcpy-hack.patch deleted file mode 100644 index c5f0d855a8c0..000000000000 --- a/app-arch/cpio/files/cpio-2.6-stpcpy-hack.patch +++ /dev/null @@ -1,50 +0,0 @@ -This is a hack to provide stpcpy on systems where the system libc does -not provide the function. Upstream has incorporated a proper fix that -utilizes gnulib; we use this version instead because it is much smaller. - -Patch by Benigno B. Junior - -http://bugs.gentoo.org/123237 - ---- cpio-2.6/configure -+++ cpio-2.6/configure -@@ -11727,7 +11726,7 @@ - - - --for ac_func in bcopy mkdir strdup strerror -+for ac_func in bcopy mkdir strdup strerror stpcpy - do - as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` - echo "$as_me:$LINENO: checking for $ac_func" >&5 ---- cpio-2.6/config.h.in -+++ cpio-2.6/config.h.in -@@ -251,6 +251,9 @@ - /* Define to 1 if you have the <stdlib.h> header file. */ - #undef HAVE_STDLIB_H - -+/* Define to 1 if you have the `stpcpy' function. */ -+#undef HAVE_STPCPY -+ - /* Define to 1 if you have the `strcasecmp' function. */ - #undef HAVE_STRCASECMP - ---- cpio-2.6/src/copyout.c -+++ cpio-2.6/src/copyout.c -@@ -356,7 +356,16 @@ - char ascii_header[110]; - char *p; - -+#ifdef HAVE_STPCPY - p = stpcpy (ascii_header, magic_string); -+#else -+ { -+ unsigned long __length = strlen (magic_string); -+ memcpy (ascii_header, magic_string, __length); -+ p += __length; -+ } -+#endif -+ - to_ascii_or_warn (p, file_hdr->c_ino, 8, LG_16, - file_hdr->c_name, _("inode number")); - p += 8; diff --git a/app-arch/cpio/files/cpio-2.6-warnings.patch b/app-arch/cpio/files/cpio-2.6-warnings.patch deleted file mode 100644 index 1d76c1d52d66..000000000000 --- a/app-arch/cpio/files/cpio-2.6-warnings.patch +++ /dev/null @@ -1,174 +0,0 @@ -Ripped from upstream - -2005-05-04 Dmitry V. Levin <ldv@altlinux.org> - - Deal with compilation warnings generated by gcc compiler. - - * src/copyin.c (list_file, copyin_regular_file, long_format, - process_copy_in): Fix format strings. - (create_defered_links_to_skipped): Remove unused variable - `link_res'. - (process_copy_in): Initialize tty_in, tty_out and rename_in. - * src/copyout.c (write_out_header): Initialize dev along with - rdev. - * src/tar.c (is_tar_filename_too_long): Remove unused variable `p'; - * src/util.c: Include <safe-read.h> and <full-write.h> - (sparse_write): Add forward declaration. Initialize write_count - and cur_write_start variables. - (copy_files_disk_to_tape, copy_files_disk_to_disk): Add - parentheses around assignment. - -diff -uprk.orig cpio-2.6.orig/src/copyin.c cpio-2.6/src/copyin.c ---- cpio-2.6.orig/src/copyin.c 2004-09-08 11:10:02 +0000 -+++ cpio-2.6/src/copyin.c 2005-05-04 12:43:42 +0000 -@@ -176,7 +176,7 @@ list_file(struct new_cpio_header* file_h - #endif - if (crc != file_hdr->c_chksum) - { -- error (0, 0, _("%s: checksum error (0x%x, should be 0x%x)"), -+ error (0, 0, _("%s: checksum error (0x%lx, should be 0x%lx)"), - file_hdr->c_name, crc, file_hdr->c_chksum); - } - } -@@ -307,7 +307,6 @@ create_defered_links_to_skipped (struct - int ino; - int maj; - int min; -- int link_res; - if (file_hdr->c_filesize == 0) - { - /* The file doesn't have any data attached to it so we don't have -@@ -541,7 +540,7 @@ copyin_regular_file (struct new_cpio_hea - if (archive_format == arf_crcascii) - { - if (crc != file_hdr->c_chksum) -- error (0, 0, _("%s: checksum error (0x%x, should be 0x%x)"), -+ error (0, 0, _("%s: checksum error (0x%lx, should be 0x%lx)"), - file_hdr->c_name, crc, file_hdr->c_chksum); - } - tape_skip_padding (in_file_des, file_hdr->c_filesize); -@@ -563,7 +562,7 @@ copyin_regular_file (struct new_cpio_hea - if (archive_format == arf_crcascii) - { - if (crc != file_hdr->c_chksum) -- error (0, 0, _("%s: checksum error (0x%x, should be 0x%x)"), -+ error (0, 0, _("%s: checksum error (0x%lx, should be 0x%lx)"), - file_hdr->c_name, crc, file_hdr->c_chksum); - } - -@@ -897,7 +896,7 @@ long_format (struct new_cpio_header *fil - } - tbuf[16] = '\0'; - -- printf ("%s %3u ", mbuf, file_hdr->c_nlink); -+ printf ("%s %3lu ", mbuf, file_hdr->c_nlink); - - if (numeric_uid) - printf ("%-8u %-8u ", (unsigned int) file_hdr->c_uid, -@@ -908,7 +907,7 @@ long_format (struct new_cpio_header *fil - - if ((file_hdr->c_mode & CP_IFMT) == CP_IFCHR - || (file_hdr->c_mode & CP_IFMT) == CP_IFBLK) -- printf ("%3u, %3u ", file_hdr->c_rdev_maj, -+ printf ("%3lu, %3lu ", file_hdr->c_rdev_maj, - file_hdr->c_rdev_min); - else - printf ("%8lu ", file_hdr->c_filesize); -@@ -1342,9 +1341,9 @@ void - process_copy_in () - { - char done = false; /* True if trailer reached. */ -- FILE *tty_in; /* Interactive file for rename option. */ -- FILE *tty_out; /* Interactive file for rename option. */ -- FILE *rename_in; /* Batch file for rename option. */ -+ FILE *tty_in = NULL; /* Interactive file for rename option. */ -+ FILE *tty_out = NULL; /* Interactive file for rename option. */ -+ FILE *rename_in = NULL; /* Batch file for rename option. */ - struct stat file_stat; /* Output file stat record. */ - struct new_cpio_header file_hdr; /* Output header information. */ - int in_file_des; /* Input file descriptor. */ -@@ -1530,7 +1529,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%x, should be 0x%x)"), -+ error (0, 0, _("%s: checksum error (0x%lx, should be 0x%lx)"), - file_hdr.c_name, crc, file_hdr.c_chksum); - } - /* Debian hack: -v and -V now work with --only-verify-crc. -diff -uprk.orig cpio-2.6.orig/src/copyout.c cpio-2.6/src/copyout.c ---- cpio-2.6.orig/src/copyout.c 2004-10-14 09:14:03 +0000 -+++ cpio-2.6/src/copyout.c 2005-05-04 12:41:08 +0000 -@@ -346,7 +346,7 @@ write_out_header (struct new_cpio_header - #endif - file_hdr->c_filesize = makedev (file_hdr->c_rdev_maj, - file_hdr->c_rdev_min); -- rdev = 1; -+ dev = rdev = 1; - break; - default: - dev = makedev (file_hdr->c_dev_maj, file_hdr->c_dev_min); -diff -uprk.orig cpio-2.6.orig/src/tar.c cpio-2.6/src/tar.c ---- cpio-2.6.orig/src/tar.c 2004-10-14 09:33:41 +0000 -+++ cpio-2.6/src/tar.c 2005-05-04 12:41:47 +0000 -@@ -473,7 +473,6 @@ is_tar_filename_too_long (char *name) - { - int whole_name_len; - int prefix_name_len; -- char *p; - - whole_name_len = strlen (name); - if (whole_name_len <= TARNAMESIZE) -diff -uprk.orig cpio-2.6.orig/src/util.c cpio-2.6/src/util.c ---- cpio-2.6.orig/src/util.c 2004-09-08 10:44:49 +0000 -+++ cpio-2.6/src/util.c 2005-05-04 13:13:24 +0000 -@@ -24,6 +24,8 @@ - #include "dstring.h" - #include "extern.h" - #include <rmt.h> -+#include <safe-read.h> -+#include <full-write.h> - - #include <sys/ioctl.h> - -@@ -38,6 +40,8 @@ - extern int errno; - #endif - -+int sparse_write (int fildes, char *buf, unsigned int nbyte); -+ - /* Write `output_size' bytes of `output_buffer' to file - descriptor OUT_DES and reset `output_size' and `out_buff'. */ - -@@ -471,9 +475,9 @@ copy_files_disk_to_tape (int in_des, int - while (num_bytes > 0) - { - if (input_size == 0) -- if (rc = disk_fill_input_buffer (in_des, -+ if ((rc = disk_fill_input_buffer (in_des, - num_bytes < DISK_IO_BLOCK_SIZE ? -- num_bytes : DISK_IO_BLOCK_SIZE)) -+ num_bytes : DISK_IO_BLOCK_SIZE))) - { - if (rc > 0) - error (0, 0, _("File %s shrunk by %ld bytes, padding with zeros"), -@@ -517,7 +521,7 @@ copy_files_disk_to_disk (int in_des, int - while (num_bytes > 0) - { - if (input_size == 0) -- if (rc = disk_fill_input_buffer (in_des, num_bytes)) -+ if ((rc = disk_fill_input_buffer (in_des, num_bytes))) - { - if (rc > 0) - error (0, 0, _("File %s shrunk by %ld bytes, padding with zeros"), -@@ -1157,8 +1161,8 @@ sparse_write (int fildes, char *buf, uns - int complete_block_count; - int leftover_bytes_count; - int seek_count; -- int write_count; -- char *cur_write_start; -+ int write_count = 0; -+ char *cur_write_start = buf; - int lseek_rc; - int write_rc; - int i; diff --git a/app-arch/cpio/files/cpio-2.6-writeOutHeaderBufferOverflow.patch b/app-arch/cpio/files/cpio-2.6-writeOutHeaderBufferOverflow.patch deleted file mode 100644 index 95bd0e3cfbc2..000000000000 --- a/app-arch/cpio/files/cpio-2.6-writeOutHeaderBufferOverflow.patch +++ /dev/null @@ -1,560 +0,0 @@ -Ripped from Fedora who ripped from upstream - -https://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=172669 -http://bugs.gentoo.org/112140 - ---- cpio-2.6/src/copyout.c.bufferOverflow 2005-11-23 16:51:56.000000000 -0500 -+++ cpio-2.6/src/copyout.c 2005-11-23 17:00:38.000000000 -0500 -@@ -159,7 +159,7 @@ - } - - /* We are about to put a file into a newc or crc archive that is -- multiply linked. We have already seen and defered all of the -+ multiply linked. We have already seen and deferred all of the - other links to the file but haven't written them into the archive. - Write the other links into the archive, and remove them from the - deferouts list. */ -@@ -231,8 +231,10 @@ - file_hdr.c_filesize, - header->c_name); - -- write_out_header (&file_hdr, out_file_des); -- copy_files_disk_to_tape (in_file_des, out_file_des, file_hdr.c_filesize, header->c_name); -+ if (write_out_header (&file_hdr, out_file_des)) -+ return; -+ copy_files_disk_to_tape (in_file_des, out_file_des, file_hdr.c_filesize, -+ header->c_name); - warn_if_file_changed(header->c_name, file_hdr.c_filesize, file_hdr.c_mtime); - - if (archive_format == arf_tar || archive_format == arf_ustar) -@@ -288,153 +290,311 @@ - } - } - -- --/* Write out header FILE_HDR, including the file name, to file -- descriptor OUT_DES. */ -+/* FIXME: These two defines should be defined in paxutils */ -+#define LG_8 3 -+#define LG_16 4 -+ -+/* FIXME: to_ascii could be used instead of to_oct() and to_octal() from tar, -+ so it should be moved to paxutils too. -+ Allowed values for logbase are: 1 (binary), 2, 3 (octal), 4 (hex) */ -+int -+to_ascii (char *where, uintmax_t v, size_t digits, unsigned logbase) -+{ -+ static char codetab[] = "0123456789ABCDEF"; -+ int i = digits; -+ -+ do -+ { -+ where[--i] = codetab[(v & ((1 << logbase) - 1))]; -+ v >>= logbase; -+ } -+ while (i); -+ -+ return v != 0; -+} -+ -+static void -+field_width_error (const char *filename, const char *fieldname) -+{ -+ error (0, 0, _("%s: field width not sufficient for storing %s"), -+ filename, fieldname); -+} -+ -+static void -+field_width_warning (const char *filename, const char *fieldname) -+{ -+ if (warn_option & CPIO_WARN_TRUNCATE) -+ error (0, 0, _("%s: truncating %s"), filename, fieldname); -+} - - void --write_out_header (struct new_cpio_header *file_hdr, int out_des) -+to_ascii_or_warn (char *where, uintmax_t n, size_t digits, -+ unsigned logbase, -+ const char *filename, const char *fieldname) -+{ -+ if (to_ascii (where, n, digits, logbase)) -+ field_width_warning (filename, fieldname); -+} -+ -+int -+to_ascii_or_error (char *where, uintmax_t n, size_t digits, -+ unsigned logbase, -+ const char *filename, const char *fieldname) - { -- if (archive_format == arf_newascii || archive_format == arf_crcascii) -+ if (to_ascii (where, n, digits, logbase)) - { -- char ascii_header[112]; -- char *magic_string; -+ field_width_error (filename, fieldname); -+ return 1; -+ } -+ return 0; -+} - -- if (archive_format == arf_crcascii) -- magic_string = "070702"; -- else -- magic_string = "070701"; -- sprintf (ascii_header, -- "%6s%08lx%08lx%08lx%08lx%08lx%08lx%08lx%08lx%08lx%08lx%08lx%08lx%08lx", -- magic_string, -- file_hdr->c_ino, file_hdr->c_mode, file_hdr->c_uid, -- file_hdr->c_gid, file_hdr->c_nlink, file_hdr->c_mtime, -- file_hdr->c_filesize, file_hdr->c_dev_maj, file_hdr->c_dev_min, -- file_hdr->c_rdev_maj, file_hdr->c_rdev_min, file_hdr->c_namesize, -- file_hdr->c_chksum & 0xffffffff); -- tape_buffered_write (ascii_header, out_des, 110L); -- -- /* Write file name to output. */ -- tape_buffered_write (file_hdr->c_name, out_des, (long) file_hdr->c_namesize); -- tape_pad_output (out_des, file_hdr->c_namesize + 110); -- } -- else if (archive_format == arf_oldascii || archive_format == arf_hpoldascii) -- { -- char ascii_header[78]; -- dev_t dev; -- dev_t rdev; -+int -+write_out_new_ascii_header (const char *magic_string, -+ struct new_cpio_header *file_hdr, int out_des) -+{ -+ char ascii_header[110]; -+ char *p; - -- if (archive_format == arf_oldascii) -- { -- dev = makedev (file_hdr->c_dev_maj, file_hdr->c_dev_min); -- rdev = makedev (file_hdr->c_rdev_maj, file_hdr->c_rdev_min); -- } -- else -- { -- /* HP/UX cpio creates archives that look just like ordinary archives, -- but for devices it sets major = 0, minor = 1, and puts the -- actual major/minor number in the filesize field. */ -- switch (file_hdr->c_mode & CP_IFMT) -- { -- case CP_IFCHR: -- case CP_IFBLK: -+ p = stpcpy (ascii_header, magic_string); -+ to_ascii_or_warn (p, file_hdr->c_ino, 8, LG_16, -+ file_hdr->c_name, _("inode number")); -+ p += 8; -+ to_ascii_or_warn (p, file_hdr->c_mode, 8, LG_16, file_hdr->c_name, -+ _("file mode")); -+ p += 8; -+ to_ascii_or_warn (p, file_hdr->c_uid, 8, LG_16, file_hdr->c_name, -+ _("uid")); -+ p += 8; -+ to_ascii_or_warn (p, file_hdr->c_gid, 8, LG_16, file_hdr->c_name, -+ _("gid")); -+ p += 8; -+ to_ascii_or_warn (p, file_hdr->c_nlink, 8, LG_16, file_hdr->c_name, -+ _("number of links")); -+ p += 8; -+ to_ascii_or_warn (p, file_hdr->c_mtime, 8, LG_16, file_hdr->c_name, -+ _("modification time")); -+ p += 8; -+ if (to_ascii_or_error (p, file_hdr->c_filesize, 8, LG_16, file_hdr->c_name, -+ _("file size"))) -+ return 1; -+ p += 8; -+ if (to_ascii_or_error (p, file_hdr->c_dev_maj, 8, LG_16, file_hdr->c_name, -+ _("device major number"))) -+ return 1; -+ p += 8; -+ if (to_ascii_or_error (p, file_hdr->c_dev_min, 8, LG_16, file_hdr->c_name, -+ _("device minor number"))) -+ return 1; -+ p += 8; -+ if (to_ascii_or_error (p, file_hdr->c_rdev_maj, 8, LG_16, file_hdr->c_name, -+ _("rdev major"))) -+ return 1; -+ p += 8; -+ if (to_ascii_or_error (p, file_hdr->c_rdev_min, 8, LG_16, file_hdr->c_name, -+ _("rdev minor"))) -+ return 1; -+ p += 8; -+ if (to_ascii_or_error (p, file_hdr->c_namesize, 8, LG_16, file_hdr->c_name, -+ _("name size"))) -+ return 1; -+ p += 8; -+ to_ascii (p, file_hdr->c_chksum & 0xffffffff, 8, LG_16); -+ -+ tape_buffered_write (ascii_header, out_des, sizeof ascii_header); -+ -+ /* Write file name to output. */ -+ tape_buffered_write (file_hdr->c_name, out_des, (long) file_hdr->c_namesize); -+ tape_pad_output (out_des, file_hdr->c_namesize + sizeof ascii_header); -+ return 0; -+} -+ -+int -+write_out_old_ascii_header (dev_t dev, dev_t rdev, -+ struct new_cpio_header *file_hdr, int out_des) -+{ -+ char ascii_header[76]; -+ char *p = ascii_header; -+ -+ to_ascii (p, file_hdr->c_magic, 6, LG_8); -+ p += 6; -+ to_ascii_or_warn (p, dev, 6, LG_8, file_hdr->c_name, _("device number")); -+ p += 6; -+ to_ascii_or_warn (p, file_hdr->c_ino, 6, LG_8, file_hdr->c_name, -+ _("inode number")); -+ p += 6; -+ to_ascii_or_warn (p, file_hdr->c_mode, 6, LG_8, file_hdr->c_name, -+ _("file mode")); -+ p += 6; -+ to_ascii_or_warn (p, file_hdr->c_uid, 6, LG_8, file_hdr->c_name, _("uid")); -+ p += 6; -+ to_ascii_or_warn (p, file_hdr->c_gid, 6, LG_8, file_hdr->c_name, _("gid")); -+ p += 6; -+ to_ascii_or_warn (p, file_hdr->c_nlink, 6, LG_8, file_hdr->c_name, -+ _("number of links")); -+ p += 6; -+ to_ascii_or_warn (p, rdev, 6, LG_8, file_hdr->c_name, _("rdev")); -+ p += 6; -+ to_ascii_or_warn (p, file_hdr->c_mtime, 11, LG_8, file_hdr->c_name, -+ _("modification time")); -+ p += 11; -+ if (to_ascii_or_error (p, file_hdr->c_namesize, 6, LG_8, file_hdr->c_name, -+ _("name size"))) -+ return 1; -+ p += 6; -+ if (to_ascii_or_error (p, file_hdr->c_filesize, 11, LG_8, file_hdr->c_name, -+ _("file size"))) -+ return 1; -+ -+ tape_buffered_write (ascii_header, out_des, sizeof ascii_header); -+ -+ /* Write file name to output. */ -+ tape_buffered_write (file_hdr->c_name, out_des, file_hdr->c_namesize); -+ return 0; -+} -+ -+void -+hp_compute_dev (struct new_cpio_header *file_hdr, dev_t *pdev, dev_t *prdev) -+{ -+ /* HP/UX cpio creates archives that look just like ordinary archives, -+ but for devices it sets major = 0, minor = 1, and puts the -+ actual major/minor number in the filesize field. */ -+ switch (file_hdr->c_mode & CP_IFMT) -+ { -+ case CP_IFCHR: -+ case CP_IFBLK: - #ifdef CP_IFSOCK -- case CP_IFSOCK: -+ case CP_IFSOCK: - #endif - #ifdef CP_IFIFO -- case CP_IFIFO: -+ case CP_IFIFO: - #endif -- file_hdr->c_filesize = makedev (file_hdr->c_rdev_maj, -- file_hdr->c_rdev_min); -- dev = rdev = 1; -- break; -- default: -- dev = makedev (file_hdr->c_dev_maj, file_hdr->c_dev_min); -- rdev = makedev (file_hdr->c_rdev_maj, file_hdr->c_rdev_min); -- break; -- } -- } -+ file_hdr->c_filesize = makedev (file_hdr->c_rdev_maj, -+ file_hdr->c_rdev_min); -+ *pdev = *prdev = makedev (0, 1); -+ break; -+ -+ default: -+ *pdev = makedev (file_hdr->c_dev_maj, file_hdr->c_dev_min); -+ *prdev = makedev (file_hdr->c_rdev_maj, file_hdr->c_rdev_min); -+ break; -+ } -+} - -- if ((warn_option & CPIO_WARN_TRUNCATE) && (file_hdr->c_ino >> 16) != 0) -- error (0, 0, _("%s: truncating inode number"), file_hdr->c_name); -+int -+write_out_binary_header (dev_t rdev, -+ struct new_cpio_header *file_hdr, int out_des) -+{ -+ struct old_cpio_header short_hdr; - -- /* Debian hack: The type of dev_t has changed in glibc. Fixed output -- to ensure that a long int is passed to sprintf. This has been -- reported to "bug-gnu-utils@prep.ai.mit.edu". (1998/5/26) -BEM */ -- sprintf (ascii_header, -- "%06ho%06lo%06lo%06lo%06lo%06lo%06lo%06lo%011lo%06lo%011lo", -- file_hdr->c_magic & 0xFFFF, (long) dev & 0xFFFF, -- file_hdr->c_ino & 0xFFFF, file_hdr->c_mode & 0xFFFF, -- file_hdr->c_uid & 0xFFFF, file_hdr->c_gid & 0xFFFF, -- file_hdr->c_nlink & 0xFFFF, (long) rdev & 0xFFFF, -- file_hdr->c_mtime, file_hdr->c_namesize & 0xFFFF, -- file_hdr->c_filesize); -- tape_buffered_write (ascii_header, out_des, 76L); -+ short_hdr.c_magic = 070707; -+ short_hdr.c_dev = makedev (file_hdr->c_dev_maj, file_hdr->c_dev_min); - -- /* Write file name to output. */ -- tape_buffered_write (file_hdr->c_name, out_des, (long) file_hdr->c_namesize); -- } -- else if (archive_format == arf_tar || archive_format == arf_ustar) -- { -- write_out_tar_header (file_hdr, out_des); -- } -- else -- { -- struct old_cpio_header short_hdr; -+ if ((warn_option & CPIO_WARN_TRUNCATE) && (file_hdr->c_ino >> 16) != 0) -+ error (0, 0, _("%s: truncating inode number"), file_hdr->c_name); - -- short_hdr.c_magic = 070707; -- short_hdr.c_dev = makedev (file_hdr->c_dev_maj, file_hdr->c_dev_min); -+ short_hdr.c_ino = file_hdr->c_ino & 0xFFFF; -+ if (short_hdr.c_ino != file_hdr->c_ino) -+ field_width_warning (file_hdr->c_name, _("inode number")); -+ -+ short_hdr.c_mode = file_hdr->c_mode & 0xFFFF; -+ if (short_hdr.c_mode != file_hdr->c_mode) -+ field_width_warning (file_hdr->c_name, _("file mode")); -+ -+ short_hdr.c_uid = file_hdr->c_uid & 0xFFFF; -+ if (short_hdr.c_uid != file_hdr->c_uid) -+ field_width_warning (file_hdr->c_name, _("uid")); -+ -+ short_hdr.c_gid = file_hdr->c_gid & 0xFFFF; -+ if (short_hdr.c_gid != file_hdr->c_gid) -+ field_width_warning (file_hdr->c_name, _("gid")); -+ -+ short_hdr.c_nlink = file_hdr->c_nlink & 0xFFFF; -+ if (short_hdr.c_nlink != file_hdr->c_nlink) -+ field_width_warning (file_hdr->c_name, _("number of links")); -+ -+ short_hdr.c_rdev = rdev; -+ short_hdr.c_mtimes[0] = file_hdr->c_mtime >> 16; -+ short_hdr.c_mtimes[1] = file_hdr->c_mtime & 0xFFFF; -+ -+ short_hdr.c_namesize = file_hdr->c_namesize & 0xFFFF; -+ if (short_hdr.c_namesize != file_hdr->c_namesize) -+ { -+ field_width_error (file_hdr->c_name, _("name size")); -+ return 1; -+ } -+ -+ short_hdr.c_filesize = file_hdr->c_filesize; -+ if (short_hdr.c_filesize != file_hdr->c_filesize) -+ { -+ field_width_error (file_hdr->c_name, _("file size")); -+ return 1; -+ } -+ -+ short_hdr.c_filesizes[0] = file_hdr->c_filesize >> 16; -+ short_hdr.c_filesizes[1] = file_hdr->c_filesize & 0xFFFF; - -- if ((warn_option & CPIO_WARN_TRUNCATE) && (file_hdr->c_ino >> 16) != 0) -- error (0, 0, _("%s: truncating inode number"), file_hdr->c_name); -+ /* Output the file header. */ -+ tape_buffered_write ((char *) &short_hdr, out_des, 26); - -- short_hdr.c_ino = file_hdr->c_ino & 0xFFFF; -- short_hdr.c_mode = file_hdr->c_mode & 0xFFFF; -- short_hdr.c_uid = file_hdr->c_uid & 0xFFFF; -- short_hdr.c_gid = file_hdr->c_gid & 0xFFFF; -- short_hdr.c_nlink = file_hdr->c_nlink & 0xFFFF; -- if (archive_format != arf_hpbinary) -- short_hdr.c_rdev = makedev (file_hdr->c_rdev_maj, file_hdr->c_rdev_min); -- else -- { -- switch (file_hdr->c_mode & CP_IFMT) -- { -- /* HP/UX cpio creates archives that look just like ordinary -- archives, but for devices it sets major = 0, minor = 1, and -- puts the actual major/minor number in the filesize field. */ -- case CP_IFCHR: -- case CP_IFBLK: --#ifdef CP_IFSOCK -- case CP_IFSOCK: --#endif --#ifdef CP_IFIFO -- case CP_IFIFO: --#endif -- file_hdr->c_filesize = makedev (file_hdr->c_rdev_maj, -- file_hdr->c_rdev_min); -- short_hdr.c_rdev = makedev (0, 1); -- break; -- default: -- short_hdr.c_rdev = makedev (file_hdr->c_rdev_maj, -- file_hdr->c_rdev_min); -- break; -- } -- } -- short_hdr.c_mtimes[0] = file_hdr->c_mtime >> 16; -- short_hdr.c_mtimes[1] = file_hdr->c_mtime & 0xFFFF; -+ /* Write file name to output. */ -+ tape_buffered_write (file_hdr->c_name, out_des, file_hdr->c_namesize); - -- short_hdr.c_namesize = file_hdr->c_namesize & 0xFFFF; -+ tape_pad_output (out_des, file_hdr->c_namesize + 26); -+ return 0; -+} - -- short_hdr.c_filesizes[0] = file_hdr->c_filesize >> 16; -- short_hdr.c_filesizes[1] = file_hdr->c_filesize & 0xFFFF; -+ -+/* Write out header FILE_HDR, including the file name, to file -+ descriptor OUT_DES. */ - -- /* Output the file header. */ -- tape_buffered_write ((char *) &short_hdr, out_des, 26L); -+int -+write_out_header (struct new_cpio_header *file_hdr, int out_des) -+{ -+ dev_t dev; -+ dev_t rdev; -+ -+ switch (archive_format) -+ { -+ case arf_newascii: -+ return write_out_new_ascii_header ("070701", file_hdr, out_des); -+ -+ case arf_crcascii: -+ return write_out_new_ascii_header ("070702", file_hdr, out_des); -+ -+ case arf_oldascii: -+ return write_out_old_ascii_header (makedev (file_hdr->c_dev_maj, -+ file_hdr->c_dev_min), -+ makedev (file_hdr->c_rdev_maj, -+ file_hdr->c_rdev_min), -+ file_hdr, out_des); -+ -+ case arf_hpoldascii: -+ hp_compute_dev (file_hdr, &dev, &rdev); -+ return write_out_old_ascii_header (dev, rdev, file_hdr, out_des); -+ -+ case arf_tar: -+ case arf_ustar: -+ if (is_tar_filename_too_long (file_hdr->c_name)) -+ { -+ error (0, 0, _("%s: file name too long"), file_hdr->c_name); -+ return 1; -+ } -+ write_out_tar_header (file_hdr, out_des); /* FIXME: No error checking */ -+ return 0; - -- /* Write file name to output. */ -- tape_buffered_write (file_hdr->c_name, out_des, (long) file_hdr->c_namesize); -+ case arf_binary: -+ return write_out_binary_header (makedev (file_hdr->c_rdev_maj, -+ file_hdr->c_rdev_min), -+ file_hdr, out_des); -+ -+ case arf_hpbinary: -+ hp_compute_dev (file_hdr, &dev, &rdev); -+ /* FIXME: dev ignored. Should it be? */ -+ return write_out_binary_header (rdev, file_hdr, out_des); - -- tape_pad_output (out_des, file_hdr->c_namesize + 26); -+ default: -+ abort (); - } - } - -@@ -593,14 +753,7 @@ - file_hdr.c_namesize = strlen (p) + 1; - } - #endif -- if ((archive_format == arf_tar || archive_format == arf_ustar) -- && is_tar_filename_too_long (file_hdr.c_name)) -- { -- error (0, 0, _("%s: file name too long"), -- file_hdr.c_name); -- continue; -- } -- -+ - /* Copy the named file to the output. */ - switch (file_hdr.c_mode & CP_IFMT) - { -@@ -613,7 +766,8 @@ - file_hdr.c_dev_min))) - { - file_hdr.c_tar_linkname = otherfile; -- write_out_header (&file_hdr, out_file_des); -+ if (write_out_header (&file_hdr, out_file_des)) -+ continue; - break; - } - } -@@ -643,7 +797,8 @@ - file_hdr.c_filesize, - input_name.ds_string); - -- write_out_header (&file_hdr, out_file_des); -+ if (write_out_header (&file_hdr, out_file_des)) -+ continue; - copy_files_disk_to_tape (in_file_des, out_file_des, file_hdr.c_filesize, input_name.ds_string); - warn_if_file_changed(input_name.ds_string, file_hdr.c_filesize, - file_hdr.c_mtime); -@@ -673,7 +828,8 @@ - - case CP_IFDIR: - file_hdr.c_filesize = 0; -- write_out_header (&file_hdr, out_file_des); -+ if (write_out_header (&file_hdr, out_file_des)) -+ continue; - break; - - case CP_IFCHR: -@@ -702,14 +858,16 @@ - file_hdr.c_mode = (file_stat.st_mode & 07777); - file_hdr.c_mode |= CP_IFREG; - file_hdr.c_tar_linkname = otherfile; -- write_out_header (&file_hdr, out_file_des); -+ if (write_out_header (&file_hdr, out_file_des)) -+ continue; - break; - } - add_inode (file_hdr.c_ino, file_hdr.c_name, - file_hdr.c_dev_maj, file_hdr.c_dev_min); - } - file_hdr.c_filesize = 0; -- write_out_header (&file_hdr, out_file_des); -+ if (write_out_header (&file_hdr, out_file_des)) -+ continue; - break; - - #ifdef CP_IFLNK -@@ -738,12 +896,14 @@ - { - link_name[link_size] = '\0'; - file_hdr.c_tar_linkname = link_name; -- write_out_header (&file_hdr, out_file_des); -+ if (write_out_header (&file_hdr, out_file_des)) -+ continue; - } - } - else - { -- write_out_header (&file_hdr, out_file_des); -+ if (write_out_header (&file_hdr, out_file_des)) -+ continue; - tape_buffered_write (link_name, out_file_des, link_size); - tape_pad_output (out_file_des, link_size); - } ---- cpio-2.6/src/extern.h.bufferOverflow 2005-11-23 16:51:56.000000000 -0500 -+++ cpio-2.6/src/extern.h 2005-11-23 16:51:56.000000000 -0500 -@@ -112,7 +112,7 @@ - void print_name_with_quoting P_((char *p)); - - /* copyout.c */ --void write_out_header P_((struct new_cpio_header *file_hdr, int out_des)); -+int write_out_header P_((struct new_cpio_header *file_hdr, int out_des)); - void process_copy_out P_((void)); - - /* copypass.c */ diff --git a/app-arch/cpio/files/digest-cpio-2.6-r5 b/app-arch/cpio/files/digest-cpio-2.6-r5 deleted file mode 100644 index 83733625e83c..000000000000 --- a/app-arch/cpio/files/digest-cpio-2.6-r5 +++ /dev/null @@ -1,3 +0,0 @@ -MD5 25e0e8725bc60ed3460c9cde92752674 cpio-2.6.tar.bz2 448452 -RMD160 52b7e21c9989dd28da5dae1630b57a301817a788 cpio-2.6.tar.bz2 448452 -SHA256 6e60c5c370d451605fcb23e26cc37c18182f62009282ca73bf5dea4519e17360 cpio-2.6.tar.bz2 448452 diff --git a/app-arch/cpio/files/digest-cpio-2.7-r1 b/app-arch/cpio/files/digest-cpio-2.7-r1 deleted file mode 100644 index 1c0c7862f504..000000000000 --- a/app-arch/cpio/files/digest-cpio-2.7-r1 +++ /dev/null @@ -1,3 +0,0 @@ -MD5 69ad6cb3d288aafe5f969f68d9fd0fb7 cpio-2.7.tar.bz2 698221 -RMD160 0ae35717237133da5bba18376af0ec685ac67360 cpio-2.7.tar.bz2 698221 -SHA256 b59390450233b5298d210f6369e98d91d07b7f4261ddb962d654185dd02b5b0e cpio-2.7.tar.bz2 698221 |