From owner-p4-projects@FreeBSD.ORG Wed Aug 13 15:39:00 2008 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 422041065670; Wed, 13 Aug 2008 15:39:00 +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 05ECE106564A for ; Wed, 13 Aug 2008 15:39:00 +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 001E58FC1B for ; Wed, 13 Aug 2008 15:38:59 +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 m7DFcxKT058367 for ; Wed, 13 Aug 2008 15:38:59 GMT (envelope-from strauss@FreeBSD.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.14.2/8.14.1/Submit) id m7DFcxxd058365 for perforce@freebsd.org; Wed, 13 Aug 2008 15:38:59 GMT (envelope-from strauss@FreeBSD.org) Date: Wed, 13 Aug 2008 15:38:59 GMT Message-Id: <200808131538.m7DFcxxd058365@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 147305 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: Wed, 13 Aug 2008 15:39:00 -0000 http://perforce.freebsd.org/chv.cgi?CH=147305 Change 147305 by strauss@strauss_marvelman on 2008/08/13 15:38:30 Added storing of permissions in external file attributes. Affected files ... .. //depot/projects/soc2008/strauss_libarchive/libarchive/archive_write_set_format_zip.c#33 edit Differences ... ==== //depot/projects/soc2008/strauss_libarchive/libarchive/archive_write_set_format_zip.c#33 (text+ko) ==== @@ -340,22 +340,20 @@ struct zip_central_directory_end end; int64_t size; off_t offset_start, offset_end; - const char *path; int entries; int ret; + mode_t mode; zip = a->format_data; l = zip->central_directory; /* * Formatting central directory file header fields that are fixed for all entries. - * Fields not used are: + * Fields not used (and therefor 0) are: * - * - flags - * - extra_length * - comment_length * - disk_number - * - attributes_internal, attributes_external + * - attributes_internal */ memset(&h, 0, sizeof(h)); zip_encode(ZIP_SIGNATURE_FILE_HEADER, &h.signature, sizeof(h.signature)); @@ -369,14 +367,16 @@ /* Formatting individual header fields per entry. */ size = archive_entry_size(l->entry); - path = archive_entry_pathname(l->entry); zip_encode(dos_time(archive_entry_mtime(l->entry)), &h.timedate, sizeof(h.timedate)); zip_encode(l->crc32, &h.crc32, sizeof(h.crc32)); zip_encode(size, &h.compressed_size, sizeof(h.compressed_size)); zip_encode(size, &h.uncompressed_size, sizeof(h.uncompressed_size)); zip_encode(path_length(l->entry), &h.filename_length, sizeof(h.filename_length)); + archive_entry_mode(l->entry); h.extra_length[0] = l->extra_length[0]; h.extra_length[1] = l->extra_length[1]; + mode = archive_entry_mode(l->entry); + zip_encode(mode, &h.attributes_external[2], sizeof(mode)); zip_encode(l->offset, &h.offset, sizeof(h.offset)); ret = (a->compressor.write)(a, &h, sizeof(h));