Red Hat Bugzilla – Bug 485707
README.RPM identified as application/x-rpm and not text/plain
Last modified: 2009-02-17 09:42:04 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):
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")
Any file with the extension "RPM" is identified as being an RPM package.
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.
This is not restricted to "/usr/share/doc/mod_fcgid-2.2/README.RPM". Any file with the extension "RPM" is incorrectly identified.
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.
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.