From owner-cvs-all@FreeBSD.ORG Fri Jan 18 14:29:51 2008 Return-Path: Delivered-To: cvs-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 51B0A16A418; Fri, 18 Jan 2008 14:29:51 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from elvis.mu.org (elvis.mu.org [192.203.228.196]) by mx1.freebsd.org (Postfix) with ESMTP id 20D8313C459; Fri, 18 Jan 2008 14:29:50 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from zion.baldwin.cx (66-23-211-162.clients.speedfactory.net [66.23.211.162]) by elvis.mu.org (Postfix) with ESMTP id 12D4E1A4D7C; Fri, 18 Jan 2008 06:26:21 -0800 (PST) From: John Baldwin To: Tim Kientzle Date: Fri, 18 Jan 2008 08:29:02 -0500 User-Agent: KMail/1.9.7 References: <200801180505.m0I55woO042844@repoman.freebsd.org> In-Reply-To: <200801180505.m0I55woO042844@repoman.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-15" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200801180829.03092.jhb@freebsd.org> Cc: cvs-src@freebsd.org, src-committers@freebsd.org, cvs-all@freebsd.org Subject: Re: cvs commit: src/lib/libarchive archive_write_disk.c src/lib/libarchive/test Makefile test_write_disk_hardlink.c X-BeenThere: cvs-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: CVS commit messages for the entire tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 18 Jan 2008 14:29:51 -0000 On Friday 18 January 2008 12:05:58 am Tim Kientzle wrote: > kientzle 2008-01-18 05:05:58 UTC > > FreeBSD src repository > > Modified files: > lib/libarchive archive_write_disk.c > lib/libarchive/test Makefile > Added files: > lib/libarchive/test test_write_disk_hardlink.c > Log: > Issues with hardlinks in newc-format files prompted me to > write a new test to exercise the hardlink strategies used > by different archive formats (tar, old cpio, new cpio). > This uncovered two problems, both fixed by this commit: > > 1) Enforce file size when writing files to disk. > > 2) When restoring hardlink entries, if they have data associated, go > ahead and open the file so we can write the data. > > In particular, this fixes bsdtar/bsdcpio extraction of new cpio > formats where the "original" is empty and the subsequent "hardlink" > entry actually carries the data. It also provides correct behavior > for old cpio archives where hardlinked entries have their bodies > stored multiple times in the archive; the last body should always be > the one that ends up in the final file. The new pax format also > permits (but does not require) hardlinks to carry file data; again, > the last contents should always win. > > Note that with any of these, a size of zero on a hardlink simply means > that the hardlink carries no data; it does not mean that the file has > zero size. A non-zero size on a hardlink does provide the file size. > > Thanks to: John Baldwin, for reminding me about this long-standing bug > and sending me a simple example archive that prompted this test case Woo, thanks! -- John Baldwin