Bug 56346

Summary: cpio copy-in truncates multiply-linked files if the first hard link is excluded
Product: [Retired] Red Hat Linux Reporter: Chris Jaeger <cjj2>
Component: cpioAssignee: Bernhard Rosenkraenzer <bero>
Status: CLOSED RAWHIDE QA Contact: Brock Organ <borgan>
Severity: medium Docs Contact:
Priority: medium    
Version: 7.2   
Target Milestone: ---   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2001-11-15 22:11:16 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Attachments:
Description Flags
patch against 2.4.2-20 to fix the problem, will likely apply against 2.4.2-23 none

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