From: kloczek Date: Wed, 15 Sep 1999 21:47:40 +0000 (+0000) Subject: - fix infinite loop unpacking empty files with hard links (patch emptylink X-Git-Tag: cpio-2_4_2-17 X-Git-Url: https://git.pld-linux.org/?a=commitdiff_plain;h=ba1b0a67181936ce9ccb8156e600514040c37332;p=packages%2Fcpio.git - fix infinite loop unpacking empty files with hard links (patch emptylink from rawhide), - stdout chould contain progress information (patch stdout from rawhide). Changed files: cpio-emptylink.patch -> 1.1 cpio-stdout.patch -> 1.1 --- diff --git a/cpio-emptylink.patch b/cpio-emptylink.patch new file mode 100644 index 0000000..a7e22d1 --- /dev/null +++ b/cpio-emptylink.patch @@ -0,0 +1,143 @@ +From jhpb@sarto.gaithersburg.md.us Mon Jul 26 21:57:20 1999 +Return-Path: +Received: from mail.redhat.com (mail.redhat.com [199.183.24.239]) + by developer.redhat.com (8.8.7/8.8.7) with ESMTP id VAA15169 + for ; Mon, 26 Jul 1999 21:57:20 -0400 +Received: from lacrosse.corp.redhat.com (root@lacrosse.corp.redhat.com [207.175.42.154]) + by mail.redhat.com (8.8.7/8.8.7) with ESMTP id VAA21351 + for ; Mon, 26 Jul 1999 21:57:20 -0400 +Received: from mail.redhat.com (mail.redhat.com [199.183.24.239]) + by lacrosse.corp.redhat.com (8.9.3/8.9.3) with ESMTP id VAA01496 + for ; Mon, 26 Jul 1999 21:57:19 -0400 +Received: from sjc3-1.relay.mail.uu.net (sjc3-1.relay.mail.uu.net [199.171.54.122]) + by mail.redhat.com (8.8.7/8.8.7) with ESMTP id VAA21342 + for ; Mon, 26 Jul 1999 21:57:19 -0400 +Received: from uucp1.uu.net by sjc3sosrv11.alter.net with SMTP + (peer crosschecked as: uucp1.uu.net [192.48.96.81]) + id QQgzpn12816 + for ; Tue, 27 Jul 1999 01:57:56 GMT +Received: from sarto.UUCP by uucp1.uu.net with UUCP/RMAIL + ; Mon, 26 Jul 1999 21:55:38 -0400 +Received: from sarto.gaithersburg.md.us (IDENT:jhpb@altera.gaithersburg.md.us [10.10.10.11]) + by altera.gaithersburg.md.us (8.9.3/8.9.3) with ESMTP id UAA02705 + for ; Mon, 26 Jul 1999 20:51:35 -0400 +Sender: jhpb@sarto.gaithersburg.md.us +Message-ID: <379D0297.ECEADA06@sarto.gaithersburg.md.us> +Date: Mon, 26 Jul 1999 20:51:35 -0400 +From: "Joseph H. Buehler" +X-Mailer: Mozilla 4.61 [en] (X11; I; Linux 2.2.5 i686) +X-Accept-Language: en +MIME-Version: 1.0 +To: bugzilla@redhat.com +Subject: BUG ID #4208 +Content-Type: multipart/mixed; + boundary="------------747FAF18CE4E4F8E71D6ED66" + +This is a multi-part message in MIME format. +--------------747FAF18CE4E4F8E71D6ED66 +Content-Type: text/plain; charset=us-ascii +Content-Transfer-Encoding: 7bit + +The 2.4.2 version of GNU cpio goes into an infinite loop when unpacking +cpio files that have empty files with hard links. Duplicate as +follows: + +rm -fr t && +mkdir t && +touch t/f1 && +ln t/f1 t/f2 && +find t | cpio -o -H newc > temp.cpio && +cpio -idmuv + #endif + +- #ifndef HAVE_LCHOWN +- #define lchown chown +- #endif +- + static void read_pattern_file (); + static void tape_skip_padding (); + static void defer_copyin (); +--- 29,34 ---- +*************** +*** 982,993 **** +--- 978,991 ---- + link_name = NULL; + continue; + } ++ #ifdef HAVE_LCHOWN + if (!no_chown_flag) + if ((lchown (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); ++ #endif + free (link_name); + link_name = NULL; + } +*************** +*** 1306,1312 **** + + for (d = deferments; d != NULL; d = d->next) + { +- d = deferments; + link_res = link_to_maj_min_ino (d->header.c_name, + d->header.c_dev_maj, d->header.c_dev_maj, + d->header.c_ino); +--- 1304,1309 ---- + +--------------747FAF18CE4E4F8E71D6ED66-- + diff --git a/cpio-stdout.patch b/cpio-stdout.patch new file mode 100644 index 0000000..26d222a --- /dev/null +++ b/cpio-stdout.patch @@ -0,0 +1,28 @@ +--- cpio-2.4.2/copyin.c.stdout Tue Aug 31 14:59:47 1999 ++++ cpio-2.4.2/copyin.c Tue Aug 31 15:00:52 1999 +@@ -999,9 +999,9 @@ + } + + if (verbose_flag) +- fprintf (stderr, "%s\n", file_hdr.c_name); ++ fprintf (stdout, "%s\n", file_hdr.c_name); + if (dot_flag) +- fputc ('.', stderr); ++ fputc ('.', stdout); + } + } + +--- cpio-2.4.2/copyout.c.stdout Tue Aug 31 15:00:01 1999 ++++ cpio-2.4.2/copyout.c Tue Aug 31 15:02:27 1999 +@@ -492,9 +492,9 @@ + } + + if (verbose_flag) +- fprintf (stderr, "%s\n", input_name.ds_string); ++ fprintf (stdout, "%s\n", input_name.ds_string); + if (dot_flag) +- fputc ('.', stderr); ++ fputc ('.', stdout); + } + } +