RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.
Bug 2058426 - Cannot extract rpms from RHEL9 on RHEL7.8
Summary: Cannot extract rpms from RHEL9 on RHEL7.8
Keywords:
Status: CLOSED NOTABUG
Alias: None
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: rpm
Version: 7.8
Hardware: All
OS: Linux
unspecified
medium
Target Milestone: rc
: ---
Assignee: Packaging Maintenance Team
QA Contact: swm-qe
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2022-02-24 22:04 UTC by kartthik.raghunathan
Modified: 2022-02-25 07:40 UTC (History)
1 user (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2022-02-25 07:40:17 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Issue Tracker RHELPLAN-113744 0 None None None 2022-02-24 22:12:41 UTC

Description kartthik.raghunathan 2022-02-24 22:04:04 UTC
Description of problem: 
rpm2cpio produces garbage when extracting a rhel-9 rpm on RHEL7.8. 

rpm2cpio kmod-elx-lpfc-14.2.171.0-1.rhel9u0.x86_64.rpm  | cpio -idv
cpio: Malformed number E▒▒▒
cpio: Malformed number ▒▒▒4
cpio: Malformed number ▒▒4<
cpio: Malformed number ▒4<U
cpio: warning: skipped 26720 bytes of junk
cpio: warning: archive header has reverse byte-order
cpio: ▒▒▒i▒▒X▒*▒▒▒8qN!▒▒\       ▒+▒▒`)/%6�}˩b
(▒▒0▒R▒(▒▒>ǰ▒▒ܮTC▒▒#▒▒▒▒gNRbVw▒▒=?o▒▒_}~▒▒
▒w▒hkc▒▒|▒▒޾5▒:▒4▒▒▒▒▒5"Ӏ▒▒"▒S▒▒8▒▒!▒▒▒Ux▒▒▒▒R
'▒▒N&SG▒TL▒▒R#▒ט▒S▒b▒=R▒▒x▒QMX▒i▒▒~▒,G▒▒J&▒;▒Z▒▒▒jG▒V▒▒~▒jNQD/h▒Ot▒▒▒▒▒▒M▒▒▒
                                                                            gW)▒=<▒o\ڋ~▒▒N▒?▒L▒▒C▒▒+▒
▒▒▒▒)$▒▒VLČօ▒▒־Q▒,M▒▒~▒'▒Y1▒D▒V▒r->w▒▒▒[▒S▒▒F▒▒0E▒▒D▒▒▒▒▒Tp: unknown file type
cpio: premature end of file

Version-Release number of selected component (if applicable):
rpm-4.11.3-43.el7.x86_64

How reproducible:
always


Steps to Reproduce:
1. rpm2cpio <rpmname.rpm> | cpio -imdv
2. Note that your console output is full of garbage.
3.

Actual results:
can't open rpm


Expected results:
rpm extracts, or error is reported.

Additional info:

Comment 3 Panu Matilainen 2022-02-25 07:40:17 UTC
This is to be expected, RHEL 9 uses a payload compression (zstd) which is not be available on RHEL 7.
Rpm tracks these incompatibility via rpmlib() dependencies so an attempt to 'rpm -U' the package on RHEL 7 will fail cleanly but rpm2cpio does not use these mechanisms.

Arguably rpm2cpio should detect an unsupported payload format though and error out instead of spitting the compressed data out as-is, OTOH that flaw can be utilized by piping to an external extractor if available. For this case, if 'zstd' is available, you should be able to extract the contents by piping through that, ie

    rpm2cpio foo.rpm | zstd -d | cpio

There should probably be an explicit switch to enable this behavior though, but this is not something that will get addressed in RHEL 7 at this point.


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