for many years PHP had it wrong and the 'file' command from Fedora correct but now Fedora is affectd from https://bugs.php.net/bug.php?id=67516 https://access.thelounge.net/harry/php-mimetype-bug.gif [builduser@testserver:/rpmbuild/SPECS]$ rpm -q file file-5.30-11.fc26.x86_64 [builduser@testserver:/rpmbuild/SPECS]$ file --mime-type /Volumes/dune/www-servers/cms/cms/autotests/custom/fileinfo_samples/php-bug-67516.gif /Volumes/dune/www-servers/cms/cms/autotests/custom/fileinfo_samples/php-bug-67516.gif: application/octet-stream
Confirmed. Thanks for the report! I am getting the same result also with file-5.32-1.fc28.
FYI: PHP 7.2-dev even has that image now in the php test-suite, would be nice when upstream does the same to prevent that regression coming back every few years FAILED TEST SUMMARY --------------------------------------------------------------------- Bug #67516 wrong mimetypes with finfo_file(filename, FILEINFO_MIME_TYPE) [ext/fileinfo/tests/bug67516.phpt]
Created attachment 1370769 [details] Patch proposal Patch proposal has been sent to upstream for review. link to upstream: https://github.com/file
still the same: file-5.31-10.fc27.x86_64
jesus can we get fixed that idiotic bug? * it took 4 years after report it to PHP (while it existed another 4 years) * at that point in timeyou couldn't build PHP with system's libmagic * now with PHP 7.2 you can build with system libmagic and now while PHP has fixed it systems libmagic is broken * can we have this bug fixed so that PHP and "file" report the same before i get old and die?
Thanks for the reminder, Harald! Have you tried the patch in attachment #1370769 [details]? How did it work for you? Marek, have you received any reply on your patch from upstream?
what about at least a scratch build with the attached patch - upstream is nice but wouldn't be the first patch in Fedora packages over years 5 months without even a testing build is poor handling
Could you please try the testing build from my file-testing copr? https://copr.fedorainfracloud.org/coprs/kdudka/file-testing/
2018-04-16T17:27:54Z INFO Upgraded: file-libs-5.32-4.1.fc27.x86_64 2018-04-16T17:27:54Z INFO Upgraded: file-5.32-4.1.fc27.x86_64 2018-04-16T17:27:54Z INFO Upgraded: python3-magic-5.32-4.1.fc27.noarch looks good, the so rebuilt magic-database bundeled with "php-fileinfo" passes now our internal test at build-time (profile-guided-optimization with tests as code-coverage) without a warning patching file ext/standard/tests/general_functions/phpinfo.phpt + tar xzf /rpmbuild/SOURCES/apcu-5.1.11.tgz + mv apcu-5.1.11 ./ext/apcu + '[' -f /usr/bin/php ']' + /usr/bin/php ext/fileinfo/create_data_file.php /usr/share/misc/magic.mgc * OK: CUSTOM: httpd_config(0.016) * OK: CUSTOM: utf8(2.051) * OK: CUSTOM: rh_network(0.001) * OK: CUSTOM: mysqli(0.039) * OK: CUSTOM: hash(0.028) * OK: CUSTOM: exif(0.106) * OK: CUSTOM: gd(0.016) * OK: CUSTOM: json(0.007) * OK: CUSTOM: search(0.037) * OK: CUSTOM: fileinfo(0.078) * OK: CUSTOM: misc(0.006) * OK: CUSTOM: base64(0.006)
Thanks Kamil for creating the copr and Harald for testing this. It is a stupid bug, I know. The upstream is extremely irresponsive nowadays (the mailing list and even the bug tracker has been down for quite a long time now), I've already tried to send the patch proposal twice without success, not even email response.
thanks for the patch - it annoys me for several reasons - mostly because i wrote a script for mod_security to check file mimetypes and verified it with already present files while this one had application/octect-stream in php so i decided to use the file-command instead the php-extension becaus ethe shell recognized it properly and most important when something is rejcted that a simple file-command in the shell on the same machine give the same results in the meantime the PHP bundeled one got useable, other than in the past you can even build PHP 7.2 with the systems libmagic (/usr/bin/php ext/fileinfo/create_data_file.php /usr/share/misc/magic.mgc) but now it's wrong again, at least with "bundle" systems libmagic both, php and the terminal are identically wrong but frankly i don't want to see that any longer :-)
I have reposted the patch upstream with both of you in CC.
file-5.33-2.fc28 has been submitted as an update to Fedora 28. https://bodhi.fedoraproject.org/updates/FEDORA-2018-4415fe6bf8
upstream commit: https://github.com/file/file/commit/4a870863
file-5.31-11.fc27 has been submitted as an update to Fedora 27. https://bodhi.fedoraproject.org/updates/FEDORA-2018-af4805ccc4
file-5.33-2.fc28 has been pushed to the Fedora 28 testing repository. If problems still persist, please make note of it in this bug report. See https://fedoraproject.org/wiki/QA:Updates_Testing for instructions on how to install test updates. You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2018-4415fe6bf8
file-5.31-11.fc27 has been pushed to the Fedora 27 testing repository. If problems still persist, please make note of it in this bug report. See https://fedoraproject.org/wiki/QA:Updates_Testing for instructions on how to install test updates. You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2018-af4805ccc4
file-5.31-11.fc27 has been pushed to the Fedora 27 stable repository. If problems still persist, please make note of it in this bug report.
file-5.33-2.fc28 has been pushed to the Fedora 28 stable repository. If problems still persist, please make note of it in this bug report.