fix(archive): open zips with a missing or truncated central directory
A BEE-SP v14.23 blackbox (Dell PowerEdge R760) streamed from the live CD was
cut off inside the central directory: all 1920 members intact, no
end-of-central-directory record, so archive/zip rejected the whole file
("zip: not a valid zip file"). ADL-079:
- when archive/zip cannot open a .zip, read it front to back by local file
headers; intact archives are unaffected
- streamed members (data descriptors) are delimited from the data itself,
deflate and stored; every member is CRC32/size checked
- recovery stops at the first damaged, truncated or encrypted member and
keeps the entries before it; the original error is returned when nothing
could be read
- same 10 MB per-file / 1 GB total limits as the regular zip path
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
b4b15e58a2
commit
1cc2faa567
5 files changed
+521
No files matched your search
@@ -20,6 +20,10 @@ extension: `.tar`/`.sds`, `.tar.gz`/`.tgz`/`.gz`, `.zip`, `.rar`, `.ahs`, and pl
|
||||
volume, including solid archives. Password-protected archives, multi-volume sets, self-extracting
|
||||
archives and the legacy RAR 4.x format are rejected with an explicit error.
|
||||
|
||||
A `.zip` that `archive/zip` rejects (central directory missing or cut off, e.g. a streamed
|
||||
blackbox whose download was interrupted in the trailer) is read front to back by its local file
|
||||
headers (ADL-079); members are CRC-checked and recovery stops at the first damaged one.
|
||||
|
||||
`VendorParser` contract:
|
||||
|
||||
```go
|
||||
|
||||
Reference in new issue
Block a user