Bug 56346 - cpio copy-in truncates multiply-linked files if the first hard link is excluded
cpio copy-in truncates multiply-linked files if the first hard link is excluded
Status: CLOSED RAWHIDE
Product: Red Hat Linux
Classification: Retired
Component: cpio (Show other bugs)
7.2
All Linux
medium Severity medium
: ---
: ---
Assigned To: Bernhard Rosenkraenzer
Brock Organ
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2001-11-15 17:08 EST by Chris Jaeger
Modified: 2007-04-18 12:38 EDT (History)
0 users

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2001-11-15 17:11:16 EST
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:


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 17:11 EST, Chris Jaeger
no flags Details | Diff

  None (edit)
Description Chris Jaeger 2001-11-15 17:08:39 EST
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 17:11:12 EST
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 06:54:52 EST
Thanks, fixed in 2.4.2-25

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