Subject: | Wrong match of GIF file |
I have a GIF file for which File::MMagic reports it's "ext2 filesystem data":
$ perl -MFile::MMagic -e 'warn File::MMagic->new("/usr/share/magic")->checktype_filename("000037E8_thmb.gif")'
[some warnings]
Linuxrev -1383510264.27931ext2 filesystem data(mounted or unclean)(errors)(compressed) at -e line 1.
file(1) also gives the same wrong result. I suspect it's because of the
ordering of magic numbers in the /usr/share/magic file: the ext2 magics
are before the GIF magics. A possible solution would be to sort the
magics by offset. The ext2 magic begins with
0x438 leshort 0xEF53 Linux
and the offset of 0x438 should be treated less significant than the offset
of 0 used in the GIF magic.
Regards,
Slaven