Re: [PATCH v3 4/5] archive-zip: support archives bigger than 4GB
- From
Peter Krefting <peter@softwolves.pp.se>
- Date
- Apr 24, 2017, 18:24 UTC
- Message-ID
- <alpine.DEB.2.11.1704241912510.30460@perkele.intern.softwolves.pp.se>
- In-Reply-To
- <02ddca3c-a11f-7c0c-947e-5ca87a62cdee@web.de>
René Scharfe:
Show 12 quoted lines
> @@ -433,6 +446,11 @@ static int write_zip_entry(struct archiver_args *args,
> free(deflated);
> free(buffer);
>
> + if (offset > 0xffffffff) {
> + zip64_dir_extra_payload_size += 8;
> + zip_dir_extra_size += 2 + 2 + zip64_dir_extra_payload_size;
> + }
> +
> strbuf_add_le(&zip_dir, 4, 0x02014b50); /* magic */
> strbuf_add_le(&zip_dir, 2, creator_version);
> strbuf_add_le(&zip_dir, 2, 10); /* version */This needs to be >=. The spec says that if the value is 0xffffffff, there should be a zip64 record with the actual size (even if it is 0xffffffff).
Also set the version required to 45 (4.5) for any record that has zip64 fields.
-- \\// Peter - http://www.softwolves.pp.se/