Bug 485707 - README.RPM identified as application/x-rpm and not text/plain
README.RPM identified as application/x-rpm and not text/plain
Product: Fedora
Classification: Fedora
Component: shared-mime-info (Show other bugs)
All Linux
low Severity medium
: ---
: ---
Assigned To: Bastien Nocera
Fedora Extras Quality Assurance
Depends On:
  Show dependency treegraph
Reported: 2009-02-16 09:40 EST by Fabrice Colin
Modified: 2009-02-17 09:42 EST (History)
1 user (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2009-02-16 10:44:40 EST
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)

  None (edit)
Description Fabrice Colin 2009-02-16 09:40:17 EST
Description of problem:

The rules in /usr/share/mime/packages/freedesktop.org.xml cause any file with the extension "RPM" to be identified as "application/x-rpm". Clearly that's way too broad.

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

How reproducible:

Steps to Reproduce:
1. Install mod_fcgid
2. Run "xdg-mime query filetype /usr/share/doc/mod_fcgid-2.2/README.RPM"
3. Note the output is "application/x-rpm" even though the file is text
4. Run "file -bi /usr/share/doc/mod_fcgid-2.2/README.RPM"
5. Note that file & libmagic identify the file type correctly ("text/plain charset=us-ascii")

Actual results:
Any file with the extension "RPM" is identified as being an RPM package.

Expected results:
The extension should be used as a last resort. Shared-mime-info should be configured to peek at the contents as done by file & libmagic.

Additional info:
This is not restricted to "/usr/share/doc/mod_fcgid-2.2/README.RPM". Any file with the extension "RPM" is incorrectly identified.
Comment 1 Bastien Nocera 2009-02-16 10:44:40 EST
That's not what the spec says. It says we identify by extension first, to avoid expensive reads. Feel free to bring this upstream on the xdg list if you feel stronly about it.
Comment 2 Fabrice Colin 2009-02-17 09:42:04 EST
Hmm I don't mean to split hairs but the spec doesn't mention avoiding expensive reads among the reasons for trying glob patterns before the magic rules.
Anyway, thanks for your reply.

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