Commit graph

50 commits

Author SHA1 Message Date
Mikael Pettersson
3fc54cf68c feat: Detect insufficient Dir record size
- Per zip spec 4.4.1.4 (https://pkware.cachefly.net/webdocs/casestudies/APPNOTE.TXT)
- If a CentralDirectoryEnd record field cannot hold the
  required data, a ZIP64 record must exist and the
  field will be set to -1(0xFFFF || 0xFFFFFFFF)
- Previously these archives were incorrectly detected as multi-disk
2023-01-30 11:13:01 +01:00
Wyatt Herkamp
1c5cd4ffda Fixed new Clippy Warnings 2022-10-13 07:51:02 -04:00
Alexander Zaitsev
77294fd3ce
Revert "Merge pull request #290 from aweinstock314/more-spec-structs"
This reverts commit a1da6860ea, reversing
changes made to 574bb3df17.
2022-03-26 14:13:50 +03:00
Avi Weinstock
fc1007a5a4 Add round-trip serialization tests for zip::spec types. 2022-03-25 14:34:01 -04:00
Avi Weinstock
993cbcdc5c Add zip::spec::{CentralDirectoryHeader, DataDescriptor, LocalFileHeader}, and partially integrate them into zip::{read, write}. 2022-03-25 14:10:10 -04:00
Rouven Spreckels
00c1199dbe Use ZIP64_BYTES_THR and ZIP64_ENTRY_THR. 2022-03-25 16:01:56 +01:00
Rouven Spreckels
d53c8bdf07 Merge branch 'master' into support-extra-field 2020-11-16 11:57:08 +01:00
Rouven Spreckels
9397773a32 Add ZIP64 write support. 2020-10-03 11:05:23 +02:00
Davide Romanini
b91f48a224 fix fmt 2020-08-13 15:53:38 +02:00
Davide Romanini
5c4f0906f8 allow for garbage after comment data 2020-08-13 13:02:53 +02:00
Marli Frost
9ed6904383
refactor: replace the podio crate with byteorder 2020-06-16 18:59:13 +01:00
Ryan Levick
31b4b5c842 Address clippy issues 2020-06-15 11:11:17 +02:00
Ryan Levick
ebb07348ee Run cargo fmt 2020-06-15 10:44:39 +02:00
Lachezar Lechev
99dba6b397
run cargo fix --edition 2019-11-11 08:58:59 +02:00
Benedikt Rascher-Friesenhausen
804cfea51c Replace try! macros with ? operator calls
The `?` operator exists since Rust version 1.13.0 and has since become the
standard and recommended variant over the `try!` macro (see
https://doc.rust-lang.org/std/macro.try.html where it is explicitly mentioned to
use the `?` operator instead of the `try!` macro).

I think it is especially useful to replace the `try!` usages throughout the
examples (since new users might not be familiar with the `try!` macro at all).
2018-10-02 23:12:35 +02:00
Robin Syihab
c99d7c2758
Handle invalid zip header 2017-12-04 01:19:44 +07:00
Peter Williams
4a297c32a8 Implement support for reading ZIP64 central-directory-end records
This provides only very basic ZIP64 support, but it allows us to properly read
archives with more than 65535 files, so long as none of the individual files
need ZIP64 support to be read.
2017-08-12 14:42:32 -04:00
Peter Williams
89f33c9348 Use u64's for internal file offsets.
These are better aligned with Rust's APIs, and lay the groundwork for more
convenient support of Zip64 files.
2017-08-12 14:42:32 -04:00
Mathijs van de Nes
240e1d469d Corrected some static -> const 2017-04-28 10:31:12 +02:00
Stephen M. Coakley
fc746a09db
Handle data prepended to the zip 2017-04-08 03:04:18 -05:00
Mathijs van de Nes
c97d6ed760 Use read_exact from ReadPodExt explicitly
The newely added read_exact from std::..::Read has an incompatible signature
and is not yet stabilized. This ensures that the crate will work on stable and
nightly.
2015-09-02 11:52:30 +02:00
Mathijs van de Nes
726f8133f5 Do not use step_by 2015-04-03 14:56:00 +02:00
Mathijs van de Nes
c185c0cd38 Replace usage of range{,_step}_inclusive 2015-03-31 09:54:09 +02:00
Mathijs van de Nes
132530cb41 Remove some as_slice calls 2015-03-16 10:15:46 +01:00
Mathijs van de Nes
aa4e395ec9 Use external crate for extra read/write methods 2015-03-09 11:55:19 +01:00
Mathijs van de Nes
d9b83af57c Large refactoring, mostly of the reader
- Combined reader and reader_spec into read
- Alter the iteration protocol for a zip archive
- Modify some names
2015-03-01 11:32:40 +01:00
Mathijs van de Nes
bb89f577c5 Convert reader to new IO 2015-02-24 16:02:16 +01:00
Mathijs van de Nes
69b38b3ce5 Update Write for spec 2015-02-24 14:37:46 +01:00
Mathijs van de Nes
fc20f9a20c write -> write_all 2015-01-29 11:01:57 +01:00
Mathijs van de Nes
078ba7eda0 io -> old_io 2015-01-29 11:00:30 +01:00
Mathijs van de Nes
70532d7b48 Fixed int/uint, and use as much stable as possible 2015-01-10 15:52:05 +01:00
Mathijs van de Nes
ccdba3efc0 Namespaced enums fix 2014-11-19 18:43:07 +01:00
Mathijs van de Nes
2163db4b25 Added ZipResult/ZipError 2014-11-08 21:55:15 +01:00
Mathijs van de Nes
91cbe91d62 Split spec in reader/writer/general 2014-09-17 15:01:22 +02:00
Mathijs van de Nes
0cd915f185 Split compression from types and pub use ZipFile 2014-09-15 21:33:58 +02:00
Mathijs van de Nes
8921d3b5c2 Added support for extra field and utf-8 filenames 2014-09-14 21:55:02 +02:00
Mathijs van de Nes
723e8b0b12 Initial file name/comment encoding support 2014-09-14 17:25:40 +02:00
Mathijs van de Nes
453c6a8ce1 Set made-by to a value with an upper byte of 0
With the old value, unzip would set all permissions to 000
2014-09-11 14:06:22 +02:00
Mathijs van de Nes
ac9301f7d9 Implemented a basic ZipWriter 2014-09-11 10:42:18 +02:00
Mathijs van de Nes
02361b5dd5 Correctly interpret the first field of the footer 2014-09-11 09:32:47 +02:00
Mathijs van de Nes
08dbe1c3fc Starting implementation of a Writer 2014-09-10 22:34:30 +02:00
Mathijs van de Nes
7df03b54f9 Removed some unneeded structs and simplified parse 2014-09-10 17:27:24 +02:00
Mathijs van de Nes
916dc6c6e5 Remove Data Descriptor 2014-09-10 16:34:40 +02:00
Mathijs van de Nes
33efdcc539 More elegant way of enforcing single reads 2014-09-10 15:35:01 +02:00
Mathijs van de Nes
bb4f56346a Fixed borrowing issue in extract 2014-09-10 09:53:32 +02:00
Mathijs van de Nes
b6a0de8b3c Simple ZIPs can be extracted! 2014-09-09 15:56:15 +02:00
Mathijs van de Nes
3668fa5e33 Implemented a simple filename reader 2014-09-09 13:00:18 +02:00
Mathijs van de Nes
181993afd1 Made finding of central directory possible 2014-09-09 08:08:33 +00:00
Mathijs van de Nes
1cbc1e9e6a Lots of additions 2014-09-08 20:14:22 +00:00
Mathijs van de Nes
70c82e411f Initial work on parsing Zip file header 2014-09-07 15:15:30 +00:00