Bug 485707 - README.RPM identified as application/x-rpm and not text/plain
Summary: README.RPM identified as application/x-rpm and not text/plain
Keywords:
Status: CLOSED NOTABUG
Alias: None
Product: Fedora
Classification: Fedora
Component: shared-mime-info
Version: 10
Hardware: All
OS: Linux
low
medium
Target Milestone: ---
Assignee: Bastien Nocera
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2009-02-16 14:40 UTC by Fabrice Colin
Modified: 2009-02-17 14:42 UTC (History)
1 user (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2009-02-16 15:44:40 UTC
Type: ---
Embargoed:


Attachments (Terms of Use)

Description Fabrice Colin 2009-02-16 14:40:17 UTC
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):
0.51.5fc10

How reproducible:
Always.

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 15:44:40 UTC
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 14:42:04 UTC
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.