Tim Kientzle [Sun, 1 Dec 2013 22:45:56 +0000 (14:45 -0800)]
Refactor Zip writer.
Zip writer no longer preserves full archive_entry objects for
every entry; it just accumulates the actual bytes to be put
into the central directory. Most of the central directory file
header is formatted at the same time as the local file header.
The header formatting is refactored to make it easier to support
variable-length extra data.
The tests are adjusted to match the new output: We include more
detailed extra data in the central directory, we're more selective
about generating data descriptors (they're not needed for directory
entries, for instance), UT extra data now includes only the time
fields specified by the user, we're setting the "version required"
field more accurately.
There are some initial attempts to include Zip64 extensions
when appropriate; that still needs lots of work. I'm not
yet sure how to test Zip64 support without generating gigantic
archives. Hmmm...
Tim Kientzle [Tue, 26 Nov 2013 18:03:01 +0000 (10:03 -0800)]
Support Zip64 extra data fields for handling large entries.
Process extra data fields for central directory and local file headers
so we get correct full size information in both cases.
Correct central directory vs. local file header sanity check
to compare full size information (including data picked out of
the extra data).
Note: This does not yet support the Zip64 end-of-central-directory
marker so doesn't correctly handle very large archives.
Tim Kientzle [Tue, 26 Nov 2013 17:57:03 +0000 (09:57 -0800)]
Start refactoring Zip writer:
* Build list of entries for Central directory at entry_finish
(So we can switch in-memory Central dir to a list of binary blobs.)
* Rename some variables to clarify the code.
* Add 'zip64' option to force zip64 extensions for testing
Tim Kientzle [Sun, 24 Nov 2013 16:44:34 +0000 (08:44 -0800)]
Issue 332: Be more careful guessing file mode information from
incomplete Zip archives. In particular, some epub files have
0 in the file type part of the mode field.
Brad King [Tue, 30 Jul 2013 15:37:11 +0000 (11:37 -0400)]
Simplify passing of linker flags to try_compile calls
In commit d7bd02b6 (Modify CHECK_C_SOURCE_* checks to fix builds using
Visual Studio 12, 2013-02-01), commit e3d14342 (Set use of /SAFESEH linker
flag for all LIBARCHIVE_CHECK_C_SOURCE_* checks, 2013-02-01), and commit 58dc42aa (Fix checks for crypto algorithms in Visual Studio builds,
2013-02-01) we introduced and used custom copies of the CMake
CheckCSource(Compiles|Runs) modules in order to pass linker flags to
try_compile calls. CMake has an issue tracker entry about passing
CMAKE_*_LINKER_FLAGS to try_compile calls:
http://www.cmake.org/Bug/view.php?id=14066
Discussion there suggests a much simpler workaround: pass the flags
through the LDFLAGS environment variable. Remove our custom check
macros and use the simpler workaround instead.
Pavel Raiskup [Thu, 27 Jun 2013 14:01:30 +0000 (16:01 +0200)]
Use ustar format in the test_option_b test
.. because the ustar archive does not store SELinux context. As the default
format for bsdtar is "restricted pax" (trying to store xattrs and other
things by default), the test failed on Fedora because our files have by
default SELinux context set. This results in additional data in tested
archive ~> and the test failed because the archive was unexpectedly big:
tar/test/test_option_b.c:41: File archive1.tar has size 3072, expected 2048
Reviewed by Konrad Kleine <konrad.wilhelm.kleine@gmail.com>
Tim Kientzle [Thu, 11 Apr 2013 04:52:15 +0000 (21:52 -0700)]
Issue 314: A tar archive containing only a single 'g' record
should be treated as a valid empty tar archive.
(Such archives are generated by 'git archive' from an empty
repository.)
Tim Kientzle [Sat, 23 Mar 2013 06:48:41 +0000 (23:48 -0700)]
Limit write requests to at most INT_MAX.
This prevents a certain common programming error (passing -1 to write)
from leading to other problems deeper in the library.
Xi Wang [Sun, 20 Jan 2013 23:17:20 +0000 (18:17 -0500)]
Fix overflow checking in archive_entry_sparse_add_entry()
gcc will optimize the overflow check x + y < 0 (assuming x, y >= 0)
into false, since signed integer overflow is undefined behavior in C.
Use a safe precondition check instead.
Andres Mejia [Sun, 24 Feb 2013 18:06:28 +0000 (13:06 -0500)]
Fix test_archive_write_add_filter_by_name_lrzip test case.
There's some bug in lrzip where small files cannot use 2nd stage
compression.
See http://ck-hack.blogspot.com/2012/03/lrzip-0612.html?showComment=1337356929450#c3154145708572533571
Andres Mejia [Sun, 24 Feb 2013 16:54:26 +0000 (11:54 -0500)]
Fix test cases for LZO write support.
Some architectures would produce a bigger archive for compression
level 9 than with the default level, possibly due to memory
limitations.
Fixes #303
Andres Mejia [Fri, 8 Feb 2013 20:00:05 +0000 (15:00 -0500)]
Change crypto checks, find necessary library before corresponding checks are done.
LIBS are set back to original value if all crypto checks for that implementation
fail.
Andres Mejia [Tue, 5 Feb 2013 22:51:15 +0000 (17:51 -0500)]
Provide better check for when libpcreposix is to be used for regex support.
On Windows, if the static libraries for PCRE are to be used and the PCRE static libs were built
using the mingw toolchain, libgcc must also be linked for resolving the symbol ___chkstk_ms.
Dave Reisner [Fri, 6 Jul 2012 03:31:49 +0000 (23:31 -0400)]
build-sys: install all library manpages
A number of manpages were curiously omitted from the installation
process, but are referred to in installed manpages. To avoid developers
spontaneously combusting, ship all available manpages.
Andres Mejia [Mon, 4 Feb 2013 03:05:34 +0000 (22:05 -0500)]
Fix crypto check failures on Windows.
Checks will now be similar to checks done with autotools, where all defines are passed into a source file
along with the append source code to be checked. Also, once a library that support a crypto function is
found, all other checks for that crypto function will be skipped.
Andres Mejia [Fri, 1 Feb 2013 21:52:19 +0000 (16:52 -0500)]
Modify CHECK_C_SOURCE_* checks to fix builds using Visual Studio 12.
This is needed to fix build failures using Visual Studio 12 and using libraries such as liblzma which
have been built without the "/SAFESEH" linker flag (which is the usual case for libraries built using
the mingw toolchain).