Bug 10049 - missing magic for application/x-cd-image
Summary: missing magic for application/x-cd-image
Alias: None
Product: shared-mime-info
Classification: Unclassified
Component: freedesktop.org.xml (show other bugs)
Version: unspecified
Hardware: Other All
: medium normal
Assignee: Jonathan Blandford
QA Contact:
Depends on:
Reported: 2007-02-21 03:26 UTC by Pino Toscano
Modified: 2008-02-21 09:38 UTC (History)
1 user (show)

See Also:
i915 platform:
i915 features:

proposed magic (745 bytes, patch)
2007-02-21 03:28 UTC, Pino Toscano
Details | Splinter Review

Description Pino Toscano 2007-02-21 03:26:38 UTC
The application/x-cd-image mimetype has only a glob patter matching, and misses a magic.
Comment 1 Pino Toscano 2007-02-21 03:28:10 UTC
Created attachment 8797 [details] [review]
proposed magic

Simple proposal of a magic for application/x-cd-image, taken from /usr/share/file/magic.
Comment 2 Christian - Manny Calavera - Neumair 2007-03-08 06:57:54 UTC
Thanks for your bug report and your efforts!

I'm not totally sure about one of your two glob offset, though. I'm referring to the ISO 9660 spec [1] here:

* We have the system area which is 16 logical sectors large (16*2048 bytes=32768 bytes)
* We then have an obscure entry of "(None) optional" which I don't understand. How large is this entry supposed to be?
* After the optional entry, we have the primary volume descriptor, which will have
 * * two bytes for its type
 * * followed by its ID which is supposed to be "CD001", i.e. which we want to match

Assuming that the optional entry is not present, your matchlet with an offset of
seems to be correct (offset counting starts from 0, so the two-byte type field in the beginning of the volume descriptor is properly reflected).

I don't understand why you added another matchlet with offset 32633, though.
Thanks for your work up to this point, though! :)

[1] http://users.pandora.be/it3.consultants.bvba/handouts/ISO9960.html
Comment 3 Pino Toscano 2007-03-22 16:22:14 UTC
Basically, magic(1) has this:

# CDROM Filesystems
32769    string    CD001     ISO 9660 CD-ROM filesystem data
# "application id" which appears to be used as a volume label
>32808   string    >\0       '%s'
>34816   string    \000CD001\001EL\ TORITO\ SPECIFICATION    (bootable)
37633    string    CD001     ISO 9660 CD-ROM filesystem data (raw 2352 byte sectors)

that's why ;)
Comment 4 Bastien Nocera 2007-08-31 11:00:36 UTC
This was rejected in the past. We can't go this far in a file to check its mime-type.

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.