unzip rejects Microsoft OneDrive zip files
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
unzip (Ubuntu) |
Fix Released
|
Undecided
|
Marc Deslauriers | ||
Focal |
Fix Released
|
Undecided
|
Marc Deslauriers | ||
Jammy |
Fix Released
|
Undecided
|
Marc Deslauriers | ||
Mantic |
Fix Released
|
Undecided
|
Marc Deslauriers | ||
Noble |
Fix Released
|
Undecided
|
Marc Deslauriers |
Bug Description
[Impact]
unzip rejects Microsoft OneDrive zip files. See the detailed explanation here:
tl;dr;
Microsoft mishandles the "Total number of disks" field when using the ZIP64 extension. It should start at 1, they use 0, which isn't a valid value. Unzip doesn't properly handle the invalid value.
[Test Plan]
- Download the test zip file from comment #1.
- unzip should extract it without issue (it contains a test.txt text file)
- if unzip fails, it will spew out a weird error message like the following:
$ unzip test.zip
Archive: test.zip
error [test.zip]: missing 4294967098 bytes in zipfile
(attempting to process anyway)
error [test.zip]: start of central directory not found;
zipfile corrupt.
(please check that you have transferred or created the zipfile in the
appropriate BINARY mode and that you have compiled UnZip properly)
[Where problems could occur]
This simple patch just accepts 0 as a valid total number of disks. I suppose if it was wrong it would mishandle multi-disk archives, though multi-disk archives should have a good value in that field.
Changed in unzip (Ubuntu Focal): | |
assignee: | nobody → Marc Deslauriers (mdeslaur) |
Changed in unzip (Ubuntu Jammy): | |
assignee: | nobody → Marc Deslauriers (mdeslaur) |
Changed in unzip (Ubuntu Mantic): | |
assignee: | nobody → Marc Deslauriers (mdeslaur) |
Changed in unzip (Ubuntu Noble): | |
assignee: | nobody → Marc Deslauriers (mdeslaur) |
Here is a small test zip file that has 0 in the total number of disks field