Created attachment 561896 [details] Patch fixing the bug Description of problem: Running rpm2cpio on rpm that contains cpio archive larger than ~2G unpacks the archive correctly, but returns code 1 (without any message on stderr). Version-Release number of selected component (if applicable): 4.9.1.2-5.fc16 How reproducible: Always (on my machine). Steps to Reproduce: 1. Download http://kojipkgs.fedoraproject.org/packages/paraview/3.12.0/5.fc17/x86_64/paraview-debuginfo-3.12.0-5.fc17.x86_64.rpm 2. Run rpm2cpio paraview-debuginfo-3.12.0-5.fc17.x86_64.rpm >/dev/null 3. Run echo $? Actual results: 1 Expected results: 0 Additional info: The bug is due to an integer overflow in rpmio.c. Attached is a patch against current git (7a9a5505667c681044bacb21c9b84ac66c062fe7) that hopefully fixes the problem.
Yup, the ufdCopy() incorrect return type is known (but many times forgotten) problem. ssize_t is not enough for it either, off_t would be more like it. Unfortuntely ufdCopy() is part of librpmio public API so changing the return type can't really be done in a stable release, short of grabbing an internal copy of it into rpm2cpio (which actually is the only caller within rpm itself) for the time being. Thanks for the report and patch anyway, having an open bug helps to avoid forgetting about it yet again :)
Fixed upstream now for what will be rpm >= 4.10 where the slight API change is still possible, for older versions this will need a slightly different approach.
*** Bug 744712 has been marked as a duplicate of this bug. ***
This in fixed in Fedora >= 18. As noted in comment #1, the API problem can't be fixed in rpm 4.9.x and doesn't seem worth the trouble working around...