git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: Johannes Schauer <josch@debian.org>
To: git@vger.kernel.org
Subject: Re: bug: git-archive does not use the zip64 extension for archives with more than 16k entries
Date: Thu, 13 Aug 2015 04:25:45 +0200	[thread overview]
Message-ID: <20150813022545.30116.44787@localhost> (raw)
In-Reply-To: <55CBA140.7050301@web.de>

[-- Attachment #1: Type: text/plain, Size: 2435 bytes --]

Hi,

Quoting René Scharfe (2015-08-12 21:40:48)
> Am 11.08.2015 um 12:40 schrieb Johannes Schauer:
> > for repositories with more than 16k files and folders, git-archive will create
> > zip files which store the wrong number of entries. That is, it stores the
> > number of entries modulo 16k. This will break unpackers that do not include
> > code to support this brokenness.
> 
> The limit is rather 65535 entries, isn't it?  The entries field has two 
> bytes, and they are used fully.

seems to be 65535 indeed.

I just forwarded the number Dieter Baron (libzip contributor) told me when they
replied (off list) to my bug report against libzip:
http://nih.at/listarchive/libzip-discuss/msg00554.html

But reading https://en.wikipedia.org/wiki/Zip_(file_format)#ZIP64 the limit
indeed seems to be 65535.

> Which programs are affected? InfoZIP Zip 3.0 and 7-Zip 9.20 seem to handle an
> archive with more entries just fine.  The built-in functionality of Windows
> 10 doesn't.

In my case I discovered this because libzip http://nih.at/libzip does not
implement reading an archive with more than 65535 entries without zip64.

> Besides, 64K entries should be enough for anybody. ;-)

:P

> Seriously, though: What kind of repository has that many files and uses the
> ZIP format to distribute snapshots?  Just curious.

I have not searched for any.

In my case I was using git to keep track of the modifications our tools do to a
directory of files to detect regressions. These tools are also able to read
data from zip archives instead from a directory. I created the zip archive
using git-archive because the files already were in git so that seemed most
convenient to me. That's when I discovered the problem because our tools use
libzip. The easy workaround was to use another packager instead of git-archive.
We use the zip format because Windows has support for it.

> > Instead, git-archive should use the zip64 extension to handle more than 16k
> > files and folders correctly.
> 
> That seems to be what InfoZIP does and Windows 10 handles it just fine. If
> lower Windows versions and other popular extractors can unzip such archives
> as well then this might indeed be the way to go.

The wikipedia page above claims that windows versions starting with vista have
support for zip64. It also lists some other software with support for it.

Thanks!

cheers, josch

[-- Attachment #2: signature --]
[-- Type: application/pgp-signature, Size: 819 bytes --]

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2

iQIcBAABCAAGBQJVzAApAAoJEPLLpcePvYPhLUEP/i3r+wbhhHBrapMjLLeIupJy
4I7fItTXxzSWyX8g8MH1RLdd/ckKJ0zsMQZTMtSbKwjEatE56ChvEvm2PIadX8Qg
DDn51mTFABDpPaItl8IxSmMVDzHePnkzTnFRbZzFC/jaCgm2Rb4AGCr9GTTvvlNi
37XQ/YyE2af2WiGtn2TLGO8ZamHaxoov4n9DYBEcgi9yUVg3CUvL5+Reb7spf0sI
PEOMkeuLmaBKDQsb4N4IPz6c0vTGgvfe9rmD4dtUKuB0R/7S2Tz366IM1zuypW3y
Q3hg53Pq2OaXtB5ukYYQ3mi5/jEyUIciF8mklbXfTx+vaaPoFXUwEgjJde+49WOl
lHfIpqk1w2WqYyzgwgf328of7lUeEh3ABhFdpAdNPOYf2amSUAy+xl614cu4Y/ld
wcoKn28H2pspfiux/SPljVbo9xhQbkd2Po8p0J2lLVhwXqjJv5MLBITPUSH0sZRL
MuI+1wNpOiQaIZsaxyiSmNUpMVdmeb2ZHUw38jkKCcpvYhtfE3ItCDs8R28s6bP8
yUEWXVrZk1hKmID1plLkCPAc5sHSZJdA7n66xv8ZdTyWHbykto45FPY6Kt0Lc6/q
B+riiP6rEuX6TeUnOvHc3lQ49lwGXfBrRFJbYvY/XQs99izD/Xp9o0SnJ3p9InC4
xPYEMc1IsRSxfssr0wNa
=6mn4
-----END PGP SIGNATURE-----

  reply	other threads:[~2015-08-13  2:25 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-08-11 10:40 bug: git-archive does not use the zip64 extension for archives with more than 16k entries Johannes Schauer
2015-08-12 19:40 ` René Scharfe
2015-08-13  2:25   ` Johannes Schauer [this message]
2015-08-22 19:06     ` [PATCH 1/3] t5004: test ZIP archives with many entries René Scharfe
2015-08-23  5:54       ` Eric Sunshine
2015-08-23  9:29         ` "René Scharfe"
2015-08-23  9:35           ` Eric Sunshine mail delivery failure René Scharfe
2015-08-23 17:16             ` Johannes Löthberg
2015-08-23 18:24               ` Eric Sunshine
     [not found]                 ` <CA+EOSBmk2cdQe3owaXgkYAgTZqpUFa=J8g5FYq28-=VhDcJ4EA@mail.gmail.com>
2015-08-23 18:48                   ` Eric Sunshine
2015-08-23 18:57                     ` Eric Sunshine
2015-08-23 17:45           ` [PATCH 1/3] t5004: test ZIP archives with many entries Eric Sunshine
2015-08-28 15:45             ` Junio C Hamano
2015-08-28 15:57               ` Junio C Hamano
2015-08-28 16:47                 ` Eric Sunshine
2015-08-22 19:06     ` [PATCH 2/3] archive-zip: use a local variable to store the creator version René Scharfe
2015-08-22 19:06     ` [PATCH 3/3] archive-zip: support more than 65535 entries René Scharfe
2015-08-15  8:40   ` bug: git-archive does not use the zip64 extension for archives with more than 16k entries Duy Nguyen

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: http://vger.kernel.org/majordomo-info.html

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20150813022545.30116.44787@localhost \
    --to=josch@debian.org \
    --cc=git@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://80x24.org/mirrors/git.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).