svn commit: trunk/busybox/archival

vda at busybox.net vda at busybox.net
Sat Jul 26 16:50:24 UTC 2008


Author: vda
Date: 2008-07-26 09:50:24 -0700 (Sat, 26 Jul 2008)
New Revision: 22953

Log:
unzip: give better error message when presented with unsupported
 zip file. Add zip documentation and an example of file we cant
 (yet) unpack.



Added:
   trunk/busybox/archival/unzip_cant_handle.odt
   trunk/busybox/archival/unzip_doc.txt.bz2

Modified:
   trunk/busybox/archival/unzip.c


Changeset:
Modified: trunk/busybox/archival/unzip.c
===================================================================
--- trunk/busybox/archival/unzip.c	2008-07-26 14:20:04 UTC (rev 22952)
+++ trunk/busybox/archival/unzip.c	2008-07-26 16:50:24 UTC (rev 22953)
@@ -99,6 +99,12 @@
 
 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;

Added: trunk/busybox/archival/unzip_cant_handle.odt
===================================================================
(Binary files differ)


Property changes on: trunk/busybox/archival/unzip_cant_handle.odt
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/busybox/archival/unzip_doc.txt.bz2
===================================================================
(Binary files differ)


Property changes on: trunk/busybox/archival/unzip_doc.txt.bz2
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream




More information about the busybox-cvs mailing list