Bug 1515180 - file-5.30-11.fc26.x86_64 gif regression
Summary: file-5.30-11.fc26.x86_64 gif regression
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Fedora
Classification: Fedora
Component: file
Version: 26
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: Marek Cermak
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2017-11-20 10:40 UTC by Harald Reindl
Modified: 2018-04-27 04:06 UTC (History)
3 users (show)

Fixed In Version: file-5.33-2.fc29 file-5.31-11.fc27 file-5.33-2.fc28
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2018-04-23 15:51:15 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)
Patch proposal (799 bytes, patch)
2017-12-21 09:40 UTC, Marek Cermak
no flags Details | Diff

Description Harald Reindl 2017-11-20 10:40:45 UTC
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

Comment 1 Kamil Dudka 2017-11-21 16:12:50 UTC
Confirmed.  Thanks for the report!

I am getting the same result also with file-5.32-1.fc28.

Comment 2 Harald Reindl 2017-11-23 10:44:24 UTC
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]

Comment 3 Marek Cermak 2017-12-21 09:40:16 UTC
Created attachment 1370769 [details]
Patch proposal

Patch proposal has been sent to upstream for review.


link to upstream: https://github.com/file

Comment 4 Harald Reindl 2018-01-30 06:29:20 UTC
still the same: file-5.31-10.fc27.x86_64

Comment 5 Harald Reindl 2018-04-12 18:24:34 UTC
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?

Comment 6 Kamil Dudka 2018-04-15 08:30:27 UTC
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?

Comment 7 Harald Reindl 2018-04-15 09:12:56 UTC
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

Comment 8 Kamil Dudka 2018-04-16 15:04:55 UTC
Could you please try the testing build from my file-testing copr?

https://copr.fedorainfracloud.org/coprs/kdudka/file-testing/

Comment 9 Harald Reindl 2018-04-16 17:33:20 UTC
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)

Comment 10 Marek Cermak 2018-04-16 19:09:32 UTC
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.

Comment 11 Harald Reindl 2018-04-16 19:41:57 UTC
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 :-)

Comment 12 Kamil Dudka 2018-04-17 10:02:54 UTC
I have reposted the patch upstream with both of you in CC.

Comment 13 Fedora Update System 2018-04-18 07:25:41 UTC
file-5.33-2.fc28 has been submitted as an update to Fedora 28. https://bodhi.fedoraproject.org/updates/FEDORA-2018-4415fe6bf8

Comment 14 Kamil Dudka 2018-04-18 07:26:51 UTC
upstream commit:

https://github.com/file/file/commit/4a870863

Comment 15 Fedora Update System 2018-04-18 07:34:09 UTC
file-5.31-11.fc27 has been submitted as an update to Fedora 27. https://bodhi.fedoraproject.org/updates/FEDORA-2018-af4805ccc4

Comment 16 Fedora Update System 2018-04-18 16:21:04 UTC
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

Comment 17 Fedora Update System 2018-04-19 01:36:40 UTC
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

Comment 18 Fedora Update System 2018-04-23 15:51:15 UTC
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.

Comment 19 Fedora Update System 2018-04-27 04:06:23 UTC
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.


Note You need to log in before you can comment on or make changes to this bug.