diff options
author | Denis Vlasenko <vda.linux@googlemail.com> | 2008-07-26 16:50:24 +0000 |
---|---|---|
committer | Denis Vlasenko <vda.linux@googlemail.com> | 2008-07-26 16:50:24 +0000 |
commit | c2dcb7cf63993a80208db653d1f9d39eab5a4567 (patch) | |
tree | 9e47d805c0f04b251ab500549b672a6afeb880c8 | |
parent | 8dbea7dbb1b18135a02a0a2c8f7ab9fdb27a59a7 (diff) | |
download | busybox-w32-c2dcb7cf63993a80208db653d1f9d39eab5a4567.tar.gz busybox-w32-c2dcb7cf63993a80208db653d1f9d39eab5a4567.tar.bz2 busybox-w32-c2dcb7cf63993a80208db653d1f9d39eab5a4567.zip |
unzip: give better error message when presented with unsupported
zip file. Add zip documentation and an example of file we cant
(yet) unpack.
-rw-r--r-- | archival/unzip.c | 6 | ||||
-rw-r--r-- | archival/unzip_cant_handle.odt | bin | 0 -> 6948 bytes | |||
-rw-r--r-- | archival/unzip_doc.txt.bz2 | bin | 0 -> 11359 bytes |
3 files changed, 6 insertions, 0 deletions
diff --git a/archival/unzip.c b/archival/unzip.c index 7c92f5d9a..36490cb41 100644 --- a/archival/unzip.c +++ b/archival/unzip.c | |||
@@ -99,6 +99,12 @@ static void unzip_create_leading_dirs(const char *fn) | |||
99 | 99 | ||
100 | static void unzip_extract(zip_header_t *zip_header, int src_fd, int dst_fd) | 100 | static void unzip_extract(zip_header_t *zip_header, int src_fd, int dst_fd) |
101 | { | 101 | { |
102 | if (zip_header->formatted.flags & (0x0008|0x0001)) { | ||
103 | /* 0x0001 - encrypted */ | ||
104 | /* 0x0008 - streaming. [u]cmpsize can be reliably gotten | ||
105 | * only from Central Directory. See unzip_doc.txt */ | ||
106 | bb_error_msg_and_die("zip flags 8 and 1 are not supported"); | ||
107 | } | ||
102 | if (zip_header->formatted.method == 0) { | 108 | if (zip_header->formatted.method == 0) { |
103 | /* Method 0 - stored (not compressed) */ | 109 | /* Method 0 - stored (not compressed) */ |
104 | off_t size = zip_header->formatted.ucmpsize; | 110 | off_t size = zip_header->formatted.ucmpsize; |
diff --git a/archival/unzip_cant_handle.odt b/archival/unzip_cant_handle.odt new file mode 100644 index 000000000..715e4a991 --- /dev/null +++ b/archival/unzip_cant_handle.odt | |||
Binary files differ | |||
diff --git a/archival/unzip_doc.txt.bz2 b/archival/unzip_doc.txt.bz2 new file mode 100644 index 000000000..ab77d10da --- /dev/null +++ b/archival/unzip_doc.txt.bz2 | |||
Binary files differ | |||