diff options
author | Lennart Poettering <lennart@poettering.net> | 2023-11-16 17:05:57 +0100 |
---|---|---|
committer | Lennart Poettering <lennart@poettering.net> | 2023-11-20 11:15:04 +0100 |
commit | e61a0dde83fab11b063814d69b393d06f556d024 (patch) | |
tree | 347ca3e062fee75afd03b749efab6bbd3161fc5c /data | |
parent | c918fe77e255150938e83a6aec259f153d303573 (diff) |
mime-detection: detect GPT disk images by contents, not just suffix
Diffstat (limited to 'data')
-rw-r--r-- | data/freedesktop.org.xml.in | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/data/freedesktop.org.xml.in b/data/freedesktop.org.xml.in index 1f8eabb..1a37e9d 100644 --- a/data/freedesktop.org.xml.in +++ b/data/freedesktop.org.xml.in @@ -1755,6 +1755,13 @@ command to generate the output files. <alias type="application/x-raw-disk-image"/> <glob pattern="*.raw-disk-image"/> <glob pattern="*.img"/> + <!-- The magic GPT partition table header is at sector 1, which might a different byte offsets, depending on the sector size. Let's cover the 4 most relevant sectors sizes --> + <magic> + <match type="string" value="EFI PART" offset="512"/> + <match type="string" value="EFI PART" offset="1024"/> + <match type="string" value="EFI PART" offset="2048"/> + <match type="string" value="EFI PART" offset="4096"/> + </magic> </mime-type> <mime-type type="application/x-raw-floppy-disk-image"> <comment>Floppy disk image</comment> |