Note: This bug is displayed in read-only format because the product is no longer active in Red Hat Bugzilla.
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

Summary: Cannot extract rpms from RHEL9 on RHEL7.8
Product: Red Hat Enterprise Linux 7 Reporter: kartthik.raghunathan
Component: rpmAssignee: Packaging Maintenance Team <packaging-team-maint>
Status: CLOSED NOTABUG QA Contact: swm-qe
Severity: medium Docs Contact:
Priority: unspecified    
Version: 7.8CC: pmatilai
Target Milestone: rcFlags: pm-rhel: mirror+
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2022-02-25 07:40:17 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

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.