<html><head><meta http-equiv="Content-Type" content="text/html; charset=utf-8"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; line-break: after-white-space;" class="">I will disable it too because I've already needed to work around it because of:<div class=""><a href="https://github.com/file/file/pull/72" class="">https://github.com/file/file/pull/72</a></div><div class=""><br class=""></div><div class="">Best,</div><div class=""><br class=""></div><div class="">christos<br class=""><div><br class=""><blockquote type="cite" class=""><div class="">On Jul 6, 2019, at 8:19 AM, Christoph Biedl <<a href="mailto:astron.com.bwoj@manchmal.in-ulm.de" class="">astron.com.bwoj@manchmal.in-ulm.de</a>> wrote:</div><br class="Apple-interchange-newline"><div class=""><div class="">Jörg Jenderek wrote...<br class=""><br class=""><blockquote type="cite" class="">Some examples like ROYALK30.GFT have null values for mask fields.<br class="">This is expressed bv line<br class=""> 62<span class="Apple-tab-span" style="white-space:pre">     </span>ulelong<span class="Apple-tab-span" style="white-space:pre">     </span><span class="Apple-tab-span" style="white-space:pre">    </span>0<br class="">Unfortunately this is not unique enough, but this is not a problem<br class="">because identifying and showing parts are separated.<br class=""></blockquote><br class="">Even with your additional rules, below, this is *way* to broad.<br class=""><br class="">My personal rule to avoid mis-detections in libmagic is: A magic pattern<br class="">must probe at least 33 Bits of identifying information before printing<br class="">anything which is the point of no return by design. Comparisons to one<br class="">or more bytes of value zero are not taken into account, since that is<br class="">too common.<br class=""><br class="">So the very traditional 32 bits identifying magic are not enough, for a<br class="">reason.<br class=""><br class="">If my calculations are correct, this particular rule set allows, thus<br class="">provides identifying bits:<br class=""><br class="">    0 Bits from above<br class=""><br class=""><blockquote type="cite" class="">So i add addition<br class="">al<br class="">test lines for such examples. So skip ISO 9660 CD-ROM images with many<br class="">nulls by looking for low positive font size by line.<br class=""><blockquote type="cite" class="">2<span class="Apple-tab-span" style="white-space:pre">  </span>uleshort<span class="Apple-tab-span" style="white-space:pre">    </span>>2<br class=""></blockquote></blockquote><br class="">65533 of 2^16 values<br class="">    0.00 Bits<br class=""><br class=""><blockquote type="cite" class="">Highest size for fonts was 48. So check also for upper limit by line<br class=""><blockquote type="cite" class=""><blockquote type="cite" class="">2<span class="Apple-tab-span" style="white-space:pre">     </span>uleshort<span class="Apple-tab-span" style="white-space:pre">    </span><49<br class=""></blockquote></blockquote></blockquote><br class="">49 of 2^8 values<br class="">    2.3 Bits<br class=""><br class=""><blockquote type="cite" class="">So skip misidentified DOS 2.0 backup id file like BACKUPID.@@@.<br class="">At this stage some files like MS Windows icons like "download.ico" are<br class="">still misidentified. So i also test for valid font name by additional<br class="">line<br class=""><blockquote type="cite" class=""><blockquote type="cite" class=""><blockquote type="cite" class="">4<span class="Apple-tab-span" style="white-space:pre">        </span>ubeshort<span class="Apple-tab-span" style="white-space:pre">    </span>>0x1F00<br class=""></blockquote></blockquote></blockquote></blockquote><br class="">57600 of 2^16<br class="">    0.19 Bits<br class=""><br class="">Sum: ~2.5 Bits<br class=""><br class="">As a result, I get a lot of mis-detections. Please refine that ruleset.<br class=""><br class="">For the time being I'll disable it in Debian to limit the damage.<br class=""><br class="">    Christoph<br class="">-- <br class="">File mailing list<br class=""><a href="mailto:File@astron.com" class="">File@astron.com</a><br class="">https://mailman.astron.com/mailman/listinfo/file<br class=""></div></div></blockquote></div><br class=""></div></body></html>