[File] Regression in zip-archive detection

Torsten Landschoff torsten at debian.org
Thu Sep 2 21:37:18 UTC 2021


Am 2021-09-02 23:24, schrieb Torsten Landschoff:

> PPS: I bisected this using a simple C program. Looks like this commit
> introduced this bug:
> 
> commit c21152a62f9a62cdb67e462e66fb35d06435fa84 (HEAD, refs/bisect/bad)
> Author: Christos Zoulas <christos at zoulas.com>
> Date:   Sun Jun 7 17:27:10 2020 +0000
> 
>     Handle EPUB documents that have no mimetype


FWIW, reverting that commit and resolving conflicts gave me this diff:

diff --git a/magic/Magdir/archive b/magic/Magdir/archive
index d4fd3c92..f7f5d207 100644
--- a/magic/Magdir/archive
+++ b/magic/Magdir/archive
@@ -1417,15 +1417,11 @@
  >>>>38         search/64       .app/   iOS App
  !:mime application/x-ios-app

-# Dup, see above.
-#>30   search/100/b application/epub+zip       EPUB document
-#!:mime application/epub+zip

  # Generic zip archives (Greg Roelofs, c/o zip-bugs at wkuvx1.wku.edu)
  #   Next line excludes specialized formats:
  >(26.s+30)     leshort !0xcafe
->>30   search/100/b !application/epub+zip
->>>26    string          !\x8\0\0\0mimetype    Zip archive data
+>>26    string          !\x8\0\0\0mimetype     Zip archive data
  !:mime application/zip
  >>>>4  beshort         x                       \b, at least


With that change zip files are again reported correctly.

I have to admit that I don't understand what this search/100/b command 
actually does.


Greetings, Torsten



More information about the File mailing list