[Bug 262278] file(1) fails to identify a JAR file

From: <bugzilla-noreply_at_freebsd.org>
Date: Tue, 17 May 2022 12:34:47 UTC
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=262278

--- Comment #4 from Michael Osipov <michael.osipov@siemens.com> ---
In contrast:
$ hexdump -C classes/org/apache/maven/SessionScoped.class
00000000  ca fe ba be 00 00 00 34  00 12 07 00 0f 07 00 10  |.......4........|
00000010  07 00 11 01 00 0a 53 6f  75 72 63 65 46 69 6c 65  |......SourceFile|
00000020  01 00 12 53 65 73 73 69  6f 6e 53 63 6f 70 65 64  |...SessionScoped|

Valid JAR:
$ hexdump -C maven-core-4.0.0-alpha-1-SNAPSHOT.jar | head
00000000  50 4b 03 04 0a 00 00 08  00 00 89 41 85 52 00 00  |PK.........A.R..|
00000010  00 00 00 00 00 00 00 00  00 00 09 00 00 00 4d 45  |..............ME|
00000020  54 41 2d 49 4e 46 2f 50  4b 03 04 14 00 00 08 08  |TA-INF/PK.......|
00000030  00 89 41 85 52 9c ea 73  82 b1 00 00 00 4e 01 00  |..A.R..s.....N..|
00000040  00 14 00 00 00 4d 45 54  41 2d 49 4e 46 2f 4d 41  |.....META-INF/MA|
00000050  4e 49 46 45 53 54 2e 4d  46 8d 8f d1 0a 82 30 18  |NIFEST.MF.....0.|
00000060  85 ef 05 df 61 2f b0 a1  d6 45 78 a7 41 94 60 49  |....a/...Ex.A.`I|

I don't know whether I understand the C code from the old Java 7 launcher
correctly, but it is searching for 0xcafe to make it a valid JAR file.

Note: I am Maven PMC member and done a lot on the reproducibility topic.

-- 
You are receiving this mail because:
You are the assignee for the bug.