Bug 56346 - cpio copy-in truncates multiply-linked files if the first hard link is excluded
Summary: cpio copy-in truncates multiply-linked files if the first hard link is excluded
Status: CLOSED RAWHIDE
Alias: None
Product: Red Hat Linux
Classification: Retired
Component: cpio
Version: 7.2
Hardware: All
OS: Linux
medium
medium
Target Milestone: ---
Assignee: Bernhard Rosenkraenzer
QA Contact: Brock Organ
URL:
Whiteboard:
Keywords:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2001-11-15 22:08 UTC by Chris Jaeger
Modified: 2007-04-18 16:38 UTC (History)
0 users

(edit)
Clone Of:
(edit)
Last Closed: 2001-11-15 22:11:16 UTC


Attachments (Terms of Use)
patch against 2.4.2-20 to fix the problem, will likely apply against 2.4.2-23 (2.50 KB, patch)
2001-11-15 22:11 UTC, Chris Jaeger
no flags Details | Diff

Description Chris Jaeger 2001-11-15 22:08:39 UTC
From Bugzilla Helper:
User-Agent: Mozilla/4.77 [en] (X11; U; Linux 2.4.3-12 i686; Nav)

Description of problem:
If you use cpio to extract a multiply linked file from an archive, and you
tell cpio
to exclude the first link, the resulting linked files have 0 length.

Version-Release number of selected component (if applicable):


How reproducible:
Always

Steps to Reproduce:
1. Take an rpm that contains multiply-linked files. glibc-common is an
example.
2. Using rpm2cpio, extract the cpio archive from the rpm, and then pass it
through
   cpio, extracting all files. This will work properly, and all files will
have the proper
   size. Now do the same but exclude the first listed link of some file.
All other links
   to this file will be created, but with 0 length.
3.
	

Actual Results:  [admin@apphost-60 cpio_test]$ rpm2cpio
../glibc-common-2.2.4-13.i386.rpm | cpio
-id --quiet '*usr/lib/locale/en_US/*' > /dev/null
[admin@apphost-60 cpio_test]$ ls -l usr/lib/locale/en_US/
total 12
-rw-r--r--    1 admin    admin           0 Nov 15 17:04 LC_ADDRESS
-rw-r--r--    1 admin    admin           0 Nov 15 17:04 LC_COLLATE
-rw-r--r--    1 admin    admin           0 Nov 15 17:04 LC_CTYPE
-rw-r--r--    1 admin    admin         370 Nov 15 17:04 LC_IDENTIFICATION
-rw-r--r--    1 admin    admin           0 Nov 15 17:04 LC_MEASUREMENT
drwxr-xr-x    2 admin    admin        4096 Nov 15 17:04 LC_MESSAGES
-rw-r--r--    1 admin    admin           0 Nov 15 17:04 LC_MONETARY
-rw-r--r--    1 admin    admin           0 Nov 15 17:04 LC_NAME
-rw-r--r--    1 admin    admin           0 Nov 15 17:04 LC_NUMERIC
-rw-r--r--    1 admin    admin           0 Nov 15 17:04 LC_PAPER
-rw-r--r--    1 admin    admin           0 Nov 15 17:04 LC_TELEPHONE
-rw-r--r--    1 admin    admin        2456 Nov 15 17:04 LC_TIME

Expected Results:  [admin@apphost-60 cpio_test]$ rpm2cpio
../glibc-common-2.2.4-13.i386.rpm | cpio
-id --quiet '*' > /dev/null
[admin@apphost-60 cpio_test]$ ls -l usr/lib/locale/en_US/
total 240
-rw-r--r--    2 admin    admin         160 Nov 15 17:05 LC_ADDRESS
-rw-r--r--   37 admin    admin       21499 Nov 15 17:05 LC_COLLATE
-rw-r--r--   61 admin    admin      173408 Nov 15 17:05 LC_CTYPE
-rw-r--r--    1 admin    admin         370 Nov 15 17:05 LC_IDENTIFICATION
-rw-r--r--    3 admin    admin          28 Nov 15 17:05 LC_MEASUREMENT
drwxr-xr-x    2 admin    admin        4096 Nov 15 17:05 LC_MESSAGES
-rw-r--r--    2 admin    admin         291 Nov 15 17:05 LC_MONETARY
-rw-r--r--    2 admin    admin          82 Nov 15 17:05 LC_NAME
-rw-r--r--   15 admin    admin          59 Nov 15 17:05 LC_NUMERIC
-rw-r--r--    5 admin    admin          39 Nov 15 17:05 LC_PAPER
-rw-r--r--    2 admin    admin          64 Nov 15 17:05 LC_TELEPHONE
-rw-r--r--    1 admin    admin        2456 Nov 15 17:05 LC_TIME

Additional info:

[admin@apphost-60 cpio_test]$ rpm -q cpio
cpio-2.4.2-23

Comment 1 Chris Jaeger 2001-11-15 22:11:12 UTC
Created attachment 37682 [details]
patch against 2.4.2-20 to fix the problem, will likely apply against 2.4.2-23

Comment 2 Bernhard Rosenkraenzer 2001-11-22 11:54:52 UTC
Thanks, fixed in 2.4.2-25



Note You need to log in before you can comment on or make changes to this bug.