mirror of
https://git.busybox.net/busybox.git
synced 2024-11-27 15:43:26 +08:00
unzip: give better error message when presented with unsupported
zip file. Add zip documentation and an example of file we cant (yet) unpack.
This commit is contained in:
parent
8dbea7dbb1
commit
c2dcb7cf63
@ -99,6 +99,12 @@ static void unzip_create_leading_dirs(const char *fn)
|
||||
|
||||
static void unzip_extract(zip_header_t *zip_header, int src_fd, int dst_fd)
|
||||
{
|
||||
if (zip_header->formatted.flags & (0x0008|0x0001)) {
|
||||
/* 0x0001 - encrypted */
|
||||
/* 0x0008 - streaming. [u]cmpsize can be reliably gotten
|
||||
* only from Central Directory. See unzip_doc.txt */
|
||||
bb_error_msg_and_die("zip flags 8 and 1 are not supported");
|
||||
}
|
||||
if (zip_header->formatted.method == 0) {
|
||||
/* Method 0 - stored (not compressed) */
|
||||
off_t size = zip_header->formatted.ucmpsize;
|
||||
|
BIN
archival/unzip_cant_handle.odt
Normal file
BIN
archival/unzip_cant_handle.odt
Normal file
Binary file not shown.
BIN
archival/unzip_doc.txt.bz2
Normal file
BIN
archival/unzip_doc.txt.bz2
Normal file
Binary file not shown.
Loading…
Reference in New Issue
Block a user