Bug 193582 - gnome-vfs seems not to use the magic number
gnome-vfs seems not to use the magic number
Status: CLOSED WORKSFORME
Product: Fedora
Classification: Fedora
Component: gnome-vfs2 (Show other bugs)
5
All Linux
medium Severity medium
: ---
: ---
Assigned To: Alexander Larsson
:
: 186241 195471 (view as bug list)
Depends On:
Blocks: 186241
  Show dependency treegraph
 
Reported: 2006-05-30 15:30 EDT by Piergiorgio Sartor
Modified: 2007-11-30 17:11 EST (History)
4 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2006-06-26 14:24:57 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)
Magic file from FC-5 that doesn't recognise PDFs (10.11 KB, application/octet-stream)
2006-06-23 03:27 EDT, 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 03:29 EDT, Alex Lancaster
no flags Details
patch against freedesktop.org.xml.in: set priorities for "%" matches properly (817 bytes, patch)
2006-06-24 18:23 EDT, 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 19:01 EDT, Levin Fritz
no flags Details | Diff


External Trackers
Tracker ID Priority Status Summary Last Updated
FreeDesktop.org 6577 None None None Never

  None (edit)
Description Piergiorgio Sartor 2006-05-30 15:30:34 EDT
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 15:33:29 EDT
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 05:37:27 EDT
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 01:56:17 EDT
In the PDF case, see also bug #188584.
Comment 4 Alex Lancaster 2006-06-23 03:27:53 EDT
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 03:29:23 EDT
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 03:30:10 EDT
(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 03:35:48 EDT
These files are from /usr/share/mime/magic which is generated by the
shared-mime-info package.
Comment 8 Alex Lancaster 2006-06-23 03:41:53 EDT
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 14:28:40 EDT
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 18:23:26 EDT
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 19:01:14 EDT
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 14:24:57 EDT
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 14:57:40 EDT
*** Bug 186241 has been marked as a duplicate of this bug. ***
Comment 14 Kristian Høgsberg 2006-06-29 17:04:49 EDT
*** 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.