Bug 494817 - Some types of .desktop files containing MimeType key are ignored
Summary: Some types of .desktop files containing MimeType key are ignored
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Fedora
Classification: Fedora
Component: rpm
Version: rawhide
Hardware: All
OS: Linux
medium
medium
Target Milestone: ---
Assignee: Panu Matilainen
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
: 495758 (view as bug list)
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2009-04-08 08:38 UTC by Mamoru TASAKA
Modified: 2009-07-11 16:55 UTC (History)
6 users (show)

Fixed In Version: 4.7.0-2.fc11
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2009-04-17 11:14:03 UTC
Type: ---
Embargoed:


Attachments (Terms of Use)
Here's one that is classified as "UTF-8 Unicode Pascal program text, with very long lines" which causes trouble (20.33 KB, application/octet-stream)
2009-04-16 10:36 UTC, Caolan McNamara
no flags Details
and one as "ASCII text, with very long lines" (1.49 KB, application/octet-stream)
2009-04-16 10:39 UTC, Caolan McNamara
no flags Details
a handle .src.rpm which shows no mimehandler provides based on those two .desktops (11.27 KB, application/x-rpm)
2009-04-16 10:41 UTC, Caolan McNamara
no flags Details

Description Mamoru TASAKA 2009-04-08 08:38:22 UTC
Description of problem:
One example:
http://koji.fedoraproject.org/koji/taskinfo?taskID=1281540
While fedora-deluge.desktop contains:
------------------------------------------------
MimeType=application/x-bittorrent;
------------------------------------------------
$ rpm -q --provides deluge | grep mime
returns nothing.
Note that with file-5.00-5.fc11.i586
------------------------------------------------
$ file /usr/share/applications/fedora-deluge.desktop 
/usr/share/applications/fedora-deluge.desktop: ASCII English text
------------------------------------------------

Another example:
http://koji.fedoraproject.org/koji/taskinfo?taskID=1284705
Here fedora-mirage.desktop contains
-----------------------------------------------
MimeType=image/bmp;image/gif;image/jpeg;image/jpg;image/pjpeg;image/png;image/tiff;image/x-bmp;image/x-pcx;image/x-png;image/x-portable-anymap;image/x-portable-bitmap;image/x-portable-graymap;image/x-portable-pixmap;image/x-sun-raster;image/x-tga;image/x-xbitmap;image/x-xpixmap;image/svg+xml;
-----------------------------------------------
but $ rpm -ql --provides mirage-XXXX.i586.rpm | grep mime
returns nothing.
In this case $file fedora-mirage.desktop returns "ASCII text"

It seems this is because rpmbuild only checks desktop file
which returns "RPMFC_TEXT" color.

Version-Release number of selected component (if applicable):
rpm-4.7.0-0.beta1.9.fc11.i586

How reproducible:
100%

Steps to Reproduce:
1. See above
2.
3.

Comment 1 Mamoru TASAKA 2009-04-08 08:41:26 UTC
(In reply to comment #0)
> but $ rpm -ql --provides mirage-XXXX.i586.rpm | grep mime
> returns nothing.

This is $ rpm -qp --provides ...

Comment 2 Jeff Johnson 2009-04-09 20:43:40 UTC
(aside) Technically, there is no RPMFC_TEXT color because
the bits are masked and not distributed. The RPMFC_FOO
bits are purely a means to achieve a set of bits to be
tested for filtering/dispatching helpers, not colors per se.

If this flaw showed up recently, then its related to
the recent choice to handle RPMFC_TEXT later in
order to automate font automagic dependencies.

Nothing wrong with handling RPMFC_ASCII later,
the real flaw is within libmagic, mis-identifications
with file(1) that are at least 20 years old and due to
using the first rule that matches, which can cause
rpmfc filtering flaws, particularly if
system, rather than rpm internal, magic is used.

Still magic is better than suffixes for file classification imho.

Comment 3 Caolan McNamara 2009-04-16 10:36:36 UTC
Created attachment 339822 [details]
Here's one that is classified as "UTF-8 Unicode Pascal program text, with very long lines" which causes trouble

Comment 4 Caolan McNamara 2009-04-16 10:39:50 UTC
Created attachment 339823 [details]
and one as "ASCII text, with very long lines"

Here's one that is classified as "ASCII text, with very long lines" which causes trouble

Comment 5 Caolan McNamara 2009-04-16 10:41:12 UTC
Created attachment 339824 [details]
a handle .src.rpm which shows no mimehandler provides based on those two .desktops

A standalone .src.rpm testcase

Comment 6 Caolan McNamara 2009-04-16 10:50:51 UTC
*** Bug 495758 has been marked as a duplicate of this bug. ***

Comment 7 Jeff Johnson 2009-04-16 11:25:37 UTC
All that rpm does is use file(1) and libmagic with very light filtering
to remove the worst of the problems.

Issues with file(1) and magic(3) classification should be reported against file(1).

Comment 8 Panu Matilainen 2009-04-17 11:14:03 UTC
Should be fixed in rpm-4.7.0-2.fc12 (but it'll take quite some time before it hits the builders)

Comment 9 Fedora Update System 2009-06-18 16:19:05 UTC
rpm-4.7.0-2.fc11 has been submitted as an update for Fedora 11.
http://admin.fedoraproject.org/updates/rpm-4.7.0-2.fc11

Comment 10 Fedora Update System 2009-07-11 16:54:36 UTC
rpm-4.7.0-2.fc11 has been pushed to the Fedora 11 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.