From owner-p4-projects@FreeBSD.ORG Tue Aug 12 12:05:40 2008 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 58ED9106566C; Tue, 12 Aug 2008 12:05:40 +0000 (UTC) Delivered-To: perforce@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 1D43C106564A for ; Tue, 12 Aug 2008 12:05:40 +0000 (UTC) (envelope-from strauss@FreeBSD.org) Received: from repoman.freebsd.org (repoman.freebsd.org [IPv6:2001:4f8:fff6::29]) by mx1.freebsd.org (Postfix) with ESMTP id 105AE8FC1D for ; Tue, 12 Aug 2008 12:05:40 +0000 (UTC) (envelope-from strauss@FreeBSD.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.14.2/8.14.2) with ESMTP id m7CC5dti005379 for ; Tue, 12 Aug 2008 12:05:39 GMT (envelope-from strauss@FreeBSD.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.14.2/8.14.1/Submit) id m7CC5dCs005377 for perforce@freebsd.org; Tue, 12 Aug 2008 12:05:39 GMT (envelope-from strauss@FreeBSD.org) Date: Tue, 12 Aug 2008 12:05:39 GMT Message-Id: <200808121205.m7CC5dCs005377@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to strauss@FreeBSD.org using -f From: Anselm Strauss To: Perforce Change Reviews Cc: Subject: PERFORCE change 147226 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 12 Aug 2008 12:05:40 -0000 http://perforce.freebsd.org/chv.cgi?CH=147226 Change 147226 by strauss@strauss_marvelman on 2008/08/12 12:05:13 - Fix: Used wrong flag to indicate the use of data descriptors - Fix: Used wrong format for extra time fields Affected files ... .. //depot/projects/soc2008/strauss_libarchive/libarchive/archive_write_set_format_zip.c#30 edit Differences ... ==== //depot/projects/soc2008/strauss_libarchive/libarchive/archive_write_set_format_zip.c#30 (text+ko) ==== @@ -47,7 +47,7 @@ #define ZIP_SIGNATURE_EXTRA_UNIX 0x7855 #define ZIP_VERSION_EXTRACT 0x0014 /* ZIP version 2.0 is needed. */ #define ZIP_VERSION_BY 0x0314 /* Made by UNIX, using ZIP version 2.0. */ -#define ZIP_FLAGS 0x04 /* Flagging bit 3 for using data descriptor. */ +#define ZIP_FLAGS 0x08 /* Flagging bit 3 (count from 0) for using data descriptor. */ static ssize_t archive_write_zip_data(struct archive_write *, const void *buff, size_t s); static int archive_write_zip_finish(struct archive_write *); @@ -99,10 +99,10 @@ struct zip_extra_data { char time_id[2]; char time_size[2]; - struct time_data { - char flag; - char data[4]; - } mtime, atime, ctime; + char time_flag[1]; + char mtime[4]; + char atime[4]; + char ctime[4]; char unix_id[2]; char unix_size[2]; char unix_uid[2]; @@ -234,13 +234,11 @@ /* Formatting extra data. */ zip_encode(sizeof(e), &h.extra_length, sizeof(h.extra_length)); zip_encode(ZIP_SIGNATURE_EXTRA_TIMESTAMP, &e.time_id, sizeof(e.time_id)); - zip_encode(sizeof(e.atime) + sizeof(e.mtime) + sizeof(e.ctime), &e.time_size, sizeof(e.time_size)); - zip_encode(0x01, &e.mtime.flag, sizeof(e.mtime.flag)); - zip_encode(archive_entry_mtime(entry), &e.mtime.data, sizeof(e.mtime.data)); - zip_encode(0x02, &e.atime.flag, sizeof(e.atime.flag)); - zip_encode(archive_entry_atime(entry), &e.atime.data, sizeof(e.atime.data)); - zip_encode(0x04, &e.ctime.flag, sizeof(e.ctime.flag)); - zip_encode(archive_entry_ctime(entry), &e.ctime.data, sizeof(e.ctime.data)); + zip_encode(sizeof(e.atime) + sizeof(e.mtime) + sizeof(e.ctime) + sizeof(e.time_flag), &e.time_size, sizeof(e.time_size)); + zip_encode(0x07, &e.time_flag, sizeof(e.time_flag)); + zip_encode(archive_entry_mtime(entry), &e.mtime, sizeof(e.mtime)); + zip_encode(archive_entry_atime(entry), &e.atime, sizeof(e.atime)); + zip_encode(archive_entry_ctime(entry), &e.ctime, sizeof(e.ctime)); zip_encode(ZIP_SIGNATURE_EXTRA_UNIX, &e.unix_id, sizeof(e.unix_id)); zip_encode(sizeof(e.unix_uid) + sizeof(e.unix_gid), &e.unix_size, sizeof(e.unix_size)); zip_encode(archive_entry_uid(entry), &e.unix_uid, sizeof(e.unix_uid));