Bug #67647 [NEW]: Bundled libmagic 5.17 does not detect quicktime files correctly

From: Date: Fri, 18 Jul 2014 08:24:46 +0000
Subject: Bug #67647 [NEW]: Bundled libmagic 5.17 does not detect quicktime files correctly
Groups: php.bugs 
Request: Send a blank email to php-bugs+get-186719@lists.php.net to get a copy of this message
From:             emkael at tlen dot pl
Operating system: Debian 3.14.12 x86_64 GNU/Linux
PHP version:      5.6.0RC2
Package:          Filesystem function related
Bug Type:         Bug
Bug description:Bundled libmagic 5.17 does not detect quicktime files correctly

Description:
------------
Version 5.6.0RC2 bundles libmagic in version 5.17.

That version, contrary to (i.e.) 5.19, fails to detect certain quicktime
files as video/quicktime, and serves "binary" instead.

I've attached a series of command-line tests that replicate the issue
and correlate it with libmagic version, attached below.

Unfortunately, the test does not replicate the issue with a sample MOV
file from Apple's KB, but works on various other MOV files.

The offending file magic rule was commented out from the file Magdir
database in February (so, it's fixed in libmagic version >= 5.18):
https://github.com/file/file/commit/f2750e17d784dd6b21f7649965d2bd0605bfd471#diff-45a78c19f30f8e352b631e9f1d9931d2R1876

PS I'm not sure which packages does this issue belong to, apologies for
that.

Test script:
---------------
user@machine:~$ hexdump -C test.mov | head -n 1
00000000  00 00 00 20 66 74 79 70  71 74 20 20 20 05 03 00  |... ftypqt 
 ...|

user@machine:~$ file -v
file-5.19
magic file from /etc/magic:/usr/share/misc/magic

user@machine:~$ file -b --mime-type test.mov
video/quicktime

user@machine:~$ php -i | grep libmagic
libmagic => 517

user@machine:~$ php -r '$fi = new finfo(FILEINFO_MIME_TYPE);
print($fi->file("test.mov")."\n");'
binary

user@machine:~$ php -r '$fi = new finfo();
print($fi->file("test.mov")."\n");'
floppy with old FAT filesystem 320k, Media descriptor 0xff

user@other_machine:~$ file -v
file-5.17
magic file from /etc/magic:/usr/share/misc/magic

user@other_machine:~$ file -b --mime-type test.mov
binary



-- 
Edit bug report at https://bugs.php.net/bug.php?id=67647&edit=1
-- 



Thread (6 messages)

« previous php.bugs (#186719) next »