From: Henrik S. <hst...@us...> - 2016-11-01 11:12:44
|
This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "CDemu - a free, GPL CD/DVD-ROM device emulator for linux". The branch, master has been updated via a5a17102980aa413e010bf691eb5611f21fc1a27 (commit) from 74dc0347942a1aeceec7e5887e6a3a4712ea99ed (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- commit a5a17102980aa413e010bf691eb5611f21fc1a27 Author: Henrik Stokseth <hst...@us...> Date: Tue Nov 1 10:06:06 2016 +0100 libmirage: Try to prevent false positives for mime types. The shared mime info spec IMO have multiple issues. - There is no way to match magic bytes at a certain offset relative to the end of a file. - Which match takes precedence is determined by setting a simple priority value that defaults to 50, and which scale is largely arbitrary. It would be easy to improve the latter by taking into account the strength of the match, adjusting for the probability of matching random data. The probability (P) for a false positive when matching N bits can be given as P = 1 / (2^N) which means you have with three bytes a one in 1.6 million chance of a false positive, matching two or four bytes are much weaker or stronger by far. Which priority value should be used for matching magic strings should as it stands assume that a typical filename suffix match (with a default priority of 50) matches against at least 3 bytes that ideally should be unique, and use a higher priority if the magic string is larger than that and vice versa. And that of course ignores that some suffixes like ".img" can mean pretty much anything and such a match is pretty much equal to strength zero. ----------------------------------------------------------------------- Summary of changes: libmirage/images/image-b6t/libmirage-b6t.xml | 2 +- libmirage/images/image-c2d/libmirage-c2d.xml | 2 +- libmirage/images/image-ccd/libmirage-ccd.xml | 2 +- libmirage/images/image-cif/libmirage-cif.xml | 2 +- .../images/image-harddisk/libmirage-apple.xml | 5 ++++- libmirage/images/image-mds/libmirage-mds.xml | 2 +- libmirage/images/image-mds/libmirage-xmd.xml | 2 +- libmirage/images/image-mdx/libmirage-mdx.xml | 2 +- .../images/image-xcdroast/libmirage-xcdroast.xml | 2 +- 9 files changed, 12 insertions(+), 9 deletions(-) hooks/post-receive -- CDemu - a free, GPL CD/DVD-ROM device emulator for linux |