From owner-freebsd-current@FreeBSD.ORG Wed Oct 22 00:30:02 2008 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id CB6001065673 for ; Wed, 22 Oct 2008 00:30:02 +0000 (UTC) (envelope-from unixmania@gmail.com) Received: from mu-out-0910.google.com (mu-out-0910.google.com [209.85.134.191]) by mx1.freebsd.org (Postfix) with ESMTP id 55FEC8FC29 for ; Wed, 22 Oct 2008 00:30:01 +0000 (UTC) (envelope-from unixmania@gmail.com) Received: by mu-out-0910.google.com with SMTP id i2so2447730mue.3 for ; Tue, 21 Oct 2008 17:30:00 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from:to :subject:cc:in-reply-to:mime-version:content-type :content-transfer-encoding:content-disposition:references; bh=PNGSJFZjDCeglEhMcV5sZK1Yqp99Ktb03f7sAEQVF8I=; b=untvBDIt5cp50n5uP6crU3T0AYt0Fwp8bAwBQ4/nVQOXNozqXdBR0qk17JoJjI20BZ NnbX3+nxj96I4YQWo0vYqHiGbOk5TFSOqYNYTQTEk3AU6+Zc1XnpfoPlK+jp0sNdPfRZ 53G64F87I/4//2hBTs46POpB/8JFHdACzos2k= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:to:subject:cc:in-reply-to:mime-version :content-type:content-transfer-encoding:content-disposition :references; b=KHFQDBONvx9RMcxPFq41/ofDE1B6E5PFb7aDx/TYbPRH/9P5S7Nh1RfHv0eC12opGL HvQjEkYPyLvM0ohtlyUVSMOdWqLpiaq9G61gKHuME7hq/jkMVllVmKnGNDi8joo7p92O HH6X9nbwNiA2w+vB/rJ1WL9gi+WPzFvTX9LJY= Received: by 10.103.119.19 with SMTP id w19mr4778483mum.129.1224635400465; Tue, 21 Oct 2008 17:30:00 -0700 (PDT) Received: by 10.103.231.14 with HTTP; Tue, 21 Oct 2008 17:30:00 -0700 (PDT) Message-ID: Date: Tue, 21 Oct 2008 22:30:00 -0200 From: "Carlos A. M. dos Santos" To: "Tim Kientzle" In-Reply-To: <48FD5738.60401@freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline References: <48FD5738.60401@freebsd.org> Cc: freebsd-current@freebsd.org Subject: Re: Problem extracting Zip file X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 22 Oct 2008 00:30:02 -0000 On Tue, Oct 21, 2008 at 2:14 AM, Tim Kientzle wrote: > Carlos A. M. dos Santos wrote: >> >> % fetch >> http://movies.apple.com/movies/us/apple/mac/macbook/2008/designvideo/apple_new_macbook_video_20081014_848x480.zip >> % unzip -l apple_new_macbook_video_20081014_848x480.zip >> Archive: apple_new_macbook_video_20081014_848x480.zip >> Length Date Time Name >> -------- ---- ---- ---- >> 153902587 10-14-08 11:46 apple_new_macbook_video_20081014_848x480.mov >> 0 10-14-08 11:48 __MACOSX/ >> 82 10-14-08 11:46 >> __MACOSX/._apple_new_macbook_video_20081014_848x480.mov >> >> Observe that the archive contains two instances of the .mov file but >> the second one, according to unzip, is only 82 bytes long. > > The second file here is actually the Mac OS "resource fork." > >> % tar xf apple_new_macbook_video_20081014_848x480.zip >> apple_new_macbook_video_20081014_848x480.mov: Attempt to write to an empty >> file >> __MACOSX/._apple_new_macbook_video_20081014_848x480.mov: Attempt to >> write to an empty file >> tar: Error exit delayed from previous errors. > > Ouch. I know what this is. I recently taught libarchive > to distinguish "file has zero size" from "the file size is > unknown" in a lot of cases, but apparently I missed this one. > The "unknown size" stored in the Zip header here is getting > incorrectly treated as a zero size. > > Please try the attached patch which fixes the Zip reader > in libarchive to leave the file size "unknown" in > this case. Let me know if it fixes the issue for you. > > Cheers, > > Tim > I tested with your recent commit to libarchive (r184109) and it works. Thanks. -- cd /usr/ports/sysutils/life make clean