Refactor stat cache handling into a function. Consistenly use
lstat(2) as no symlink sohuld ever be referenced at this point.
After unlink(2)/rmdir(2) operations ensure that the stat cache
is reset.
Fix the extraction of archives where hardlinks and the main file
disagree on permissions. This can be observed with base.tgz of
an unprivileged NetBSD build.
After the change permissions are restored only for files that
have content attached. This works for almost ustar. For pax
archives with optional data in the second entry and cpio this
will fail for unprivileged user if the first entry doesn't allow
writing for the current user.
Tim Kientzle [Thu, 8 May 2008 20:48:01 +0000 (16:48 -0400)]
Just skip entries where --strip-components removes everything.
Previously, this was failing for dir entries that had exactly
the right number of components, e.g. "a/" with --strip-components=1,
leading to odd warnings about "Invalid empty pathname"
PR: bin/121158
Tim Kientzle [Thu, 8 May 2008 20:28:36 +0000 (16:28 -0400)]
If there are leftover inclusions (command-line patterns) after
extraction, warn about them:
$ bsdtar xfv tar.tgz foo bar
-rw-r--r-- 0 tim tim 0 May 8 19:50 foo
bsdtar: bar: Not found in archive
bsdtar: Error exit delayed from previous errors.
Tim Kientzle [Wed, 7 May 2008 08:54:46 +0000 (04:54 -0400)]
More Windows cleanup: Add a copyright notice (as discussed with
the author, Kees Zeelenberg) to archive_windows.c, include a comment
explaining the history and intent for this file. Remove a couple
of unnecessary functions.
Tim Kientzle [Tue, 6 May 2008 22:55:46 +0000 (18:55 -0400)]
Add some additional examples and clarification about using
mtree descriptions to generate tar archives using
tar -cf output.tar @input.mtree
Obtained from: Vincent Zweije
Tim Kientzle [Sat, 3 May 2008 16:21:41 +0000 (12:21 -0400)]
archive_read_extract2() provides much of the convenience of
archive_read_extract() while allowing you to configure the
archive_write_disk restore object.
Tim Kientzle [Sat, 3 May 2008 15:11:31 +0000 (11:11 -0400)]
Clean up some memory-management issues in the link resolver.
Now, the 'canonical' entry is the one actually used for matching
and lookups, the 'entry' is used for transient needs, and
the bookkeeping now correctly tracks when the 'entry' is no
longer valid because it was handed back to the client.
Tim Kientzle [Fri, 2 May 2008 23:19:43 +0000 (19:19 -0400)]
Eliminate archive.h.in; instead of editing a new version into
the Makefile and having the Makefile edit it into archive.h,
just edit it directly into archive.h in the first place.
This means that archive.h is no longer a constructed file,
which simplifies quite a number of things.
Tim Kientzle [Thu, 1 May 2008 22:37:23 +0000 (18:37 -0400)]
Documentation updates:
Document -o option (old format) for -c, -r, -u modes,
correct --format to indicate that it can be used with -r and -u
Correct option checks to not suppress --format with -r or -u
PR: bin/122600