Bug#654899: libarchive-zip-perl: jh_manifest from javahelper creates corrupt archives (jars)

Wookey wookey at wookware.org
Fri Jan 6 16:59:35 UTC 2012


Package: libarchive-zip-perl
Version: 1.30-3
Severity: important
Tags: upstream

jh_manifest generates corrupt jars using this code:
        verbose_print("Updating manifest in $jar");
        $zip->removeMember( 'META-INF/MANIFEST.MF' ) unless($new_manifest);
        $mem = $zip->addString($var, 'META-INF/MANIFEST.MF');
        $mem->desiredCompressionMethod(COMPRESSION_DEFLATED);
        # This on the other hand may fail.
        $zip->overwrite() == AZ_OK or error("Writing modified jar ($jar) failed$
	
The member for the directory entry META-INF/ is present and correct in the
original jar, but after the member for the file META-INF/MANIFEST.MF
is added the directory mmeber is corrupt. 3 bytes in the header have
changed:

before jh_manifest is run
0000000  50  4b  03  04  14  00  08  00  08  00  c1  18  26  40  00  00
          P   K 003 004 024  \0  \b  \0  \b  \0 301 030   &   @  \0  \0
0000020  00  00  00  00  00  00  00  00  00  00  09  00  04  00  4d  45
         \0  \0  \0  \0  \0  \0  \0  \0  \0  \0  \t  \0 004  \0   M   E
0000040  54  41  2d  49  4e  46  2f  fe  ca  00  00  03  00  50  4b  07
          T   A   -   I   N   F   / 376 312  \0  \0 003  \0

Bit flags: 0x08
Compression method: 0x08
Compressed size: 0
Uncompressed size: 0

jar after jh_manifest is run:
0000000  50  4b  03  04  14  00  00  00  00  00  c1  18  26  40  00  00
          P   K 003 004 024  \0  \0  \0  \0  \0 301 030   &   @  \0  \0
0000020  00  00  02  00  00  00  00  00  00  00  09  00  04  00  4d  45
         \0  \0 002  \0  \0  \0  \0  \0  \0  \0  \t  \0 004  \0   M   E
0000040  54  41  2d  49  4e  46  2f  fe  ca  00  00  50  4b  03  04  0a
          T   A   -   I   N   F   / 376 312  \0  \0 

Bit flags: 0
Compression method: 0
Compressed size: 2
Uncompressed size: 0

The new compressed size is wrong, and gives this error if unzipped:
$ unzip -t debian/terraintool/usr/share/terraintool/terraintool.jar | head -n 5
Archive:  debian/terraintool/usr/share/terraintool/terraintool.jar
META-INF/:  ucsize 0 <> csize 2 for STORED entry
         continuing with "compressed" size value
    testing: META-INF/                bad CRC 1a6cd7b3  (should be 00000000)
    testing: mccombe/                 OK

This issue looks quite a lot like
http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=600848
which points at https://rt.cpan.org/Public/Bug/Display.html?id=54827

but I added that patch and rebuilt/installed libarchive-zip-perl
locally and it didn't fix the problem. It's possible I did something
wrong, but that patch seems definately installed.

I am now in the process of trying the latest release Archive::ZIP 0.31_3


-- System Information:
Debian Release: 6.0.3
  APT prefers stable
  APT policy: (990, 'stable'), (500, 'oldstable')
Architecture: i386 (i686)

Kernel: Linux 2.6.32.33-kvm-i386-20111128-dirty (SMP w/1 CPU core)
Locale: LANG=en_GB.UTF-8, LC_CTYPE=en_GB.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/bash

Versions of packages libarchive-zip-perl depends on:
ii  libcompress-raw-zlib-p 2.026-1           low-level interface to zlib compre
ii  perl [libcompress-raw- 5.10.1-17squeeze2 Larry Wall's Practical Extraction 

libarchive-zip-perl recommends no packages.

libarchive-zip-perl suggests no packages.

-- no debconf information





More information about the pkg-perl-maintainers mailing list