]> granicus.if.org Git - file/commitdiff
add java jar file detection from:
authorChristos Zoulas <christos@zoulas.com>
Thu, 5 Jul 2012 21:48:24 +0000 (21:48 +0000)
committerChristos Zoulas <christos@zoulas.com>
Thu, 5 Jul 2012 21:48:24 +0000 (21:48 +0000)
http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6211008
http://hg.openjdk.java.net/jdk7/jdk7/jdk/file/00cd9dc3c2b5/src/solaris/bin/jexec.c

magic/Magdir/archive

index 099b312e035832edcdfbed651c227655d540510d..265f79f446da62db5424cf3f0b0fc124a8c88c38 100644 (file)
@@ -1,5 +1,5 @@
 #------------------------------------------------------------------------------
-# $File: archive,v 1.69 2011/09/28 13:22:54 christos Exp $
+# $File: archive,v 1.70 2011/10/26 15:44:47 christos Exp $
 # archive:  file(1) magic for archive formats (see also "msdos" for self-
 #           extracting compressed archives)
 #
 >>>38          regex   [!-OQ-~]+               Zip data (MIME type "%s"?)
 !:mime application/zip
 
+# Java Jar files
+>(26.s+30)     leshort 0xcafe          Java Jar file data (zip)
+!:mime application/jar
+
 # Generic zip archives (Greg Roelofs, c/o zip-bugs@wkuvx1.wku.edu)
 #   Next line excludes specialized formats:
->26    string          !\x8\0\0\0mimetype      Zip archive data
+>(26.s+30)     leshort !0xcafe
+>>26    string          !\x8\0\0\0mimetype     Zip archive data
 !:mime application/zip
->>   byte            0x09            \b, at least v0.9 to extract
->>   byte            0x0a            \b, at least v1.0 to extract
->>   byte            0x0b            \b, at least v1.1 to extract
->>   byte            0x14            \b, at least v2.0 to extract
->>   byte            0x2d            \b, at least v3.0 to extract
->>0x161        string          WINZIP          \b, WinZIP self-extracting
+>>>4   byte            0x09            \b, at least v0.9 to extract
+>>>4   byte            0x0a            \b, at least v1.0 to extract
+>>>4   byte            0x0b            \b, at least v1.1 to extract
+>>>4   byte            0x14            \b, at least v2.0 to extract
+>>>4   byte            0x2d            \b, at least v3.0 to extract
+>>>0x161       string          WINZIP          \b, WinZIP self-extracting
 
 # StarView Metafile
 # From Pierre Ducroquet <pinaraf@pinaraf.info>