]> git.pld-linux.org Git - packages/cpio.git/blob - cpio-emptylink.patch
- release 20,
[packages/cpio.git] / cpio-emptylink.patch
1 From jhpb@sarto.gaithersburg.md.us  Mon Jul 26 21:57:20 1999
2 Return-Path: <jhpb@sarto.gaithersburg.md.us>
3 Received: from mail.redhat.com (mail.redhat.com [199.183.24.239])
4         by developer.redhat.com (8.8.7/8.8.7) with ESMTP id VAA15169
5         for <bugzilla@developer.redhat.com>; Mon, 26 Jul 1999 21:57:20 -0400
6 Received: from lacrosse.corp.redhat.com (root@lacrosse.corp.redhat.com [207.175.42.154])
7         by mail.redhat.com (8.8.7/8.8.7) with ESMTP id VAA21351
8         for <bugzilla@developer.redhat.com>; Mon, 26 Jul 1999 21:57:20 -0400
9 Received: from mail.redhat.com (mail.redhat.com [199.183.24.239])
10         by lacrosse.corp.redhat.com (8.9.3/8.9.3) with ESMTP id VAA01496
11         for <bugzilla@lacrosse.redhat.com>; Mon, 26 Jul 1999 21:57:19 -0400
12 Received: from sjc3-1.relay.mail.uu.net (sjc3-1.relay.mail.uu.net [199.171.54.122])
13         by mail.redhat.com (8.8.7/8.8.7) with ESMTP id VAA21342
14         for <bugzilla@redhat.com>; Mon, 26 Jul 1999 21:57:19 -0400
15 Received: from uucp1.uu.net by sjc3sosrv11.alter.net with SMTP 
16         (peer crosschecked as: uucp1.uu.net [192.48.96.81])
17         id QQgzpn12816
18         for <bugzilla@redhat.com>; Tue, 27 Jul 1999 01:57:56 GMT
19 Received: from sarto.UUCP by uucp1.uu.net with UUCP/RMAIL
20         ; Mon, 26 Jul 1999 21:55:38 -0400
21 Received: from sarto.gaithersburg.md.us (IDENT:jhpb@altera.gaithersburg.md.us [10.10.10.11])
22         by altera.gaithersburg.md.us (8.9.3/8.9.3) with ESMTP id UAA02705
23         for <bugzilla@redhat.com>; Mon, 26 Jul 1999 20:51:35 -0400
24 Sender: jhpb@sarto.gaithersburg.md.us
25 Message-ID: <379D0297.ECEADA06@sarto.gaithersburg.md.us>
26 Date: Mon, 26 Jul 1999 20:51:35 -0400
27 From: "Joseph H. Buehler" <jhpb@sarto.gaithersburg.md.us>
28 X-Mailer: Mozilla 4.61 [en] (X11; I; Linux 2.2.5 i686)
29 X-Accept-Language: en
30 MIME-Version: 1.0
31 To: bugzilla@redhat.com
32 Subject: BUG ID #4208
33 Content-Type: multipart/mixed;
34  boundary="------------747FAF18CE4E4F8E71D6ED66"
35
36 This is a multi-part message in MIME format.
37 --------------747FAF18CE4E4F8E71D6ED66
38 Content-Type: text/plain; charset=us-ascii
39 Content-Transfer-Encoding: 7bit
40
41 The 2.4.2 version of GNU cpio goes into an infinite loop when unpacking
42 cpio files that have empty files with hard links.  Duplicate as
43 follows:
44
45 rm -fr t &&
46 mkdir t &&
47 touch t/f1 &&
48 ln t/f1 t/f2 &&
49 find t | cpio -o -H newc > temp.cpio &&
50 cpio -idmuv <temp.cpio &&
51 true
52
53 Also, cpio on systems without lchown() (probably not Redhat) will incorrectly
54 set the permissions on files that symlinks point at, instead of the
55 symlink itself.
56
57 Patch is attached.
58
59 Joe Buehler
60 --------------747FAF18CE4E4F8E71D6ED66
61 Content-Type: text/plain; charset=us-ascii;
62  name="cpio-2.4.2.patch"
63 Content-Transfer-Encoding: 7bit
64 Content-Disposition: inline;
65  filename="cpio-2.4.2.patch"
66
67 *** cpio-2.4.2.redhat/copypass.c        Mon Jan  8 16:59:05 1996
68 --- cpio-2.4.2/copypass.c       Wed Sep 11 21:22:04 1996
69 ***************
70 *** 24,33 ****
71   #include "dstring.h"
72   #include "extern.h"
73   
74 - #ifndef HAVE_LCHOWN
75 - #define lchown chown
76 - #endif
77
78   /* Copy files listed on the standard input into directory `directory_name'.
79      If `link_flag', link instead of copying.  */
80   
81 --- 24,29 ----
82 ***************
83 *** 360,371 ****
84 --- 356,369 ----
85             }
86   
87           /* Set the attributes of the new link.  */
88 + #ifdef HAVE_LCHOWN
89           if (!no_chown_flag)
90             if ((lchown (output_name.ds_string,
91                          set_owner_flag ? set_owner : in_file_stat.st_uid,
92                       set_group_flag ? set_group : in_file_stat.st_gid) < 0)
93                 && errno != EPERM)
94               error (0, errno, "%s", output_name.ds_string);
95 + #endif
96           free (link_name);
97         }
98   #endif
99 *** cpio-2.4.2.redhat/copyin.c  Wed Nov 30 17:49:06 1994
100 --- cpio-2.4.2/copyin.c Tue Sep 17 11:21:15 1996
101 ***************
102 *** 29,38 ****
103   #include <fnmatch.h>
104   #endif
105   
106 - #ifndef HAVE_LCHOWN
107 - #define lchown chown
108 - #endif
109
110   static void read_pattern_file ();
111   static void tape_skip_padding ();
112   static void defer_copyin ();
113 --- 29,34 ----
114 ***************
115 *** 982,993 ****
116 --- 978,991 ----
117                     link_name = NULL;
118                     continue;
119                   }
120 + #ifdef HAVE_LCHOWN
121                 if (!no_chown_flag)
122                   if ((lchown (file_hdr.c_name,
123                                set_owner_flag ? set_owner : file_hdr.c_uid,
124                            set_group_flag ? set_group : file_hdr.c_gid) < 0)
125                       && errno != EPERM)
126                     error (0, errno, "%s", file_hdr.c_name);
127 + #endif
128                 free (link_name);
129                 link_name = NULL;
130               }
131 ***************
132 *** 1306,1312 ****
133     
134     for (d = deferments; d != NULL; d = d->next)
135       {
136 -       d = deferments;
137         link_res = link_to_maj_min_ino (d->header.c_name, 
138                     d->header.c_dev_maj, d->header.c_dev_maj,
139                     d->header.c_ino);
140 --- 1304,1309 ----
141
142 --------------747FAF18CE4E4F8E71D6ED66--
143
This page took 0.049406 seconds and 3 git commands to generate.