Re: [PATCH v3 4/5] archive-zip: support archives bigger than 4GB

2017-04-28 Thread Peter Krefting
René Scharfe: Sure, but if we were to start emitting zip64 records regardless of the size of entries then we'd break compatibility. We should have a very good reason for doing that. (I don't see the need so far.) Sure, sounds good. The type of descriptor to use depends on the presence of 6

Re: [PATCH v3 4/5] archive-zip: support archives bigger than 4GB

2017-04-27 Thread René Scharfe
Am 27.04.2017 um 06:57 schrieb Peter Krefting: > René Scharfe: >> Windows XP. Don't laugh. ;) > > You can always install 7-zip or something to extract on XP. Sure, but if we were to start emitting zip64 records regardless of the size of entries then we'd break compatibility. We should have a ver

Re: [PATCH v3 4/5] archive-zip: support archives bigger than 4GB

2017-04-26 Thread Peter Krefting
René Scharfe: Sizes can be stored in zip64 entries even if they are lower (from a paragraph about the data descriptor): "4.3.9.2 When compressing files, compressed and uncompressed sizes should be stored in ZIP64 format (as 8 byte values) when a file's size exceeds 0x. Howe

Re: [PATCH v3 4/5] archive-zip: support archives bigger than 4GB

2017-04-26 Thread René Scharfe
Am 26.04.2017 um 23:02 schrieb Peter Krefting: René Scharfe: I struggled with that sentence as well. There is no explicit "format" field AFAICS. Exactly. I interpret that as it is in zip64 format if there are any zip64 structures in the archive (especially if there is a zip64 end of centra

Re: [PATCH v3 4/5] archive-zip: support archives bigger than 4GB

2017-04-26 Thread Peter Krefting
René Scharfe: I struggled with that sentence as well. There is no explicit "format" field AFAICS. Exactly. I interpret that as it is in zip64 format if there are any zip64 structures in the archive (especially if there is a zip64 end of central directory locator). Or in other words: A leg

Re: [PATCH v3 4/5] archive-zip: support archives bigger than 4GB

2017-04-25 Thread René Scharfe
Am 25.04.2017 um 09:55 schrieb Peter Krefting: René Scharfe: This needs to be >=. The spec says that if the value is 0x, there should be a zip64 record with the actual size (even if it is 0x). Could you please cite the relevant part? 4.4.8 compressed size: (4 bytes) 4.4.9 un

Re: [PATCH v3 4/5] archive-zip: support archives bigger than 4GB

2017-04-25 Thread Peter Krefting
René Scharfe: This needs to be >=. The spec says that if the value is 0x, there should be a zip64 record with the actual size (even if it is 0x). Could you please cite the relevant part? 4.4.8 compressed size: (4 bytes) 4.4.9 uncompressed size: (4 bytes) "If an archive is in

Re: [PATCH v3 4/5] archive-zip: support archives bigger than 4GB

2017-04-24 Thread René Scharfe
Am 24.04.2017 um 23:02 schrieb Johannes Sixt: Am 24.04.2017 um 22:06 schrieb René Scharfe: Am 24.04.2017 um 20:24 schrieb Peter Krefting: René Scharfe: @@ -433,6 +446,11 @@ static int write_zip_entry(struct archiver_args *args, free(deflated); free(buffer); +if (offset > 0xff

Re: [PATCH v3 4/5] archive-zip: support archives bigger than 4GB

2017-04-24 Thread Johannes Sixt
Am 24.04.2017 um 22:06 schrieb René Scharfe: Am 24.04.2017 um 20:24 schrieb Peter Krefting: René Scharfe: @@ -433,6 +446,11 @@ static int write_zip_entry(struct archiver_args *args, free(deflated); free(buffer); +if (offset > 0x) { +zip64_dir_extra_payload_size +=

Re: [PATCH v3 4/5] archive-zip: support archives bigger than 4GB

2017-04-24 Thread René Scharfe
Am 24.04.2017 um 22:06 schrieb René Scharfe: Am 24.04.2017 um 20:24 schrieb Peter Krefting: René Scharfe: Also set the version required to 45 (4.5) for any record that has zip64 fields. Ah, yes indeed. When I tried to implement this I realized that should set 20 for directories, but we use

Re: [PATCH v3 4/5] archive-zip: support archives bigger than 4GB

2017-04-24 Thread René Scharfe
Am 24.04.2017 um 20:24 schrieb Peter Krefting: René Scharfe: @@ -433,6 +446,11 @@ static int write_zip_entry(struct archiver_args *args, free(deflated); free(buffer); +if (offset > 0x) { +zip64_dir_extra_payload_size += 8; +zip_dir_extra_size += 2 + 2 + zip

Re: [PATCH v3 4/5] archive-zip: support archives bigger than 4GB

2017-04-24 Thread Peter Krefting
René Scharfe: @@ -433,6 +446,11 @@ static int write_zip_entry(struct archiver_args *args, free(deflated); free(buffer); + if (offset > 0x) { + zip64_dir_extra_payload_size += 8; + zip_dir_extra_size += 2 + 2 + zip64_dir_extra_payload_siz

[PATCH v3 4/5] archive-zip: support archives bigger than 4GB

2017-04-24 Thread René Scharfe
Add a zip64 extended information extra field to the central directory and emit the zip64 end of central directory records as well as locator if the offset of an entry within the archive exceeds 4GB. Signed-off-by: Rene Scharfe --- archive-zip.c | 32