Bug 193582

Summary: gnome-vfs seems not to use the magic number
Product: [Fedora] Fedora Reporter: Piergiorgio Sartor <piergiorgio.sartor>
Component: gnome-vfs2Assignee: Alexander Larsson <alexl>
Status: CLOSED WORKSFORME QA Contact:
Severity: medium Docs Contact:
Priority: medium    
Version: 5CC: alex, majashdown, nphilipp, ralston
Target Milestone: ---   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2006-06-26 18:24:57 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On:    
Bug Blocks: 186241    
Attachments:
Description Flags
Magic file from FC-5 that doesn't recognise PDFs
none
Magic file from FC-4 in which evince does recognise PDFs
none
patch against freedesktop.org.xml.in: set priorities for "%" matches properly
none
patch for spec file: apply shared-mime-info-0.17-tex-matlab.patch none

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. ***