Bug #67647 [Opn->Fbk]: Bundled libmagic 5.17 does not detect quicktime files correctly

From: Date: Sat, 03 Jan 2015 12:47:24 +0000
Subject: Bug #67647 [Opn->Fbk]: Bundled libmagic 5.17 does not detect quicktime files correctly
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-189620@lists.php.net to get a copy of this message
Edit report at https://bugs.php.net/bug.php?id=67647&edit=1

 ID:                 67647
 Updated by:         ab@php.net
 Reported by:        emkael at tlen dot pl
 Summary:            Bundled libmagic 5.17 does not detect quicktime
                     files correctly
-Status:             Open
+Status:             Feedback
 Type:               Bug
 Package:            Filesystem function related
 Operating System:   Debian 3.14.12 x86_64 GNU/Linux
 PHP Version:        5.6.0RC2
 Block user comment: N
 Private report:     N

 New Comment:

Could you please post a minimal file to reproduce? Say cut only the furst few KB or even less that
can tell the difference.

Thanks.


Previous Comments:
------------------------------------------------------------------------
[2014-07-18 08:24:44] emkael at tlen dot pl

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 this bug report at https://bugs.php.net/bug.php?id=67647&edit=1


Thread (6 messages)

« previous php.bugs (#189620) next »