Bug 115397 - rpmbuild does not properly check zip files
Summary: rpmbuild does not properly check zip files
Alias: None
Product: Fedora
Classification: Fedora
Component: rpm   
(Show other bugs)
Version: 1
Hardware: All
OS: Linux
Target Milestone: ---
Assignee: Jeff Johnson
QA Contact: Mike McLean
Depends On:
TreeView+ depends on / blocked
Reported: 2004-02-11 21:53 UTC by Peter McGregor
Modified: 2007-11-30 22:10 UTC (History)
0 users

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2004-02-11 22:32:31 UTC
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)
Bad zip file (7.48 KB, application/zip)
2004-02-11 21:55 UTC, Peter McGregor
no flags Details
Good zip file (8.61 KB, application/zip)
2004-02-11 21:56 UTC, Peter McGregor
no flags Details

Description Peter McGregor 2004-02-11 21:53:55 UTC
From Bugzilla Helper:
User-Agent: Mozilla/5.0 (Macintosh; U; PPC Mac OS X Mach-O; en-US;
rv:1.4) Gecko/20030624

Description of problem:
When rpmbuild encounters an invalid zip file it assumes it must be a tar
and tries to untar it. The resulting error is misleading.
rpmbuild should display zip file errors if the zip file is invalid.

An example of an invalid zip file is jta-1_0_1B-classes.zip
downloaded by mozilla 1.4 from java.sun.com(search for jta)
Mozilla 1.4 7660 bytes
safari      8812 bytes

Error occurred when trying to build a jta rpm under the jpackage

Version-Release number of selected component (if applicable):
RPM version 4.2.1

How reproducible:

Steps to Reproduce:
1.Try to build jta rpm file from www.jpackage.org

Actual Results:  A tar error was reported

Expected Results:  Zip file error should have been reported

Additional info:

Im using fredora core

The error is
rpmbuild --without javadoc -ba rpm/SPECS/jta.spec
Executing(%prep): /bin/sh -e /home/advso/rpm/tmp/rpm-tmp.6078
+ umask 022
+ cd /home/advso/rpm/BUILD
+ export LANG
+ unset DISPLAY
+ cd /home/advso/rpm/BUILD
+ rm -rf jta-1.0.1
+ /bin/mkdir -p jta-1.0.1
+ cd jta-1.0.1
+ tar -xf /home/advso/rpm/SOURCES/jta-1_0_1B-classes.zip
tar: This does not look like a tar archive
tar: Skipping to next header
tar: Error exit delayed from previous errors
error: Bad exit status from /home/advso/rpm/tmp/rpm-tmp.6078 (%prep)

Comment 1 Peter McGregor 2004-02-11 21:55:18 UTC
Created attachment 97595 [details]
Bad zip file

Comment 2 Peter McGregor 2004-02-11 21:56:23 UTC
Created attachment 97596 [details]
Good zip file

Comment 3 Jeff Johnson 2004-02-11 22:32:31 UTC
Try doing the same thing manually in %prep, as byte 1 (where the magic
lives that is used to identify which uncompressor is to be used)
isdifferent between the 2 zip files you have attached.

The %prep runs with /bin/sh -e, so any non-zero return should
exit. Assuming zip returns valid exit code.

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