]> granicus.if.org Git - file/commitdiff
Improve Zip detection.
authorReuben Thomas <rrt@sc3d.org>
Sun, 14 Feb 2010 23:00:09 +0000 (23:00 +0000)
committerReuben Thomas <rrt@sc3d.org>
Sun, 14 Feb 2010 23:00:09 +0000 (23:00 +0000)
ChangeLog
magic/Magdir/archive

index 6d89311955e32a3440360ba98509d8d54295286b..330b20a7302d5d4fdd6e09278a1206b5e9724cb6 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2010-02-14  22:58  Reuben Thomas <rrt@sc3d.org>
+
+       * Re-jig Zip file type magic so that unsupported special
+         Zip types (those with "mimetype" at offset 30) can be
+         recognized.
+
 2010-02-02  21:50  Reuben Thomas <rrt@sc3d.org>
 
        * Add support for OCF (EPUB) files (application/epub+zip)
index cbebde3657b657985353f163227d048d3eb2ffa2..33545d6a132aa96ae26300cdff446e3a7fc64364 100644 (file)
@@ -1,5 +1,5 @@
 #------------------------------------------------------------------------------
-# $File: archive,v 1.56 2010/02/02 21:51:46 rrt Exp $
+# $File: archive,v 1.57 2010/02/14 23:00:09 rrt Exp $
 # archive:  file(1) magic for archive formats (see also "msdos" for self-
 #           extracting compressed archives)
 #
 0      string          PK\x07\x08PK\x03\x04    Zip multi-volume archive data, at least PKZIP v2.50 to extract
 !:mime application/zip
 
-# ZIP archives (Greg Roelofs, c/o zip-bugs@wkuvx1.wku.edu)
+# Zip archives (Greg Roelofs, c/o zip-bugs@wkuvx1.wku.edu)
 0      string          PK\003\004
->30    ubelong         !0x6d696d65
->>4    byte            0x00            Zip archive data
-!:mime application/zip
->>4    byte            0x09            Zip archive data, at least v0.9 to extract
-!:mime application/zip
->>4    byte            0x0a            Zip archive data, at least v1.0 to extract
-!:mime application/zip
->>4    byte            0x0b            Zip archive data, at least v1.1 to extract
-!:mime application/zip
->>0x161        string          WINZIP          Zip archive data, WinZIP self-extracting
-!:mime application/zip
->>4    byte            0x14            Zip archive data, at least v2.0 to extract
-!:mime application/zip
+
+# Specialised zip formats
+>30    string          mimetype
 
 # OpenOffice.org / KOffice / StarOffice documents
-# Listed here because they ARE zip files
-#
 # From: Abel Cheung <abel@oaka.org>
->30    string          mimetype
 
 # KOffice (1.2 or above) formats
 >>50   string  vnd.kde.                KOffice (>=1.2)
 >>50   string  epub+zip                OEBPS Container Format (OCF) 1.0 (EPUB)
 !:mime application/epub+zip
 
+# Generic zip archives (Greg Roelofs, c/o zip-bugs@wkuvx1.wku.edu)
+# N.B. Must come after specialised formats
+# Next line simply matches anything, including "mimetype" as used above
+>30    byte            x
+>>4    byte            0x00            Zip archive data
+!:mime application/zip
+>>4    byte            0x09            Zip archive data, at least v0.9 to extract
+!:mime application/zip
+>>4    byte            0x0a            Zip archive data, at least v1.0 to extract
+!:mime application/zip
+>>4    byte            0x0b            Zip archive data, at least v1.1 to extract
+!:mime application/zip
+>>0x161        string          WINZIP          Zip archive data, WinZIP self-extracting
+!:mime application/zip
+>>4    byte            0x14            Zip archive data, at least v2.0 to extract
+!:mime application/zip
+
 # Zoo archiver
 20     lelong          0xfdc4a7dc      Zoo archive data
 !:mime application/x-zoo