reassign 606920 zip
retitle 606920 zip: Sets 'version needed to extract' to 1.0 even if there are 
deflated files
thanks

Jasen Betts wrote...

> If the first file is "stored" file gets the required zip version wrong.

However, file(1) is just the messenger here.

> jasen@gonzo:~$ mkdir x x/a ; cd x
> jasen@gonzo:~/x$ dd count=1 </dev/urandom | od > a/b
> 1+0 records in
> 1+0 records out
> 512 bytes (512 B) copied, 0.000225439 s, 2.3 MB/s
> jasen@gonzo:~/x$ zip -r foo a 
>   adding: a/ (stored 0%)
>   adding: a/b (deflated 55%)
> jasen@gonzo:~/x$ file foo.zip 
> foo.zip: Zip archive data, at least v1.0 to extract
> 
> 
> deflate compression needs atleast version 2.0 to extract
> 
> I think file is currently trying to determine required zip version 
> from the header of the first file record. this often yeilds misleading 
> information.

No, the zip program sets the 'version needed to extract' to 1.0, and
file(1) is just reporting this:

00000000  50 4b 03 04 0a 00 00 00  00 00 6f ab 61 44 00 00 |PK........o.aD..|
                      ^^ this determines file(1)'s output

The directory entries look sane:

00000410     50 4b 01 02 1e 03 0a  00 00 00 00 00 6f ab 61  | PK..........o.a|
                    1.0 needed ^^           ^^^^^ no compression
00000420  44 00 00 00 00 00 00 00  00 00 00 00 00 02 00 18  |D...............|
00000430  00 00 00 00 00 00 00 10  00 ed 41 00 00 00 00 61  |..........A....a|
00000440  2f 55 54 05 00 03 c2 50  12 53 75 78 0b 00 01 04  |/UT....P.Sux....|
00000450  e8 03 00 00 04 e8 03 00  00                       |.........       |
00000450                              50 4b 01 02 1e 03 14  |         PK.....|
                                                        ^^ 2.0 needed
00000460  00 00 00 08 00 6f ab 61  44 4b e8 51 21 98 03 00  |.....o.aDK.Q!...|
                   ^^^^^ deflated
00000470  00 08 08 00 00 03 00 18  00 00 00 00 00 01 00 00  |................|
00000480  00 a4 81 3c 00 00 00 61  2f 62 55 54 05 00 03 c2  |...<...a/bUT....|


So, zip folks: Can you shed some light on this?

What is "version needed to extract" in the "local file header"
supposed to mean exactly? I couldn't find a clarification in
appnote.txt

* Is this the version needed to read the zip directory?

* Or is this the version needed to extract any file, which was the
  maximum "version needed to extract" of all "file header" then.

For my understanding it's the latter. This however means zip possibly
must update the "local file header" accordingly, and currently it does
not.


Severity left at minor since 2.0/deflate was released more than 20
years ago and it's quite unlikely programs without support for that
still linger in the wild.

    Christoph

Attachment: signature.asc
Description: Digital signature

Reply via email to