zstd-compressed RPMs use streaming frames (fcs_field=0) without content size. 
When decompressing such payloads via `unzstd`:

1. `unzstd` exits with status 1 on streaming frames because the frame appears 
incomplete. The shell's `-e` flag causes rpm2cpio to terminate prematurely, 
truncating the output at a page-aligned boundary.

2. `unzstd` without `-f` drops the last byte of decompressed output.

**Fix:**
- Remove `-e` from the shebang (`#!/bin/sh -fu`)
- Add `-f` to `unzstd` invocation

**Tested:** RPM 4.18.2, zstd-compressed layer-shell-qt and xorg-x11-server 
packages. Before: output truncated at 4096-byte boundary. After: full 108769 
and 3820608 bytes respectively, CPIO archives pass validation.
You can view, comment on, or merge this pull request online at:

  https://github.com/rpm-software-management/rpm/pull/4267

-- Commit Summary --

  * Fix rpm2cpio truncation for zstd-compressed RPMs

-- File Changes --

    M scripts/rpm2cpio.sh (4)

-- Patch Links --

https://github.com/rpm-software-management/rpm/pull/4267.patch
https://github.com/rpm-software-management/rpm/pull/4267.diff

-- 
Reply to this email directly or view it on GitHub:
https://github.com/rpm-software-management/rpm/pull/4267
You are receiving this because you are subscribed to this thread.

Message ID: <rpm-software-management/rpm/pull/[email protected]>
_______________________________________________
Rpm-maint mailing list
[email protected]
https://lists.rpm.org/mailman/listinfo/rpm-maint

Reply via email to