Bug 790396 - rpm2cpio returns failure exit code on large files even though it ran successfully
Summary: rpm2cpio returns failure exit code on large files even though it ran successf...
Keywords:
Status: CLOSED NEXTRELEASE
Alias: None
Product: Fedora
Classification: Fedora
Component: rpm
Version: 16
Hardware: x86_64
OS: Linux
unspecified
unspecified
Target Milestone: ---
Assignee: Panu Matilainen
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
: 744712 (view as bug list)
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2012-02-14 12:31 UTC by Martin Milata
Modified: 2012-11-19 11:08 UTC (History)
6 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2012-11-19 11:08:03 UTC
Type: ---
Embargoed:


Attachments (Terms of Use)
Patch fixing the bug (1.97 KB, patch)
2012-02-14 12:31 UTC, Martin Milata
no flags Details | Diff

Description Martin Milata 2012-02-14 12:31:30 UTC
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.

Comment 1 Panu Matilainen 2012-02-16 06:47:17 UTC
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 :)

Comment 2 Panu Matilainen 2012-03-14 09:24:55 UTC
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.

Comment 3 Karel Klíč 2012-09-18 11:26:00 UTC
*** Bug 744712 has been marked as a duplicate of this bug. ***

Comment 4 Panu Matilainen 2012-11-19 11:08:03 UTC
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...


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