Bug 180 - [PATCH] excel files are sniffed as word files
Summary: [PATCH] excel files are sniffed as word files
Status: RESOLVED FIXED
Alias: None
Product: shared-mime-info
Classification: Unclassified
Component: general (show other bugs)
Version: unspecified
Hardware: x86 (IA32) Linux (All)
: high normal
Assignee: Jonathan Blandford
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2004-02-11 09:12 UTC by Christophe Fergeau
Modified: 2004-03-03 04:50 UTC (History)
1 user (show)

See Also:
i915 platform:
i915 features:


Attachments
remove the problematic magic string (847 bytes, patch)
2004-02-11 09:16 UTC, Christophe Fergeau
Details | Splinter Review

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.