Tim Kientzle [Mon, 21 Nov 2011 00:12:15 +0000 (19:12 -0500)]
There are now two different Zip
readers. archive_read_support_format_zip() enables both of them:
* The "streamable" reader is the old one, which reads Zip archives
serially from the beginning. This is efficient but cannot use
information from the Central Directory (especially file mode). It
also has problems with SFX archives. (I've actually removed the
seek-ahead SFX support from this reader.)
* The new "seekable" reader reads the Central Directory first and
therefore has access to slightly more information about each file.
In particular, it can fully support SFX archives. But it requires
seek support, so cannot read Zip archives from pipes or other
non-seekable inputs.
The two implementations obviously share a lot of code.
There are still rough edges but this does basically work. I've added
one Zip test to verify that SFX archives can be read correctly only
when seek is supported, but more testing is needed (in particular, the
fuzz tester only exercises one of the two Zip readers).
There are some unpleasant consequences of having a format reader that
relies on seek support. In particular, there are some performance
headaches during bid phase because the seeking bidder thrashes
libarchive's internal read-ahead buffers. There are also some
potentially ugly problems with read alignment when seeking.
On Windows platform, we have made own lseek, which cat handle 64 bits offset pointer, and use it.
If there is an obvious reason to use off_t defined as 32 bits offset pointer, we can use int64_t
for lseek instead of off_t on Windows.
I stupidly misunderstood a handling of CMake build options, ENABLE_TAR, ENABLE_TAR_SHARED,
ENABLE_CPIO and ENABLE_CPIO_SHARED, in r3240 and r3713. And that had made bsdtar and bsdcpio
disabled or being test failure on Windows platform.
- Simplify CMake build options; all platforms have the same default build options.
- Back out r3713.
Tim Kientzle [Sat, 12 Nov 2011 05:26:31 +0000 (00:26 -0500)]
Disable OpenSSL probe on Darwin.
This avoids a painful deprecation build error when the configure
finds RMD160 in OpenSSL.
We can re-enable this in the production version of libarchive 3.0.0,
since the production versions don't enable -Werror.
Tim Kientzle [Sat, 12 Nov 2011 05:21:58 +0000 (00:21 -0500)]
Issue 196: cpio format tests should verify that nlinks in the
archive matches what's on disk, instead of assuming historical
Unix behavior.
Thanks to: dpmcgee
Colin Percival [Thu, 10 Nov 2011 06:08:52 +0000 (01:08 -0500)]
Garbage collect NO_NAME. It hasn't been used since r423 (January 2009)
when the uname/gname lookups moved out of write.c to use the new
archive_read_disk API instead.
Tim Kientzle [Wed, 9 Nov 2011 05:05:57 +0000 (00:05 -0500)]
Issue 191: Update the manpage for archive_entry_stat to
clarify the fields actually copied.
While I'm here, fill in a few missing items and try to
make some of the descriptions a little more accurate.
Tim Kientzle [Sun, 6 Nov 2011 19:09:58 +0000 (14:09 -0500)]
Issue 190: Fix build when liblzma is installed through MacPorts.
The probe for liblzma finds it in /opt/local, which adds
/opt/local/include to the include search path, which causes
iconv.h to be found there at compile time, which breaks because
libiconv was found in /usr at configure time.
This change causes cmake to prefer /opt/local for everything,
so that libiconv is pulled from /opt/local, and we avoid
the breakage from iconv mismatch.
I have a nasty suspicion that similar problems can happen
with many package systems.
Tim Kientzle [Sat, 5 Nov 2011 23:34:57 +0000 (19:34 -0400)]
Mask SIGPIPE for libarchive test, tar, and cpio.
As reported at:
http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=641265
The SIGPIPE occurs when feeding data through a decompression
program; the external program may see an end-of-data marker
and exit before we've finished feeding it all of the data.
(This happens when the data has garbage padding at the end.)
We want to catch and ignore the EPIPE since we can still
read the data coming out of the decompression program.
Tim Kientzle [Sat, 5 Nov 2011 20:12:01 +0000 (16:12 -0400)]
Disable RMD160 checks on Darwin.
Without this, we find RMD160 in OpenSSL but then fail to build because
of deprecation errors.
There are certainly better ways to handle this.
Tim Kientzle [Thu, 3 Nov 2011 05:21:30 +0000 (01:21 -0400)]
Issue #189: Don't rely on dev/ino being zero when they
have not been set. Instead, explicitly track when these
values are set. In particular, this fixes the check
that prevents adding an archive to itself on NetBSD.
Colin Percival [Wed, 2 Nov 2011 21:13:46 +0000 (17:13 -0400)]
Remove test for 'self == NULL' in bzip2_reader_init. It isn't needed,
since the caller is responsible for providing a non-NULL pointer; and
it's meaningless because we've already dereferenced self a few lines
earlier.
Submitted by: Carlo Teubner (via Tarsnap bug bounties)
Tim Kientzle [Wed, 5 Oct 2011 05:01:31 +0000 (01:01 -0400)]
Fix a typo that prevented CommonCrypto (part of libSystem) from being
properly used on Darwin.
Note that Mac OS X 10.7 has deprecated OpenSSL in favor of CommonCrypto.
We still pick up RIPEMD160 from OpenSSL if it's available, which breaks
strict warnings because of the deprecation. This seems unavoidable;
CommonCrypto doesn't seem to support RIPEMD160. To avoid the deprecation
warning on Mac OS X 10.7, disable the OpenSSL checks. That loses
RIPEMD160 support, though.
Fix issue 174; largely merge r3692 from trunk.
Correctly handle Windows style full-path names, which are
leading \\.\ or \\?\ or \\?\\UNC\ or \\?\Volume{GUID}\ or C:\,
in archive_write_disk.c.
Tim Kientzle [Tue, 20 Sep 2011 05:21:22 +0000 (01:21 -0400)]
Issue 185: Include the contributed Zip in the regression test,
include this and another recently added test file to the distribution
described by Makefile.am.
Tim Kientzle [Mon, 19 Sep 2011 04:58:34 +0000 (00:58 -0400)]
Merge r3722 from trunk: Fixes extraction of Zip entries that use
length-at-end without specifying either the compressed or uncompressed
length. In particular, fixes bsdtar extraction of such files.
We cannot get proper an xml output from an earlier version of libxml.
There may be a way to work around it, but right now I cannot find out how to.
I have to, therefore, disable the xar writer if libxlm version is less than 2.7.3,
which version Mac Snow Leopard has.
On Windows, make sure an exit status is initialized in case something error happens
and exit __la_waitpid before we normally invoke GetExitCodeProcess.
Issue 182.
Decide whether ZLIB_WINAPI is needed at configuration time, because there are two types of zlib
on Windows platform: one is built on Visual Studio, which requires ZLIB_WINAPI for use; other is
build on msys, which does not require ZLIB_WINAPI, GnuWin32 project provide such zlib.