[BusyBox] Very important solution: Autoconfig Networking after
boot does not work in busybox-1.00-rc1 and Solution for unzip
Paul Fox
pgf at brightstareng.com
Thu Aug 4 09:20:56 MDT 2005
> I'll search for the zip-archive that makes trouble here on the
> Arm7 (not tested on Intel machines) and send you detailed info
> about the results and versions of unzip.
as i wrote yesterday, i suspect that the archive was created with
an incompatible zip program. do an "unzip -l" on the archive,
and you'll probably see that it shows the length of the first
entry as "0". the following patch will emit a warning in that
case, but it won't fix your problem. you'll need to recreate the
zip archive with a compatible zip program.
paul
Index: archival/unzip.c
===================================================================
--- archival/unzip.c (revision 11014)
+++ archival/unzip.c (working copy)
@@ -139,6 +139,12 @@
}
}
+static void warn_bad_archive(char *f)
+{
+ bb_error_msg("Warning: suspicious zero length entry for %s.\n"
+ "busybox unzip may not be able to read this archive.", f);
+}
+
extern int unzip_main(int argc, char **argv)
{
zip_header_t zip_header;
@@ -262,6 +268,11 @@
if (magic == ZIP_CDS_MAGIC) {
break;
} else if (magic != ZIP_FILEHEADER_MAGIC) {
+ /* check the previous header. it may not have
+ * contained length information
+ */
+ if (dst_fn && zip_header.formated.ucmpsize == 0)
+ warn_bad_archive(dst_fn);
bb_error_msg_and_die("Invalid zip magic %08X", magic);
}
@@ -381,6 +392,10 @@
if (verbosity == v_normal) {
printf(" inflating: %s\n", dst_fn);
}
+ if (zip_header.formated.cmpsize == 0 &&
+ zip_header.formated.method != 0) {
+ warn_bad_archive(dst_fn);
+ }
unzip_extract(&zip_header, src_fd, dst_fd);
if (dst_fd != STDOUT_FILENO) {
/* closing STDOUT is potentially bad for future business */
=---------------------
paul fox, pgf at brightstareng.com
More information about the busybox
mailing list