git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: bug: git-archive does not use the zip64 extension for archives with more than 16k entries

From
JSJohannes Schauer <josch@debian.org>
Date
Aug 13, 2015, 02:25 UTC
Message-ID
<20150813022545.30116.44787@localhost>
In-Reply-To
<55CBA140.7050301@web.de>
Hi,
Quoting René Scharfe (2015-08-12 21:40:48)
Show 8 quoted lines
> 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.

Show 6 quoted lines
> > 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
Previous: René ScharfeNext: René Scharfe
Message 3 of 18 in “bug: git-archive does not use the zip64 extension for archives with more than 16k entries”
  1. Johannes SchauerAug 11, 2015
  2. René ScharfeAug 12, 2015
  3. Johannes SchauerAug 13, 2015
  4. 1/3 t5004: test ZIP archives with many entriesRené Scharfe, Aug 22, 2015
  5. Eric SunshineAug 23, 2015
  6. René ScharfeAug 23, 2015
  7. Eric Sunshine mail delivery failureRené Scharfe, Aug 23, 2015
  8. Johannes LöthbergAug 23, 2015
  9. Eric SunshineAug 23, 2015
  10. Eric SunshineAug 23, 2015
  11. Junio C HamanoAug 28, 2015
  12. Junio C HamanoAug 28, 2015
  13. Eric SunshineAug 28, 2015
  14. 2/3 archive-zip: use a local variable to store the creator versionRené Scharfe, Aug 22, 2015
  15. 3/3 archive-zip: support more than 65535 entriesRené Scharfe, Aug 22, 2015
  16. Duy NguyenAug 15, 2015
  17. Eric SunshineAug 23, 2015
  18. Eric SunshineAug 23, 2015

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.