Bug 637785

Summary: file command can't identify the zip64 format correctly.
Product: [Fedora] Fedora Reporter: ritz <rkhadgar>
Component: fileAssignee: Jan Kaluža <jkaluza>
Status: CLOSED RAWHIDE QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: medium Docs Contact:
Priority: medium    
Version: rawhideCC: jkaluza
Target Milestone: ---   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: 637782 Environment:
Last Closed: 2010-09-29 07:21:32 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Attachments:
Description Flags
patch none

Description ritz 2010-09-27 12:17:57 UTC
+++ This bug was initially created as a clone of Bug #637782 +++

Description of problem:
file command can't identify the zip64[1] format correctly.

Version-Release number of selected component (if applicable):
zip-3.0-1.el6.x86_64

How reproducible:
always

Steps to Reproduce:
1. Create an archive as zip v3.0 format. 
$ echo foo | zip > test.zip 

2. Check a file type of the created archive by the file command. 
$ file test.zip 

Actual results:
The file command identifies a zip64 format archive as "data". 

Expected results:
The file command identifies a zip64 format archive as "ZIP64 archive data". 

Additional info:
magic bit from zip file 

50 4B 03 04  14 < -- correctly identified    --> PK...
50 4B 03 04  2D <-- incorrectly identified --> PK..-

From magic definition file
# ZIP archives (Greg Roelofs, c/o zip-bugs.edu)
0       string          PK\003\004
>30     ubelong         !0x6d696d65
...
>>4     byte            0x14            Zip archive data, at least v2.0 to extract
!:mime  application/zip
<-- add here
>>4     byte            0x2d            Zip64 archive data, at least v3.0 to extract
!:mime  application/zip


Adding 2d to the list here should fix this.  2D is used to identify "zip64" format. This issue can also be triggered


This needs to pushed upstream.


[1] http://en.wikipedia.org/wiki/ZIP_%28file_format%29

Comment 1 ritz 2010-09-27 12:30:16 UTC
Created attachment 449876 [details]
patch

add zip4 magic to db

Comment 2 Jan Kaluža 2010-09-29 07:21:32 UTC
Patch sent upstream and fixed in rawhide.