Bug 850923 - "file -i" doesn't recognize PHP scripts
Summary: "file -i" doesn't recognize PHP scripts
Keywords:
Status: CLOSED NEXTRELEASE
Alias: None
Product: Red Hat Enterprise Linux 5
Classification: Red Hat
Component: file
Version: 5.10
Hardware: Unspecified
OS: Linux
unspecified
low
Target Milestone: rc
: ---
Assignee: Jan Kaluža
QA Contact: BaseOS QE Security Team
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2012-08-22 18:44 UTC by William Yardley
Modified: 2013-03-11 08:33 UTC (History)
0 users

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2013-03-11 08:33:34 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)

Description William Yardley 2012-08-22 18:44:22 UTC
Description of problem:
"file -i" doesn't seem to have the right "magic" to recognize PHP scripts ("file" without -i does).
The builtin "magic.mime" file distributed with "file" doesn't seem to have anything pertaining to PHP.

/usr/share/file/magic does have some stuff to recognize PHP files.
Is this intentional, or just an oversight? The behavior seems to have changed in more recent Fedora / Redhat releases.


Version-Release number of selected component (if applicable):
4.17-21

How reproducible:
Reproducible

Steps to Reproduce:
$ file -i /tmp/ldap.php.pdf

Actual results:
/tmp/ldap.php.pdf: text/plain; charset=us-ascii

Expected results:
/tmp/ldap.php.pdf: text/x-php; charset=us-ascii

Additional info:
My co-worker got the "expected results" above on a FC16 box with file 5.07-6.fc16. I haven't checked RHEL6 yet.

Comment 1 William Yardley 2012-08-22 18:46:41 UTC
[Obviously, in the example above, the example file "ldap.php.pdf" is a PHP script, not a PDF]

Comment 3 Jan Kaluža 2013-03-11 08:33:34 UTC
I am sorry, but it is now too late in the RHEL-5 release cycle.
RHEL-5.10 (the next RHEL-5 minor release) is going to be the first
production phase 2 [1] release of RHEL-5. Since phase 2 we'll be
addressing only security and critical issues.
This one issue is fixed in RHEL-6 therefore I am closing the bug as
NEXTRELEASE.

[1] https://access.redhat.com/support/policy/updates/errata/


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