Brian Harring [Mon, 26 Apr 2010 01:44:24 +0000 (21:44 -0400)]
fix archive_filter_count to actually work; implementation of this aparently was never finished, vtable stubs never had any implementation for this functionality, thus an instant segfault on invocatoin
Only include the FreeBSD-style extended attribute support, if
EXTATTR_NAMESPACE_USER is defined. It is missing on FreeBSD 4 and
DragonFly. Reported by Antonio Huete Jimenez as NetBSD's pkg/43175.
Brian Harring [Mon, 19 Apr 2010 05:24:01 +0000 (01:24 -0400)]
this could stand review, but should be right; setting ret to ARCHIVE_FAILED here is a pointless no op so archive_format_gnutar_header assignment shortly after wipes the ret... potentially this should be set to a warn and then combined w/ the other returns
Tim Kientzle [Sun, 18 Apr 2010 05:56:53 +0000 (01:56 -0400)]
Basic implementation of a GNU tar-compatible writer. This uses
the header conventions used by GNU tar 1.13 and later. In particular:
* name and linkname are permitted to fill their respective fields
(Earlier GNU tar guaranteed a trailing null)
* mode field does not include the file type
(Earlier GNU tar included file type bits in the mode field)
* Most fields are filled with leading '0' characters
(Earlier GNU tar used leading spaces)
Tim Kientzle [Sun, 11 Apr 2010 21:29:32 +0000 (17:29 -0400)]
Fix tar --keep-newer
This solution isn't ideal; bsdtar does the right thing now
(doesn't overwrite and exits without error) but it should
display a warning message about the failure to extract
the file.
Tim Kientzle [Sun, 11 Apr 2010 19:11:36 +0000 (15:11 -0400)]
Issue 83: Directory timestamps truncated to microsecond resolution.
This patch reworks the time-restore logic to use the same
system calls in both the end-of-archive cleanup pass and
the regular file restore case. This ensures consistent
timestamp restores for both cases. It also isolates the
BSD birthtime support into one place so it will be consistently
applied.
Tim Kientzle [Sun, 11 Apr 2010 18:08:36 +0000 (14:08 -0400)]
Improve the testing of tar -X and try to correctly handle some odd cases.
Here are some of the cases currently handled
(assuming test.tar contains a single entry "file1"):
$ tar xf test.tar file1
Extracts file1 with no error.
$ tar xf test.tar file1 file2
Extracts file1, error because file2 was requested but not found.
$ tar xf test.tar file1 'file2*'
Extracts file1, error because 'file2*' pattern matched no entries.
Tim Kientzle [Sun, 11 Apr 2010 00:10:58 +0000 (20:10 -0400)]
Adjust this test slightly so it doesn't depend on a
particular order of traversing the directory.
In particular, this test almost passes against
GNU tar 1.23. The difference being that GNU tar
considers it an error when a hardlink cannot
be extracted because the target was erased by
--strip-components and bsdtar does not consider
this an error. Both extract the same files;
the only difference is that GNU tar emits
some error messages and exits with an error
status, while bsdtar exits with success.
Tim Kientzle [Sat, 10 Apr 2010 21:27:38 +0000 (17:27 -0400)]
Test -C
* Add a "testworkdir" global for tests that need an absolute path to their work directory
* Exercise -C failure and corner cases such as -C nonexistent -C /absolute
Tim Kientzle [Sat, 10 Apr 2010 21:02:55 +0000 (17:02 -0400)]
Test cleanup:
* Use assertMakeFile() instead of fopen/fwrite/fclose
* Remove -s tests from test_option_T_upper; they just duplicate tests in test_option_s
Brian Harring [Sun, 4 Apr 2010 05:43:17 +0000 (01:43 -0400)]
fwrite is marked w/ check return, thus doing make check results in build failures due to -Werror forced in trunk. assert the fwrite return to fix the issue, and more importantly the extremely unlikely scenario where the write doesn't manage to flush the desired size (if this isn't caught, it'll result in weird failures further in the tests)
Tim Kientzle [Mon, 22 Mar 2010 05:11:11 +0000 (01:11 -0400)]
Speed up builds by just linking libarchive_test with the static
libarchive, instead of recompiling libarchive source. The old
approach did allow us to use different flags for compiling libarchive
sources into libarchive_test, but speeding up the build is probably a
worthwhile trade-off.
Tim Kientzle [Sun, 21 Mar 2010 16:12:16 +0000 (12:12 -0400)]
Switch users of archive_read_skip() over to archive_read_consume() now
that they both do the same thing. Remove archive_read_consume().
Rename the core "advance_file_pointer" function to make it a little
more clear that it's internal to archive_read.c.
Clean up a few comments.
Tim Kientzle [Sun, 21 Mar 2010 16:00:28 +0000 (12:00 -0400)]
Finish merging the archive_read_consume and archive_read_skip implementations.
These have always been just two different ways to advance the file
pointer; merging them is a simplification.
The only point remaining is to actually remove one of them and
change the users.
Tim Kientzle [Sun, 21 Mar 2010 06:30:08 +0000 (02:30 -0400)]
Make read_filter_skip be independent of read_filter_consume. In particular,
read_skip now does everything that read_consume does, so we're ready to
merge read_skip and read_consume.
Tim Kientzle [Sun, 21 Mar 2010 04:20:06 +0000 (00:20 -0400)]
archive_read_skip_lenient() (which just returns the number of bytes actually
skipped) was only used one place as a building block for a "skip rest of file"
operation. So push the "skip rest of file" into archive_read.c as
__archive_read_skip_all(), remove skip_lenient entirely, and modify
the raw_read_data_skip to use the new function.
Tim Kientzle [Sun, 21 Mar 2010 00:35:41 +0000 (20:35 -0400)]
Rework some of the Unicode handling to avoid alignment problems.
A lot of processors have strict alignment and GCC on such
processors complains loudly when you cast a char * to an int16_t *.
Tim Kientzle [Sat, 13 Mar 2010 06:40:02 +0000 (01:40 -0500)]
Issue 76: Correct segfault when Zip bidder sees a file that is less than 128k
and starts with "MZ". The "MZ" signature identifies executable files that
could be self-extracting Zip files; the Zip bidder incorrectly handled
end-of-file when searching ahead for the Zip contents.
Tim Kientzle [Fri, 12 Mar 2010 05:58:35 +0000 (00:58 -0500)]
Provide format names that allow explicit setting of "restricted pax"
format. In particular, as pointed out in Issue 74, this allows you
to use bsdcpio to write restricted pax format.
Tim Kientzle [Fri, 12 Mar 2010 05:54:52 +0000 (00:54 -0500)]
On systems that can't read symlink ACLs, don't read any ACL.
As reported in Issue 75, this fixes a problem on Fedora 12 with ACLs
being incorrectly reported on symlinks.
Merge r1940:
Improve detection of SHA2 functions in OpenSSL to deal with ancient
versions like in Mac OS X and FreeBSD 6.x. Fixes #65 and should fix #55.
Tim Kientzle [Sat, 6 Mar 2010 22:22:40 +0000 (17:22 -0500)]
Put the libarchive source directory at the beginning of the include
dirs; this ensures that archive.h and archive_entry.h get picked up
from there instead of from an installed system version.