file: patch to fix misclassification of some zip files (#402115)

authored by Doron Behar and committed by GitHub 0be1fa1a 9792ce4a

+58
+52
pkgs/tools/misc/file/PR-571-jschleus-Some-zip-files-are-misclassified-as-data.patch
··· 1 + From 60b2032b96fc185b37fb0f2152e834efb2edad6e Mon Sep 17 00:00:00 2001 2 + From: Christos Zoulas <christos@zoulas.com> 3 + Date: Thu, 5 Dec 2024 19:41:12 +0000 4 + Subject: [PATCH] PR/571: jschleus: Some zip files are misclassified as data 5 + 6 + --- 7 + magic/Magdir/archive | 25 +++++++++++++++---------- 8 + 1 file changed, 15 insertions(+), 10 deletions(-) 9 + 10 + diff --git a/magic/Magdir/archive b/magic/Magdir/archive 11 + index e6ff4570a..e560523cb 100644 12 + --- a/magic/Magdir/archive 13 + +++ b/magic/Magdir/archive 14 + @@ -1795,6 +1795,17 @@ 15 + !:ext zip/cbz 16 + 17 + 18 + +# Generic zip archives (Greg Roelofs, c/o zip-bugs@wkuvx1.wku.edu) 19 + +# Next line excludes specialized formats: 20 + +0 name zipgeneric 21 + +>4 beshort x Zip archive data, at least 22 + +!:mime application/zip 23 + +>4 use zipversion 24 + +>4 beshort x to extract 25 + +>8 beshort x \b, compression method= 26 + +>8 use zipcompression 27 + +>0x161 string WINZIP \b, WinZIP self-extracting 28 + + 29 + 0 string PK\003\004 30 + !:strength +1 31 + # IOS/IPadOS IPA file (Zip archive) 32 + @@ -2132,17 +2143,11 @@ 33 + >>>>>>(-6.l) search/9000 kmp.json Keyman Compiled Package File 34 + !:mime application/vnd.keyman.kmp+zip 35 + !:ext kmp 36 + +>>>>>+4 default x 37 + +>>>>>>0 use zipgeneric 38 + 39 + -# Generic zip archives (Greg Roelofs, c/o zip-bugs@wkuvx1.wku.edu) 40 + -# Next line excludes specialized formats: 41 + >>>>+4 default x 42 + ->>>>>4 beshort x Zip archive data, at least 43 + -!:mime application/zip 44 + ->>>>>4 use zipversion 45 + ->>>>>4 beshort x to extract 46 + ->>>>>8 beshort x \b, compression method= 47 + ->>>>>8 use zipcompression 48 + ->>>>>0x161 string WINZIP \b, WinZIP self-extracting 49 + +>>>>>0 use zipgeneric 50 + 51 + # Zip archives (Greg Roelofs, c/o zip-bugs@wkuvx1.wku.edu) 52 + 0 string PK\005\006 Zip archive data (empty)
+6
pkgs/tools/misc/file/default.nix
··· 26 26 hash = "sha256-ycx3x8VgxUMTXtxVWvYJ1WGdvvARmX6YjOQKPXXYYIg="; 27 27 }; 28 28 29 + patches = [ 30 + # https://github.com/file/file/commit/60b2032b96fc185b37fb0f2152e834efb2edad6e 31 + # Fix for misclassification of some zip files 32 + ./PR-571-jschleus-Some-zip-files-are-misclassified-as-data.patch 33 + ]; 34 + 29 35 outputs = [ 30 36 "out" 31 37 "dev"