Bug 49375

Summary: DANGER! rpm corrupts device files
Product: [Retired] Red Hat Raw Hide Reporter: Jonathan Kamens <jik>
Component: rpmAssignee: Jeff Johnson <jbj>
Status: CLOSED RAWHIDE QA Contact: David Lawrence <dkl>
Severity: high Docs Contact:
Priority: high    
Version: 1.0   
Target Milestone: ---   
Target Release: ---   
Hardware: i386   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2001-07-18 19:36: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:

Description Jonathan Kamens 2001-07-18 19:36:12 UTC
I've got rpm-4.0.3-0.69.

Run "rpm -q -l -v -p dev-3.2-1.i386.rpm | head" and you'll see:

  drwxr-xr-x    2 root    root                0 Jul 17 17:58 /dev
  crw-------    1 root    root        10,  10 Jul 17 17:58 /dev/adbmouse
  crw-r--r--    1 root    root        10, 175 Jul 17 17:58 /dev/agpgart
  crw-------    2 root    root        10,   4 Jul 17 17:58 /dev/amigamouse
  crw-------    1 root    root        10,   7 Jul 17 17:58 /dev/amigamouse1
  crw-------    1 root    root        10, 134 Jul 17 17:58 /dev/apm_bios
  drwxr-xr-x    2 root    root                0 Jul 17 17:58 /dev/ataraid
  brw-rw----    1 root    disk       114,   0 Jul 17 17:58 /dev/ataraid/d0
  brw-rw----    1 root    disk       114,   1 Jul 17 17:58
/dev/ataraid/d0p1
  brw-rw----    1 root    disk       114,  10 Jul 17 17:58
/dev/ataraid/d0p10

But watch what happens when you tell RPM to convert this into cpio format
and tell cpio to list it ("rpm2cpio dev-3.2-1.i386.rpm | cpio --list
--verbose | head"):

  drwxr-xr-x  15 root     root            0 Jul 17 17:58 ./dev
  crw-------   1 root     root       0,   0 Dec 31  1969 ./dev/adbmouse
  crw-r--r--   1 root     root       0,   0 Dec 31  1969 ./dev/agpgart
  crw-------   1 root     root       0,   0 Dec 31  1969 ./dev/amigamouse
  crw-------   1 root     root       0,   0 Dec 31  1969 ./dev/amigamouse1
  crw-------   1 root     root       0,   0 Dec 31  1969 ./dev/apm_bios
  drwxr-xr-x   2 root     root            0 Jul 17 17:58 ./dev/ataraid
  brw-rw----   1 root     disk       0,   0 Dec 31  1969 ./dev/ataraid/d0
  brw-rw----   1 root     disk       0,   0 Dec 31  1969 ./dev/ataraid/d0p1
  brw-rw----   1 root     disk       0,   0 Dec 31  1969
./dev/ataraid/d0p10

Yowza!

This means, e.g., that if you use this version of rpm to upgrade your "dev"
package, your system will be totally hosed.

Comment 1 Jeff Johnson 2001-07-18 19:40:06 UTC
Hmm, a little less "DANGER Will Robinson!" FUD, please.

rpm-4.0.3-0.73, in our build system for ~6 hours, misbuilt the dev package.

Fixed in rpm-4.0.3-0.74.