Package: file
Version: 5.04-5
Severity: normal
Tags: patch

As reported upstream [1], Windows executables have bad mime type
recognition.

The patch provided in [2] corrects the problem, so I adapted it to
apply as patch 247 in debian package.

[1] : http://mx.gw.com/pipermail/file/2010/000642.html
[2] : http://mx.gw.com/pipermail/file/2010/000648.html

-------------------------------------------------------------------------------
--- file.orig/magic/Magdir/msdos        2010-10-26 10:12:04.000000000 +0200
+++ file/magic/Magdir/msdos     2010-10-26 10:24:28.000000000 +0200
@@ -55,24 +55,41 @@
 0      string  MZ
 !:mime application/x-dosexec
 >0x18  leshort <0x40 MS-DOS executable
+!:mime application/x-dosexec
 >0 string MZ\0\0\0\0\0\0\0\0\0\0PE\0\0 \b, PE for MS Windows
+!:mime application/x-dosexec
 >>&18  leshort&0x2000  >0      (DLL)
+!:mime application/x-dosexec
 >>&88  leshort         0       (unknown subsystem)
+!:mime application/x-dosexec
 >>&88  leshort         1       (native)
+!:mime application/x-dosexec
 >>&88  leshort         2       (GUI)
+!:mime application/x-dosexec
 >>&88  leshort         3       (console)
+!:mime application/x-dosexec
 >>&88  leshort         7       (POSIX)
+!:mime application/x-dosexec
 >>&0   leshort         0x0     unknown processor
+!:mime application/x-dosexec
 >>&0   leshort         0x14c   Intel 80386
+!:mime application/x-dosexec
 >>&0   leshort         0x166   MIPS R4000
+!:mime application/x-dosexec
 >>&0   leshort         0x184   Alpha
+!:mime application/x-dosexec
 >>&0   leshort         0x268   Motorola 68000
+!:mime application/x-dosexec
 >>&0   leshort         0x1f0   PowerPC
+!:mime application/x-dosexec
 >>&0   leshort         0x290   PA-RISC
+!:mime application/x-dosexec
 >>&18  leshort&0x0100  >0      32-bit
+!:mime application/x-dosexec
 >>&18  leshort&0x1000  >0      system file
 >>&228 lelong          >0      \b, Mono/.Net assembly
 >>&0xf4 search/0x140 \x0\x40\x1\x0
+!:mime application/x-dosexec
 >>>(&0.l+(4)) string MSCF \b, WinHKI CAB self-extracting archive
 >30            string  Copyright\ 1989-1990\ PKWARE\ Inc.      Self-extracting 
 >PKZIP archive
 !:mime application/zip
@@ -83,17 +100,23 @@
 >0x18  leshort >0x3f
 >>(0x3c.l) string PE\0\0 PE
 >>>(0x3c.l+25) byte            1 \b32 executable
+!:mime application/x-dosexec
 >>>(0x3c.l+25) byte            2 \b32+ executable
+!:mime application/x-dosexec
 # hooray, there's a DOS extender using the PE format, with a valid PE
 # executable inside (which just prints a message and exits if run in win)
 >>>(0x3c.l+92) leshort         <10
 >>>>(8.s*16) string 32STUB for MS-DOS, 32rtm DOS extender
 >>>>(8.s*16) string !32STUB for MS Windows
 >>>>>(0x3c.l+22)       leshort&0x2000  >0      (DLL)
+!:mime application/x-dosexec
 >>>>>(0x3c.l+92)       leshort         0       (unknown subsystem)
 >>>>>(0x3c.l+92)       leshort         1       (native)
+!:mime application/x-dosexec
 >>>>>(0x3c.l+92)       leshort         2       (GUI)
+!:mime application/x-dosexec
 >>>>>(0x3c.l+92)       leshort         3       (console)
+!:mime application/x-dosexec
 >>>>>(0x3c.l+92)       leshort         7       (POSIX)
 >>>(0x3c.l+92) leshort         10      (EFI application)
 >>>(0x3c.l+92) leshort         11      (EFI boot service driver)
@@ -101,6 +124,7 @@
 >>>(0x3c.l+92) leshort         13      (XBOX)
 >>>(0x3c.l+4)  leshort         0x0     unknown processor
 >>>(0x3c.l+4)  leshort         0x14c   Intel 80386
+!:mime application/x-dosexec
 >>>(0x3c.l+4)  leshort         0x166   MIPS R4000
 >>>(0x3c.l+4)  leshort         0x184   Alpha
 >>>(0x3c.l+4)  leshort         0x268   Motorola 68000
@@ -108,6 +132,7 @@
 >>>(0x3c.l+4)  leshort         0x290   PA-RISC
 >>>(0x3c.l+4)  leshort         0x200   Intel Itanium
 >>>(0x3c.l+22) leshort&0x0100  >0      32-bit
+!:mime application/x-dosexec
 >>>(0x3c.l+22) leshort&0x1000  >0      system file
 >>>(0x3c.l+232) lelong >0      Mono/.Net assembly
 
@@ -139,6 +164,7 @@
 >>>>0x30               string          Inno \b, InnoSetup self-extracting 
 >>>>archive
 
 >>(0x3c.l) string !PE\0\0 MS-DOS executable
+!:mime application/x-dosexec
 
 >>(0x3c.l)             string          NE \b, NE
 >>>(0x3c.l+0x36)       byte            0 (unknown OS)
@@ -173,6 +199,7 @@
 >>(0x3c.l)             string          W3 \b, W3 for MS Windows
 
 >>(0x3c.l)             string          LE\0\0 \b, LE executable
+!:mime application/x-dosexec
 >>>(0x3c.l+0x0a)       leshort         1
 # some DOS extenders use LE files with OS/2 header
 >>>>0x240              search/0x100    DOS/4G for MS-DOS, DOS4GW DOS extender
@@ -190,8 +217,11 @@
 #>>>>(0x3c.l+0x1c)     lelong          >0x10000 for OS/2
 # fails with DOS-Extenders.
 >>>(0x3c.l+0x0a)       leshort         2 for MS Windows
+!:mime application/x-dosexec
 >>>(0x3c.l+0x0a)       leshort         3 for DOS
+!:mime application/x-dosexec
 >>>(0x3c.l+0x0a)       leshort         4 for MS Windows (VxD)
+!:mime application/x-dosexec
 >>>(&0x7c.l+0x26)      string          UPX \b, UPX compressed
 >>>&(&0x54.l-3)                string          UNACE \b, ACE self-extracting 
 >>>archive
 
@@ -207,6 +237,7 @@
 >>>>&(2.s-514) string  !LE
 >>>>>&-2       string  !BW \b, MZ for MS-DOS
 >>>>&(2.s-514) string  LE \b, LE
+!:mime application/x-dosexec
 >>>>>0x240     search/0x100    DOS/4G for MS-DOS, DOS4GW DOS extender
 # educated guess since indirection is still not capable enough for complex 
offset
 # calculations (next embedded executable would be at &(&2*512+&0-2)
@@ -259,7 +290,9 @@
 
 # skip to the end of the exe
 >(4.s*512)     long    x 
+!:mime application/x-dosexec
 >>&(2.s-517)   byte    x 
+!:mime application/x-dosexec
 >>>&0  string          PK\3\4 \b, ZIP self-extracting archive
 >>>&0  string          Rar! \b, RAR self-extracting archive
 >>>&0  string          =!\x11 \b, AIN 2.x self-extracting archive
-------------------------------------------------------------------------------

-- System Information:
Debian Release: 5.0.6
  APT prefers testing
  APT policy: (500, 'testing'), (500, 'stable')
Architecture: i386 (i686)

Kernel: Linux 2.6.26-2-openvz-686 (SMP w/2 CPU cores)
Locale: LANG=fr_FR.UTF-8, LC_CTYPE=fr_FR.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/bash

Versions of packages file depends on:
ii  libc6                  2.7-18lenny6      GNU C Library: Shared libraries
ii  libmagic1              5.04-5            File type determination library us
ii  zlib1g                 1:1.2.3.3.dfsg-12 compression library - runtime

file recommends no packages.

file suggests no packages.

-- no debconf information



-- 
To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org

Reply via email to