[Bug 500511] New: file magic fails to recognize some zip-2.0 files
http://bugzilla.novell.com/show_bug.cgi?id=500511 Summary: file magic fails to recognize some zip-2.0 files Classification: openSUSE Product: openSUSE 11.1 Version: Final Platform: Other OS/Version: Other Status: NEW Severity: Normal Priority: P5 - None Component: Basesystem AssignedTo: bnc-team-screening@forge.provo.novell.com ReportedBy: jw@novell.com QAContact: qa@suse.de Found By: --- $ zip mimetest.zip mimetest.png using the attached png file, results in a zip file which is $ file mimetest.zip mimetest.zip: data This is due to an unfortunate subtest in /usr/share/misc/magic (after the PK magic:)
4 byte 0x14
30 ubelong !0x6d696d65 Zip archive data, at least v2.0 to extract !:mime application/zip
which means, that any compressed filename starting with 'mime' is not recognized. This test is probably intended to capture zip files, which need special handling ontop of unzipping, and want to provide an own mimetype for this. Example: http://www.gutenberg.org/cache/epub/4763/pg4763.epub I suggest to patch the above code to read
4 byte 0x14
30 ubelong !0x6d696d65 Zip archive data, at least v2.0 to extract !:mime application/zip 30 ubelong 0x6d696d65 Zip archive data, at least v2.0 to extract !:mime application/zip+extra-mime
-- Configure bugmail: http://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug.
http://bugzilla.novell.com/show_bug.cgi?id=500511 User jw@novell.com added comment http://bugzilla.novell.com/show_bug.cgi?id=500511#c1 --- Comment #1 from Juergen Weigert <jw@novell.com> 2009-05-04 04:22:19 MDT --- Created an attachment (id=289639) --> (http://bugzilla.novell.com/attachment.cgi?id=289639) example png file -- Configure bugmail: http://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug.
http://bugzilla.novell.com/show_bug.cgi?id=500511 User jw@novell.com added comment http://bugzilla.novell.com/show_bug.cgi?id=500511#c2 --- Comment #2 from Juergen Weigert <jw@novell.com> 2009-05-04 04:23:58 MDT --- Created an attachment (id=289640) --> (http://bugzilla.novell.com/attachment.cgi?id=289640) resulting zip file -- which is incorrectly reported by file. -- Configure bugmail: http://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug.
http://bugzilla.novell.com/show_bug.cgi?id=500511 Zheng Chen <zchen@novell.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |zchen@novell.com AssignedTo|bnc-team-screening@forge.pr |werner@novell.com |ovo.novell.com | -- Configure bugmail: http://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug.
http://bugzilla.novell.com/show_bug.cgi?id=500511 User werner@novell.com added comment http://bugzilla.novell.com/show_bug.cgi?id=500511#c3 Dr. Werner Fink <werner@novell.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |NEEDINFO Info Provider| |jw@novell.com Severity|Normal |Minor --- Comment #3 from Dr. Werner Fink <werner@novell.com> 2009-05-06 03:54:56 MDT --- Are you able to reproduce this on factory? As this is with file 5.02 -- Configure bugmail: http://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug.
http://bugzilla.novell.com/show_bug.cgi?id=500511 User jw@novell.com added comment http://bugzilla.novell.com/show_bug.cgi?id=500511#c4 --- Comment #4 from Juergen Weigert <jw@novell.com> 2009-05-06 04:44:59 MDT --- reproducable with file-4.24 from http://download.opensuse.org/factory/repo/oss both *.epub and mimetest.zip report as application/octet-stream I have not seen file 5.02 anywhere. -- Configure bugmail: http://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug.
http://bugzilla.novell.com/show_bug.cgi?id=500511 User werner@novell.com added comment http://bugzilla.novell.com/show_bug.cgi?id=500511#c5 Dr. Werner Fink <werner@novell.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Info Provider|jw@novell.com |adrian@novell.com --- Comment #5 from Dr. Werner Fink <werner@novell.com> 2009-05-06 05:18:16 MDT --- It is submitted to home:WernerFink:Factory. I've no clue why it isn't included in openSUSE:Factory ... Adrian? For testing try out mbuild boole-werner-11 which is currently running. -- Configure bugmail: http://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug.
http://bugzilla.novell.com/show_bug.cgi?id=500511 User adrian@novell.com added comment http://bugzilla.novell.com/show_bug.cgi?id=500511#c6 Adrian Schröter <adrian@novell.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |adrian@novell.com --- Comment #6 from Adrian Schröter <adrian@novell.com> 2009-05-06 05:23:25 MDT --- Do you have created a submit request to openSUSE:Factory ? Which number ? -- Configure bugmail: http://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug.
http://bugzilla.novell.com/show_bug.cgi?id=500511 User werner@novell.com added comment http://bugzilla.novell.com/show_bug.cgi?id=500511#c7 --- Comment #7 from Dr. Werner Fink <werner@novell.com> 2009-05-06 05:46:30 MDT --- Does this mean even the maintainer should do a submit request even if all packages are linked to openSUSE:Factory? -- Configure bugmail: http://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug.
http://bugzilla.novell.com/show_bug.cgi?id=500511 User jw@novell.com added comment http://bugzilla.novell.com/show_bug.cgi?id=500511#c9 --- Comment #9 from Juergen Weigert <jw@novell.com> 2009-05-06 10:37:16 MDT --- file-5.02 from home:WernerFink:Factory has the same issue. My patch in comment#1 should go into /usr/share/misc/magic around line 1758 -- Configure bugmail: http://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug.
http://bugzilla.novell.com/show_bug.cgi?id=500511 User werner@novell.com added comment http://bugzilla.novell.com/show_bug.cgi?id=500511#c10 Dr. Werner Fink <werner@novell.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |RESOLVED Resolution| |FIXED --- Comment #10 from Dr. Werner Fink <werner@novell.com> 2009-05-07 09:46:21 MDT --- This is what I'm use --- magic/Magdir/archive +++ magic/Magdir/archive 2009-05-07 17:43:15.549950181 +0200 @@ -575,6 +575,10 @@
4 byte 0x14
30 ubelong !0x6d696d65 Zip archive data, at least v2.0 to !:mime application/zip +>>30 ubelong 0x6d696d65 Zip archive data, at least v2.0 to +>>>34 ubelong 0x74797065 \b, mime type +>>>>38 regex application/[a-z\+\-]+ \b %s +!:mime application/unknown+zip
# OpenOffice.org / KOffice / StarOffice documents # Listed here because they ARE zip files file-5.02-zip2.0.dif lines 1-13/13 (END) -- Configure bugmail: http://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug.
http://bugzilla.novell.com/show_bug.cgi?id=500511 User jw@novell.com added comment http://bugzilla.novell.com/show_bug.cgi?id=500511#c11 --- Comment #11 from Juergen Weigert <jw@novell.com> 2009-05-07 10:35:42 MDT --- Example results using the above patch: $ file ~jw/mimetest.zip /suse/jw/mimetest.zip: Zip archive data, at least v2.0 to $ file -i ~jw/mimetest.zip /suse/jw/mimetest.zip: application/octet-stream; charset=binary $ file ~jw/pg4763.epub /suse/jw/pg4763.epub: Zip archive data, at least v2.0 to, mime type application/epub+zip $ file -i ~jw/pg4763.epub /suse/jw/pg4763.epub: application/unknown+zip; charset=binary (tested with both file-5.02 and file-4.24, identical output) I am a bit worried by the inconsistency between -i and non-i output. Is this to be expected? I'd prefer if file -i ~jw/mimetest.zip would mention 'zip'. -- Configure bugmail: http://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug.
http://bugzilla.novell.com/show_bug.cgi?id=500511 User werner@novell.com added comment http://bugzilla.novell.com/show_bug.cgi?id=500511#c12 --- Comment #12 from Dr. Werner Fink <werner@novell.com> 2009-05-08 04:18:55 MDT --- Yes this is expected because the mime type of ~jw/pg4763.epub is defined within the zip its self: werner/file> unzip -l ~jw/pg4763.epub | sed 's/^/ /' Archive: /suse/jw/pg4763.epub Length Date Time Name -------- ---- ---- ---- 20 04-06-09 23:22 mimetype 270 04-06-09 23:22 META-INF/container.xml 132503 04-06-09 23:22 4763/0.html 5598 04-06-09 23:22 4763/toc.ncx 1403 04-06-09 23:22 4763/content.opf -------- ------- 139794 5 files werner/file> echo `unzip -p ~jw/pg4763.epub mimetype` application/epub+zip remember that 0x6d696d65 is the word `mime' and 0x74797065 is the word `type'. You see that in the first file `mimetype' you'l find the type its self ... now the `!mime' escape in the magic file can not know the type ... its simply unkown -- Configure bugmail: http://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug.
http://bugzilla.novell.com/show_bug.cgi?id=500511 User jw@novell.com added comment http://bugzilla.novell.com/show_bug.cgi?id=500511#c13 --- Comment #13 from Juergen Weigert <jw@novell.com> 2009-05-11 11:34:29 MDT --- I disagree. The fact that is zip is always known. -- Configure bugmail: http://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug.
http://bugzilla.novell.com/show_bug.cgi?id=500511 User werner@novell.com added comment http://bugzilla.novell.com/show_bug.cgi?id=500511#c14 --- Comment #14 from Dr. Werner Fink <werner@novell.com> 2009-05-12 02:33:17 MDT --- Then write a patch to extend file to use the information found the lines above to be included in the with `!' escaped mime information. This patch you should send upstream. -- Configure bugmail: http://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug.
participants (1)
-
bugzilla_noreply@novell.com