Bug 193582 - gnome-vfs seems not to use the magic number
Summary: gnome-vfs seems not to use the magic number
Keywords:
Status: CLOSED WORKSFORME
Alias: None
Product: Fedora
Classification: Fedora
Component: gnome-vfs2
Version: 5
Hardware: All
OS: Linux
medium
medium
Target Milestone: ---
Assignee: Alexander Larsson
QA Contact:
URL:
Whiteboard:
: 186241 195471 (view as bug list)
Depends On:
Blocks: 186241
TreeView+ depends on / blocked
 
Reported: 2006-05-30 19:30 UTC by Piergiorgio Sartor
Modified: 2007-11-30 22:11 UTC (History)
4 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2006-06-26 18:24:57 UTC
Type: ---
Embargoed:


Attachments (Terms of Use)
Magic file from FC-5 that doesn't recognise PDFs (10.11 KB, application/octet-stream)
2006-06-23 07:27 UTC, Alex Lancaster
no flags Details
Magic file from FC-4 in which evince does recognise PDFs (10.11 KB, application/octet-stream)
2006-06-23 07:29 UTC, Alex Lancaster
no flags Details
patch against freedesktop.org.xml.in: set priorities for "%" matches properly (817 bytes, patch)
2006-06-24 22:23 UTC, Levin Fritz
no flags Details | Diff
patch for spec file: apply shared-mime-info-0.17-tex-matlab.patch (1.24 KB, patch)
2006-06-24 23:01 UTC, Levin Fritz
no flags Details | Diff


Links
System ID Private Priority Status Summary Last Updated
FreeDesktop.org 6577 0 None None None Never

Description Piergiorgio Sartor 2006-05-30 19:30:34 UTC
Description of problem:
As for bug #189086 in relation to comment #1, I would like to
reassign it to gnome-vfs (but I could not), so I report directly.

Version-Release number of selected component (if applicable):
2.14.1-1.fc5.2

How reproducible:
Well, I would say always.

Steps to Reproduce:
1.
See the above mentioned bug and related comment or
2.
Take a pdf file, let's say "mydoc.pdf".
3.
Rename (or copy) without the extension, for example as "mydoc".
4.
Try to open from nautilus.
  
Actual results:
An error is reported:
Couldn't display "/home/red/tmp/Incoming/mydoc".

Expected results:
The usual PDF application is used to open the file, usually "evince" or "xpdf".

Additional info:
The file /etc/gnome-vfs-mime-magic should containt the information necessary to
open a file using the magic number.
Specifically, it containts the PDF type, so there is no reason, AFAIK, for the
error.

Comment 1 Piergiorgio Sartor 2006-05-30 19:33:29 UTC
I forgot something.
If we look at the file properties, we see it is reported:

MIME type: application/octet-stream

as for the error in firefox.

Comment 2 Alex Lancaster 2006-06-08 09:37:27 UTC
This bug also appears to cause bug #186241.

I can verify that magic numbers aren't being used  by commenting out a line in
/usr/share/mime/globs (say image/jpeg: *.jpg) and gnomevfs-info will report all
image files as "application/octet-stream".


Comment 3 Alex Lancaster 2006-06-14 05:56:17 UTC
In the PDF case, see also bug #188584.

Comment 4 Alex Lancaster 2006-06-23 07:27:53 UTC
Created attachment 131413 [details]
Magic file from FC-5 that doesn't recognise PDFs

Magic file from FC-5 in which evince doesn't recognise PDFs.

Comment 5 Alex Lancaster 2006-06-23 07:29:23 UTC
Created attachment 131414 [details]
Magic file from FC-4 in which evince does recognise PDFs

If I use this magic file (from my FC-4 installation) in place of the original
FC-5 magic file, evince correctly recognises the file as a PDF even without the
.pdf extension.

Comment 6 Alex Lancaster 2006-06-23 07:30:10 UTC
(In reply to comment #4)

> Magic file from FC-5 in which evince doesn't recognise PDFs.

...if the PDF doesn't have the .pdf extension.


Comment 7 Alex Lancaster 2006-06-23 07:35:48 UTC
These files are from /usr/share/mime/magic which is generated by the
shared-mime-info package.

Comment 8 Alex Lancaster 2006-06-23 07:41:53 UTC
Bumping the priority on the application/pdf to 60 in /usr/share/mime/magic as
described in this upstream bug:

https://bugs.freedesktop.org/show_bug.cgi?id=6577

fixed this for me.

Comment 9 Piergiorgio Sartor 2006-06-23 18:28:40 UTC
I'm puzzled.
The "magic" stuff is declared twice, once in /etc/gnome-vfs-mime-magic,
which comes from "gnome-mime-data", and once in /usr/share/mime/magic,
which comes (generated) from "shared-mime-info".

I'm really curious to know what's the reason...

bye

Comment 10 Levin Fritz 2006-06-24 22:23:26 UTC
Created attachment 131487 [details]
patch against freedesktop.org.xml.in: set priorities for "%" matches properly

With this patch, the priorities for the "%" matches for text/x-matlab and
text/x-tex are set to 10 so that more specific matches like "%PDF-" have
precedence over them.

It contains the changes of this cvs commit:
http://webcvs.freedesktop.org/mime/shared-mime-info/freedesktop.org.xml.in?r1=1.138&r2=1.139

Comment 11 Levin Fritz 2006-06-24 23:01:14 UTC
Created attachment 131489 [details]
patch for spec file: apply shared-mime-info-0.17-tex-matlab.patch

This patch modifies shared-mime-info.spec so that the patch attached with
comment #10 is applied during build.

I think it would be a good idea to add the patch to the rpm because it's pretty
simple and it fixes a really annoying bug. Of course, an alternative would be
to ship a cvs snapshot or to ask the upstream maintainers to make a new release
(the latest release dates from 2006-03-14).

Comment 12 Piergiorgio Sartor 2006-06-26 18:24:57 UTC
With the latest "shared-mime-info-0.17-1.fc5.2" from updates, the fix,
from mainstream, is included.

I checked nautilus and firefox, and both operates properly with pdf files
without ".pdf" extension.

I guess this item can closed.

Comment 13 Kristian Høgsberg 2006-06-29 18:57:40 UTC
*** Bug 186241 has been marked as a duplicate of this bug. ***

Comment 14 Kristian Høgsberg 2006-06-29 21:04:49 UTC
*** Bug 195471 has been marked as a duplicate of this bug. ***


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