Bug 180

Summary: [PATCH] excel files are sniffed as word files
Product: shared-mime-info Reporter: Christophe Fergeau <teuf>
Component: generalAssignee: Jonathan Blandford <jrb>
Status: RESOLVED FIXED QA Contact:
Severity: normal    
Priority: high CC: jody
Version: unspecified   
Hardware: x86 (IA32)   
OS: Linux (All)   
Whiteboard:
i915 platform: i915 features:
Attachments: remove the problematic magic string

Description Christophe Fergeau 2004-02-11 09:12:43 UTC
I have some excel files (saved using gnumeric and oocalc) which are incorrectly
sniffed as application/msword files. The coming patch removes the magic string
responsible for that. I don't know enough about ms file formats to know whether
this magic pattern should be removed or replaced with something more accurate
Comment 1 Christophe Fergeau 2004-02-11 09:16:47 UTC
Created attachment 89 [details] [review]
remove the problematic magic string
Comment 2 Jonathan Blandford 2004-02-11 10:35:29 UTC
Jody, can you comment?
Comment 3 Jody Goldberg 2004-02-11 20:45:16 UTC
The signature in question has two problems
1) It is incomplete.  There should be a trailing \032 \341
2) It corresponds to an OLE2 file and hence will match
- excel
- powerpoint
- quattro pro
and lots of others.

recognizing OLE2 files gets hard. you need to know more about the file format
that magic is going to give you to look up the name of the streams it contains.
frankly I'd like to see some special structured file match operations that would
allow a specification where magic is merely 1 subtree.  It could recognize
things like OLE2.  Then we could have a distinct subtree for
<ole2>
<match stream="{Book,BOOK,book,Workbook,WORKBOOK,workbook">xls</match>

or something like it

There are several related instances of this
- tar
- xml
- zip
i
Comment 4 Alexander Larsson 2004-03-03 02:48:06 UTC
What if we make the sniffed mimetype something like application/x-ole2-stream
(and fix up the signature), and then we handle that manually by prefering
extension for it. Like we do with gz and zip.

Seems like this is a pretty important mimetype to get right.
Comment 5 Alexander Larsson 2004-03-03 23:50:29 UTC
cvs has application/x-ole-storage

Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.