]> git.ipfire.org Git - thirdparty/libarchive.git/log
thirdparty/libarchive.git
11 years agoHarmless typo in a comment. 56/head
NiLuJe [Tue, 24 Dec 2013 18:08:44 +0000 (19:08 +0100)] 
Harmless typo in a comment.

11 years agoMerge branch 'master' into fix-mingw
NiLuJe [Tue, 24 Dec 2013 17:49:48 +0000 (18:49 +0100)] 
Merge branch 'master' into fix-mingw

11 years agoMerge pull request #57 from NiLuJe/fix-has_encrypted_entries
Tim Kientzle [Tue, 24 Dec 2013 06:55:49 +0000 (22:55 -0800)] 
Merge pull request #57 from NiLuJe/fix-has_encrypted_entries

Make sure has_encrypted_entries is a signed int

11 years agoMerge pull request #54 from NiLuJe/fix-autotools-build
Tim Kientzle [Tue, 24 Dec 2013 06:49:22 +0000 (22:49 -0800)] 
Merge pull request #54 from NiLuJe/fix-autotools-build

Fix autotools build.

11 years agoMerge pull request #53 from NiLuJe/fix-issue-317
Tim Kientzle [Tue, 24 Dec 2013 06:47:27 +0000 (22:47 -0800)] 
Merge pull request #53 from NiLuJe/fix-issue-317

Fix issue 317

11 years agoMissed two tests! 54/head
NiLuJe [Mon, 23 Dec 2013 18:57:50 +0000 (19:57 +0100)] 
Missed two tests!

(Mentioned in #58, thanks!)

11 years agoMake sure has_encrypted_entries is a signed int 57/head
NiLuJe [Mon, 23 Dec 2013 00:44:45 +0000 (01:44 +0100)] 
Make sure has_encrypted_entries is a signed int

Related to cd1740912b18f748a4f9b491a32b44c1712a7478

Trying to assign -1 (ARCHIVE_READ_FORMAT_ENCRYPTION_DONT_KNOW)
to a data type we're not sure will always be signed is a bad idea
(blew up on ARM, for instance).

11 years agoMore MinGW trickery...
NiLuJe [Sun, 22 Dec 2013 23:04:38 +0000 (00:04 +0100)] 
More MinGW trickery...

Poor man's attempt at making 4e002d9a92ecd7cec0fb98b0bedbace8aad81f6e
play nice with MinGW.
Dry coded for the fastest solution, there's probably a much better
way to handle that sanely & properly.

11 years agoFix previous commit.
NiLuJe [Sun, 22 Dec 2013 22:31:51 +0000 (23:31 +0100)] 
Fix previous commit.

Forgot to check if cpio_windows.h actually pulled windows.h in ;p.

11 years agoFix cpio build on MinGW.
NiLuJe [Sun, 22 Dec 2013 22:26:04 +0000 (23:26 +0100)] 
Fix cpio build on MinGW.

Exact same concept as the previous commit.

11 years agoBetter fix.
NiLuJe [Sun, 22 Dec 2013 22:13:14 +0000 (23:13 +0100)] 
Better fix.

Restore e6d1e13b2880ab0e6166e5ed168df7e6e0de943b,
and make sure that we include windows.h earlier for the CLI tools.

11 years agoRevert "Remove unnecessary windows.h include"
NiLuJe [Sun, 22 Dec 2013 22:05:24 +0000 (23:05 +0100)] 
Revert "Remove unnecessary windows.h include"

This reverts commit e6d1e13b2880ab0e6166e5ed168df7e6e0de943b.

We do need this (for the CLI tools).

Fixes a build failure on MinGW:
  CC       tar/bsdtar-bsdtar.o
In file included from tar/bsdtar_platform.h:62:0,
                 from tar/bsdtar.c:26:
./libarchive/archive_entry.h:250:64: error: unknown type name 'BY_HANDLE_FILE_INFORMATION'
 __LA_DECL void archive_entry_copy_bhfi(struct archive_entry *, BY_HANDLE_FILE_INFORMATION *);
                                                                ^

11 years agoFix issue 317 53/head
NiLuJe [Sun, 22 Dec 2013 17:43:18 +0000 (18:43 +0100)] 
Fix issue 317

This is the exact same fix as mentionne din the GC issue,
cf. https://code.google.com/p/libarchive/issues/detail?id=317

11 years agoFix autotools build.
NiLuJe [Sun, 22 Dec 2013 17:41:16 +0000 (18:41 +0100)] 
Fix autotools build.

Follows commits 4e002d9a92ecd7cec0fb98b0bedbace8aad81f6e &
7a90710e0d3c786cf4f3af2457a815db6c9b5a5a that only handled CMake.

11 years agoStyle: Use 'int' not 'char' for status return types.
Tim Kientzle [Fri, 20 Dec 2013 05:38:53 +0000 (21:38 -0800)] 
Style:  Use 'int' not 'char' for status return types.
Fix a const mistake.

11 years agoStyle: Don't check for entry being non-NULL (none
Tim Kientzle [Fri, 20 Dec 2013 05:25:34 +0000 (21:25 -0800)] 
Style:  Don't check for entry being non-NULL (none
of the archive_entry routines do this); adjust
some indentation to match the other code.

11 years agoZip and Rar store file times in local time,
Tim Kientzle [Fri, 20 Dec 2013 05:17:23 +0000 (21:17 -0800)] 
Zip and Rar store file times in local time,
so we can't verify them in tests (since the
time varies depending on the time zone where
the tests are being run).

11 years agoMerge branch 'encryption_detection' of github.com:kwk/libarchive into kwk-encryption_...
Tim Kientzle [Fri, 20 Dec 2013 04:55:10 +0000 (20:55 -0800)] 
Merge branch 'encryption_detection' of github.com:kwk/libarchive into kwk-encryption_detection

Conflicts:
libarchive/archive_read_support_format_zip.c

11 years agoIgnore emacs backup files
Tim Kientzle [Fri, 20 Dec 2013 04:41:59 +0000 (20:41 -0800)] 
Ignore emacs backup files

11 years agoRefactor archive_version_details to eliminate size and printf concerns
Tim Kientzle [Fri, 20 Dec 2013 04:29:14 +0000 (20:29 -0800)] 
Refactor archive_version_details to eliminate size and printf concerns

11 years agoMerge branch 'archive-version-details' of github.com:rosslagerwall/libarchive into...
Tim Kientzle [Fri, 20 Dec 2013 04:19:19 +0000 (20:19 -0800)] 
Merge branch 'archive-version-details' of github.com:rosslagerwall/libarchive into rosslagerwall-archive-version-details

11 years agoMerge branch 'local_coverage' of github.com:kwk/libarchive into kwk-local_coverage
Tim Kientzle [Fri, 20 Dec 2013 04:14:26 +0000 (20:14 -0800)] 
Merge branch 'local_coverage' of github.com:kwk/libarchive into kwk-local_coverage

Conflicts:
CMakeLists.txt

11 years agoRefactor lafe_setprogname slightly to avoid the repeated logic about default handling
Tim Kientzle [Fri, 20 Dec 2013 04:10:46 +0000 (20:10 -0800)] 
Refactor lafe_setprogname slightly to avoid the repeated logic about default handling

11 years agoMerge branch 'master' of github.com:jymigeon/libarchive into jymigeon-master
Tim Kientzle [Fri, 20 Dec 2013 03:58:33 +0000 (19:58 -0800)] 
Merge branch 'master' of github.com:jymigeon/libarchive into jymigeon-master

11 years agoInclude coverage script if ENABLE_COVERAGE is set 44/head
Konrad Kleine [Fri, 13 Dec 2013 08:28:55 +0000 (09:28 +0100)] 
Include coverage script if ENABLE_COVERAGE is set

Rather than including the LibarchiveCodeCoverage.cmake file and checking
there if ENABLE_COVERAGE is set, we only include the file if this option
is set in the first place.

11 years agoMoved local code coverage code separate script
Konrad Kleine [Fri, 13 Dec 2013 08:13:01 +0000 (09:13 +0100)] 
Moved local code coverage code separate script

11 years agoMerge pull request #50 from mcuelenaere/fix-win32-ascii-unicode
Tim Kientzle [Fri, 13 Dec 2013 06:01:32 +0000 (22:01 -0800)] 
Merge pull request #50 from mcuelenaere/fix-win32-ascii-unicode

Use correct variable types for ASCII Windows functions.

11 years agoMerge pull request #52 from seishun/patch-1
Tim Kientzle [Fri, 13 Dec 2013 06:00:31 +0000 (22:00 -0800)] 
Merge pull request #52 from seishun/patch-1

Remove unnecessary windows.h include

11 years agoMerge pull request #48 from kwk/master
Tim Kientzle [Fri, 13 Dec 2013 05:49:25 +0000 (21:49 -0800)] 
Merge pull request #48 from kwk/master

Added all Zip compression names from 6.3.3 format

11 years agoMerge pull request #46 from trel/master
Tim Kientzle [Fri, 13 Dec 2013 05:48:31 +0000 (21:48 -0800)] 
Merge pull request #46 from trel/master

include linux/types.h on CentOS 5 in test/test_sparse_basic.c

11 years agoENH: Allow fine grained control over dependancies
Hans Johnson [Thu, 16 May 2013 16:26:46 +0000 (11:26 -0500)] 
ENH: Allow fine grained control over dependancies

An end user may want to explicitly avoid using
a feature that can be automatically found on the
build system.  This arose when the build machine
had libraries for LZMA but the target machine
did not have those libraries available.

By allowing flags the optional features provided by
LZMA/ZLIB/BZip2/EXPAT/PCREPOSIX/LibGCC
can be explicitly removed (Default behavior is
to use what can be found).

11 years agoFix tar test build with CMake
Tim Kientzle [Fri, 13 Dec 2013 05:22:13 +0000 (21:22 -0800)] 
Fix tar test build with CMake

11 years agoMerge pull request #39 from arsenm/master
Tim Kientzle [Fri, 13 Dec 2013 04:38:05 +0000 (20:38 -0800)] 
Merge pull request #39 from arsenm/master

Fix test builds when building as a sub-project

11 years agoMerge branch 'master' of github.com:libarchive/libarchive
Tim Kientzle [Fri, 13 Dec 2013 04:24:52 +0000 (20:24 -0800)] 
Merge branch 'master' of github.com:libarchive/libarchive

11 years agotar option mac-ext can now be used to control whether mac extensions are processed...
Tim Kientzle [Fri, 13 Dec 2013 04:24:43 +0000 (20:24 -0800)] 
tar option mac-ext can now be used to control whether mac extensions are processed; defaults to off on non-MacOS

11 years agolibarchive: Use ARCHIVE_LITERAL_ULL to add ULL integer suffix
Brad King [Mon, 9 Dec 2013 19:03:43 +0000 (14:03 -0500)] 
libarchive: Use ARCHIVE_LITERAL_ULL to add ULL integer suffix

The macro maps to an implementation that works on older compilers when
necessary.  Convert the 0ULL literal introduced by commit 6cf33c93
(Issue 320:  Rewrite (again) to avoid the left shift that CLang dislikes
so much, 2013-12-07) to use the macro.

11 years agoFix tabs.
Tim Kientzle [Sat, 7 Dec 2013 22:56:38 +0000 (14:56 -0800)] 
Fix tabs.

11 years agoIssue 320: Rewrite (again) to avoid the left shift that CLang dislikes so much.
Tim Kientzle [Sat, 7 Dec 2013 22:51:26 +0000 (14:51 -0800)] 
Issue 320:  Rewrite (again) to avoid the left shift that CLang dislikes so much.

This version simulates 2s-complement arithmetic on an
unsigned value, then casts it to signed at the end.

11 years agoIssue 332: Be more careful guessing file mode information from
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.

11 years agoMerge branch 'master' of github.com:libarchive/libarchive
Tim Kientzle [Sun, 24 Nov 2013 00:02:30 +0000 (16:02 -0800)] 
Merge branch 'master' of github.com:libarchive/libarchive

11 years agoAdd tests to verify that the seeking Zip reader can correctly
Tim Kientzle [Sun, 24 Nov 2013 00:01:11 +0000 (16:01 -0800)] 
Add tests to verify that the seeking Zip reader can correctly
ignore padding at beginning or end.  Fix Issue #257.

11 years agoExport the seekable and streamable zip readers separately
Tim Kientzle [Sat, 23 Nov 2013 23:59:38 +0000 (15:59 -0800)] 
Export the seekable and streamable zip readers separately
to simplify testing.

11 years agoMention the -r option when we can't find our reference files.
Tim Kientzle [Sat, 23 Nov 2013 23:59:07 +0000 (15:59 -0800)] 
Mention the -r option when we can't find our reference files.

11 years agoRemove unnecessary windows.h include 52/head
Nikolai Vavilov [Sat, 12 Oct 2013 20:42:17 +0000 (23:42 +0300)] 
Remove unnecessary windows.h include

11 years agoBetter archive_read_has_encrypted_entries function 51/head
Konrad Kleine [Wed, 9 Oct 2013 11:53:15 +0000 (13:53 +0200)] 
Better archive_read_has_encrypted_entries function

These are the possible return values:
=====================================

ARCHIVE_READ_FORMAT_ENCRYPTION_UNSUPPORTED (-2):
------------------------------------------------
This is the default return value for reader that don't support
encrpytion detection at all. When this value is returned you can be sure
that it will always be returned even on later calls to
archive_read_has_encrypted_entries.

ARCHIVE_READ_FORMAT_ENCRYPTION_DONT_KNOW (-1):
----------------------------------------------
This is the default return value for readers that support encryption. It
means that the reader is not yet ready (e.g. not enough data was read so
far) to say that there are encrypted entries in the archive. Over time
as more data was consumed by a reader this value might change to 0 or 1.

0:
--
No encrypted entries were found yet (maybe there will be one when
reading the next header). When 0 is returned, it might be that on a
later call 1 will be returned.

1:
--
At least one encrypted entry was found. Once 1 is returned. It will
always be returned even if the another entry is not encrypted.

NOTE:
=====
If the metadata/header of an archive is also encrypted, you
cannot rely on the number of encrypted entries. That is why this
function does not return the number of encrypted entries but
just 1 to show that there are some. Also, two distinct readers might
detect the number of entries and their encryption status at different
times. If one reader can say how many files are encrypted after reading
the first header another reader might need more data. In the end the
number of encrypted entries might be the same in two archives while the
appropriate readers output different results at different points in
time. This is more confusing than helpful.

11 years agoAvoid struct init with variable
Brad King [Thu, 26 Sep 2013 12:58:24 +0000 (08:58 -0400)] 
Avoid struct init with variable

Compilers such as Borland and MIPSpro do not like struct initialization
with variables.  Initialize using assignment instead.

11 years agoMerge branch 'simplify-link-flags'
Brad King [Wed, 25 Sep 2013 12:37:31 +0000 (08:37 -0400)] 
Merge branch 'simplify-link-flags'

11 years agoMerge branch 'no-signed-shift'
Brad King [Wed, 25 Sep 2013 12:37:26 +0000 (08:37 -0400)] 
Merge branch 'no-signed-shift'

11 years agoStore encryption info in single char of entry
Konrad Kleine [Wed, 18 Sep 2013 08:27:21 +0000 (10:27 +0200)] 
Store encryption info in single char of entry

Instead of two chars the information about encryption is now stored in
one single char inside of an archive_entry struct.

11 years agoDetect encrypted archive entries (ZIP, RAR, 7Zip)
Konrad Kleine [Mon, 1 Jul 2013 15:12:24 +0000 (17:12 +0200)] 
Detect encrypted archive entries (ZIP, RAR, 7Zip)

With this change you can detect if an archive entry is encrypted. The
archive formats covered with this change are: ZIP, RAR, and 7zip. Other
formats can be added quite simply by looking at the already supported
formats. For all the already supported formats we have tests that check
if:

* an archive entries's data is encryped (data test)
* an archive entries's metadata is encrypted (header test)
* one file is encrypted while another is not (partially test)

These new functions are introduced.

int archive_read_format_capabilities(struct archive*)

Returns a bitmask of capabilities that are supported by the archive
format reader. If the reader has no special capabilities,
ARCHIVE_READ_FORMAT_CAPS_NONE is returned; otherwise 0 is returned.

You can call this function even before reading the first header from
an archive.

Return Values:
* ARCHIVE_READ_FORMAT_CAPS_ENCRYPT_DATA
The reader supports detection of encrypted data.
* ARCHIVE_READ_FORMAT_CAPS_ENCRYPT_METADATA
The reader supports detection of encrypted metadata (e.g.
filename, modification time, size, etc.)
* ARCHIVE_READ_FORMAT_CAPS_NONE
None of the above capabilities. If this value is returned, this
doesn't mean that the format itself doesn't support any type of
encryption it simply means that the reader is not capable of
detecting it.

int archive_read_has_encrypted_entries(struct archive *)

Returns "true" (non-zero) if the archive contains at least one
encrypted entry, no matter which encryption type (data or metadata)
is used; otherwise 0 is returned.

You should only call this function after reading the first header
from an archive.

NOTE: I'm not sure that this function will stay in for long.

int archive_entry_is_data_encrypted(struct archive_entry*)

Returns "true" (non-zero) if the archive entry's data is encrypted;
otherwise 0 is returned. You can call this function after calling
archive_read_next_header().

int archive_entry_is_metadata_encrypted(struct archive_entry*)

Returns "true" (non-zero) if the archive entry's metadata is
encrypted; otherwise 0 is returned. You can call this function after
calling archive_read_next_header().

int archive_entry_is_encrypted(struct archive_entry*)

Returns "true" (non-zero) if either the archive entry's data and/or
it's metadata is encrypted; otherwise 0 is returned. You can call
this function after calling archive_read_next_header().

If you use archive_read_format_capabilities() in combination with one of
the archive_entry_is_[data|metadata]_encrypted() functions, you can be
sure that you've encountered an encrypted entry. This allows you to
react differently depending on libarchive's return codes. For instance,
you might want to skip encrypted files from being extracted until
decryption support has been implemented.

Here's how I generated the 7zip test files:
-------------------------------------------

With header encrpytion (-mhe=on):

    $ rm -f test_read_format_7zip_encryption_header.7z
    $ echo "foo" > bar.txt && 7z a -mhe=on -p12345678 \
    test_read_format_7zip_encryption_header.7z bar.txt

    $ uuencode test_read_format_7zip_encryption_header.7z \
    test_read_format_7zip_encryption_header.7z > \
    test_read_format_7zip_encryption_header.7z.uu

Without header encrpytion (-mhe=off):

    $ rm -f test_read_format_7zip_encryption.7z
    $ echo "foo" > bar.txt && 7z a -mhe=off -p12345678 \
    test_read_format_7zip_encryption.7z bar.txt

    $ uuencode test_read_format_7zip_encryption.7z \
    test_read_format_7zip_encryption.7z > \
    test_read_format_7zip_encryption.7z.uu

Partially encrypted archive:

$ rm -f test_read_format_7zip_encryption_partially.7z
$ echo "foo" > bar_unencrypted.txt && 7z a \
test_read_format_7zip_encryption_partially.7z bar_unencrypted.txt
$ echo "foo" > bar_encrypted.txt && 7z a -mhe=off -p12345678 \
test_read_format_7zip_encryption_partially.7z bar_encrypted.txt

$ uuencode test_read_format_7zip_encryption_partially.7z \
test_read_format_7zip_encryption_partially.7z > \
test_read_format_7zip_encryption_partially.7z.uu

Here's how I generated the RAR test files:
------------------------------------------

These are the files we can will add to the archives:

    echo "data of foo.txt" > foo.txt
    echo "data of bar.txt" > bar.txt

 With header encrpytion (-hp):

    rm -f test_read_format_rar_encryption_header.rar
    rar a -hp12345678 test_read_format_rar_encryption_header.rar \
    foo.txt bar.txt

    uuencode test_read_format_rar_encryption_header.rar \
    test_read_format_rar_encryption_header.rar > \
    test_read_format_rar_encryption_header.rar.uu

Without header encrpytion (-p):

    rm -f test_read_format_rar_encryption_data.rar
    rar a -p12345678 test_read_format_rar_encryption_data.rar \
    foo.txt bar.txt

    uuencode test_read_format_rar_encryption_data.rar \
    test_read_format_rar_encryption_data.rar > \
    test_read_format_rar_encryption_data.rar.uu

Partially encrypted archive (-p on "foo.txt" and no password on "bar.txt"):

    rm -f test_read_format_rar_encryption_partially.rar
    rar a -p12345678 test_read_format_rar_encryption_partially.rar foo.txt
    rar a test_read_format_rar_encryption_partially.rar bar.txt

    uuencode test_read_format_rar_encryption_partially.rar \
    test_read_format_rar_encryption_partially.rar > \
    test_read_format_rar_encryption_partially.rar.uu

Here's how I generated the ZIP test files:
------------------------------------------

This is how I've created the test files:

These are the files we will add to the archives:
  On Windows:
    echo "data of foo.txt" > foo.txt
    echo "data of bar.txt" > bar.txt

For the creation of the Zip archives I've used the
PKZIP Command Line Add-On available from here:

http://comm.pkware.com/pkzip-cli-download.html

With header (aka central directory) encrpytion (-cd):

  On Windows:
    del /F test_read_format_zip_encryption_header.zip
    pkzipc.exe -add -cryptalgorithm=AES,256 -passphrase=12345678 -cd test_read_format_zip_encryption_header.zip foo.txt bar.txt

  On Linux:
    uuencode test_read_format_zip_encryption_header.zip \
    test_read_format_zip_encryption_header.zip > \
    test_read_format_zip_encryption_header.zip.uu

Without header encrpytion:

  On Windows:
    del /F test_read_format_zip_encryption_data.zip
    pkzipc.exe -add -cryptalgorithm=AES,256 -passphrase=12345678 test_read_format_zip_encryption_data.zip foo.txt bar.txt

  On Linux:
    uuencode test_read_format_zip_encryption_data.zip \
    test_read_format_zip_encryption_data.zip > \
    test_read_format_zip_encryption_data.zip.uu

Partially encrypted archive ("foo.txt" is encrypted and "bar.txt" is not):

  On Windows:
    del /F test_read_format_zip_encryption_partially.zip
    pkzipc.exe -add -cryptalgorithm=AES,256 -passphrase=12345678 test_read_format_zip_encryption_partially.zip foo.txt
    pkzipc.exe -add test_read_format_zip_encryption_partially.zip bar.txt

  On Linux:
    uuencode test_read_format_zip_encryption_partially.zip \
    test_read_format_zip_encryption_partially.zip > \
    test_read_format_zip_encryption_partially.zip.uu

11 years agoUse correct variable types for ASCII Windows functions. 50/head
Maurus Cuelenaere [Mon, 16 Sep 2013 12:28:46 +0000 (14:28 +0200)] 
Use correct variable types for ASCII Windows functions.

There are both an ASCII and an Unicode variant for most of the Win32 API.
Fix some inconsistent uses.

11 years agoShow third party library versions in version string 49/head
Ross Lagerwall [Mon, 16 Sep 2013 06:39:02 +0000 (08:39 +0200)] 
Show third party library versions in version string

Add a utility function, archive_version_details, to return a string
containing the libarchive version as well as the versions of third party
libraries such as zlib, bz2lib and liblzma.  Use this function for
bsdtar --version and bsdcpio --version.

http://code.google.com/p/libarchive/issues/detail?id=118

11 years agoRemoved compression_method struct type 48/head
Konrad Kleine [Fri, 13 Sep 2013 14:01:36 +0000 (16:01 +0200)] 
Removed compression_method struct type

Since it was only used in one place, I've remove the struct type.

11 years agoSimplified and fixed Zip compression method array
Konrad Kleine [Fri, 13 Sep 2013 07:22:26 +0000 (09:22 +0200)] 
Simplified and fixed Zip compression method array

I've removed the description string element from the compression_method
struct and fixed some spelling errors (imb -> ibm).

11 years agoAdded all Zip compression names from 6.3.3 format
Konrad Kleine [Thu, 12 Sep 2013 15:01:31 +0000 (17:01 +0200)] 
Added all Zip compression names from 6.3.3 format

I've added all the compression names and IDs from the ".ZIP File Format
Specification" version 6.3.3  that can be found in section "4.4.5
compression method" of this document:

http://www.pkware.com/documents/casestudies/APPNOTE.TXT

11 years agoHide *lafe_progname and provide getter/setter instead. 47/head
Jean-Yves Migeon [Fri, 6 Sep 2013 15:17:57 +0000 (17:17 +0200)] 
Hide *lafe_progname and provide getter/setter instead.

This factorizes some code between binaries like bsdtar, bsdcpio, and
the soon-to-be mtree.

11 years agost_dev field corresponds to dev{major,minor} and not rdev{major,minor}.
Jean-Yves Migeon [Thu, 5 Sep 2013 14:42:17 +0000 (16:42 +0200)] 
st_dev field corresponds to dev{major,minor} and not rdev{major,minor}.

11 years agoBug fix (segfault): check filename against NULL in case we want
Jean-Yves Migeon [Thu, 5 Sep 2013 13:27:52 +0000 (15:27 +0200)] 
Bug fix (segfault): check filename against NULL in case we want
the output to go to stdout.

11 years agoDocument "resdevice" and "inode".
Jean-Yves Migeon [Wed, 4 Sep 2013 17:08:21 +0000 (19:08 +0200)] 
Document "resdevice" and "inode".

11 years agoImplement "resdevice" and "inode" in the mtree(5) spec.
Jean-Yves Migeon [Wed, 4 Sep 2013 16:58:47 +0000 (18:58 +0200)] 
Implement "resdevice" and "inode" in the mtree(5) spec.
- resdevice is the keyword that corresponds to the "resident" device,
e.g. the one where the entry resides;
- inode is entry's inode number.

11 years agoSmall typo fix in parse_device()'s description.
Jean-Yves Migeon [Wed, 4 Sep 2013 13:11:59 +0000 (15:11 +0200)] 
Small typo fix in parse_device()'s description.

11 years agoStart implementing the "resdevice" (resident device) keyword. It
Jean-Yves Migeon [Wed, 4 Sep 2013 13:08:20 +0000 (15:08 +0200)] 
Start implementing the "resdevice" (resident device) keyword. It
corresponds to the st_dev field of stat(2), e.g. the ID of the
device that contains the inode.

Change parse_device() prototype so it can be used for "device"
and "resdevice", and call the appropriate archive_entry_set_{,r}dev()
function to store the field value.

11 years agoFix chown line in shardump format
Tony Morlan [Sat, 24 Aug 2013 01:43:26 +0000 (20:43 -0500)] 
Fix chown line in shardump format

Currently the chown line is written with no space before entry name.

11 years agoSome more test cases around the "2 hours ago" concept.
Tim Kientzle [Wed, 4 Sep 2013 03:30:16 +0000 (20:30 -0700)] 
Some more test cases around the "2 hours ago" concept.

11 years agoMerge branch 'master' of github.com:libarchive/libarchive
Tim Kientzle [Wed, 4 Sep 2013 03:27:46 +0000 (20:27 -0700)] 
Merge branch 'master' of github.com:libarchive/libarchive

11 years agoAdd the device parsing logic. It allows mtree's libarchive to
Jean-Yves Migeon [Tue, 3 Sep 2013 14:12:37 +0000 (16:12 +0200)] 
Add the device parsing logic. It allows mtree's libarchive to
parse device entries like NetBSD's mtree and its multiple possible
format: native, 386bsd, 4bsd, bsdos, freebsd, hpux, isc, linux, netbsd,
osf1, sco, solaris, sunos, svr3, svr4, and ultrix.

11 years agoDocument the "device" keyword and its value.
Jean-Yves Migeon [Tue, 3 Sep 2013 09:45:32 +0000 (11:45 +0200)] 
Document the "device" keyword and its value.

11 years agoTypo fix.
Jean-Yves Migeon [Fri, 30 Aug 2013 15:03:39 +0000 (17:03 +0200)] 
Typo fix.

11 years ago"optional" is also supported, so add it to mtree.5.
Jean-Yves Migeon [Thu, 29 Aug 2013 15:01:27 +0000 (17:01 +0200)] 
"optional" is also supported, so add it to mtree.5.

11 years agosha384 and sha512 are supported tags, add them to mtree.5.
Jean-Yves Migeon [Thu, 29 Aug 2013 14:28:59 +0000 (16:28 +0200)] 
sha384 and sha512 are supported tags, add them to mtree.5.

12 years agoinclude linux/types.h on CentOS 5 in test_sparse_basic.c 46/head
Terrell Russell [Tue, 30 Jul 2013 18:52:24 +0000 (14:52 -0400)] 
include linux/types.h on CentOS 5 in test_sparse_basic.c

Was getting this error:

In file included from ....../libarchive-3.1.2/libarchive/test/test_sparse_basic.c:44:
/usr/include/linux/fiemap.h:15: error: expected specifier-qualifier-list before ‘__u64’
/usr/include/linux/fiemap.h:26: error: expected specifier-qualifier-list before ‘__u64’

From https://groups.google.com/forum/#!msg/libarchive-discuss/691PHz5ENOc/4OzXBevG75AJ I see that the <linux/types.h> file is not included.

This fixed the problem for me on CentOS 5.8.
It was not visible as an issue on CentOS 6.3 or Ubuntu 10 or 12.

This change did not appear to break those already functioning platforms.

12 years agoSimplify passing of linker flags to try_compile calls 45/head
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.

12 years agohttp://code.google.com/p/libarchive/issues/detail?id=325
Tim Kientzle [Fri, 12 Jul 2013 16:14:20 +0000 (09:14 -0700)] 
http://code.google.com/p/libarchive/issues/detail?id=325

Close the file handle on error.

12 years agohttp://code.google.com/p/libarchive/issues/detail?id=325
Tim Kientzle [Fri, 12 Jul 2013 16:12:34 +0000 (09:12 -0700)] 
http://code.google.com/p/libarchive/issues/detail?id=325

Simplify the method/level checks here and fix a bug.

12 years agoRun code coverage on your local machine
Konrad Kleine [Wed, 10 Jul 2013 15:40:55 +0000 (17:40 +0200)] 
Run code coverage on your local machine

This change introduces a new make target called "coverage" it will
compile your code using special GCC flags, run the tests, and then
generate a nice HTML output.

This new make target will only be available if you build using GCC in
Debug mode.

To build the code coverage and open it in your browser do this:

    mkdir debug
    cd debug
    cmake -DCMAKE_BUILD_TYPE=Debug -DENABLE_COVERAGE=ON ..
    make -j20
    make coverage
    xdg-open coverage/index.html

12 years agoAdd more files autogenerated by automake build system to .gitignore.
Andres Mejia [Sat, 29 Jun 2013 19:53:08 +0000 (15:53 -0400)] 
Add more files autogenerated by automake build system to .gitignore.

12 years agoUse ustar format in the test_option_b test
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>

12 years agoRework the sign-extension to avoid left-shift of
Tim Kientzle [Sat, 29 Jun 2013 15:15:23 +0000 (08:15 -0700)] 
Rework the sign-extension to avoid left-shift of
an explicit negative number (which newer GCC complains about).

12 years agoUpdated libarchive.spec from Nikolai Lifanov.
Tim Kientzle [Wed, 1 May 2013 15:55:40 +0000 (08:55 -0700)] 
Updated libarchive.spec from Nikolai Lifanov.

12 years agoMerge pull request #32 from bamiaux/fix_win32_exclusive_read_access
Tim Kientzle [Sun, 14 Apr 2013 04:38:30 +0000 (21:38 -0700)] 
Merge pull request #32 from bamiaux/fix_win32_exclusive_read_access

Do not require exclusive read access when reading files under windows

12 years agoMerge pull request #40 from juikim/master
Tim Kientzle [Sun, 14 Apr 2013 01:42:08 +0000 (18:42 -0700)] 
Merge pull request #40 from juikim/master

Do not overwrite file size if the local file header has valid file size.

12 years agoIssue 314: A tar archive containing only a single 'g' record
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.)

http://thread.gmane.org/gmane.comp.version-control.git/220485
http://code.google.com/p/libarchive/issues/detail?id=314

12 years agoExpose the generic archive_free hook
Tim Kientzle [Sat, 6 Apr 2013 19:17:52 +0000 (12:17 -0700)] 
Expose the generic archive_free hook

12 years agoIf seek fails, fail the xar read. We should be able to do better than this.
Tim Kientzle [Sat, 6 Apr 2013 19:06:15 +0000 (12:06 -0700)] 
If seek fails, fail the xar read.  We should be able to do better than this.

12 years agoDo not overwrite file size if the local file header has valid file size. 40/head
Jung-uk Kim [Mon, 1 Apr 2013 21:02:18 +0000 (17:02 -0400)] 
Do not overwrite file size if the local file header has valid file size.
This allows us to extract index.xml from Apple iWork '09 format files.

12 years agoMerge pull request #33 from xiw/overflow
Tim Kientzle [Sat, 30 Mar 2013 17:58:21 +0000 (10:58 -0700)] 
Merge pull request #33 from xiw/overflow

Fix overflow checking in archive_entry_sparse_add_entry()

12 years agoLimit write requests to at most INT_MAX.
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.

12 years agoFix overflow checking in archive_entry_sparse_add_entry() 33/head
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.

12 years agoFix cmake test builds when building as a sub-project 39/head
Matt Arsenault [Wed, 13 Mar 2013 04:27:39 +0000 (21:27 -0700)] 
Fix cmake test builds when building as a sub-project

12 years agoFix test_archive_write_add_filter_by_name_lrzip test case.
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

12 years agoAllow the option to use no 2nd stage compression with lrzip.
Andres Mejia [Sun, 24 Feb 2013 18:05:33 +0000 (13:05 -0500)] 
Allow the option to use no 2nd stage compression with lrzip.

12 years agoInitialize buff to all zeros.
Andres Mejia [Sun, 24 Feb 2013 17:54:44 +0000 (12:54 -0500)] 
Initialize buff to all zeros.

12 years agoFix test cases for LZO write support.
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

12 years agowrite_raw support from Marek Kubica
Tim Kientzle [Sat, 23 Feb 2013 21:19:59 +0000 (13:19 -0800)] 
write_raw support from Marek Kubica

Merged branch 'feature/write-format-raw' of https://github.com/Leonidas-from-XIV/libarchive

12 years agoRevert "Allow adding extra CFLAGS with a configure option."
Andres Mejia [Sat, 23 Feb 2013 02:40:33 +0000 (21:40 -0500)] 
Revert "Allow adding extra CFLAGS with a configure option."

This reverts commit 64b3cefbdbc0d6deef1dd3bcde890e273c323168.

Apparently, setting CFLAGS won't override the preset AM_CFLAGS
afterall. Not sure why this was giving me a problem before.

12 years agoRevert "Remove unnecessary use of arguments from AC_ARG_WITH([extra-cflags])."
Andres Mejia [Sat, 23 Feb 2013 02:40:07 +0000 (21:40 -0500)] 
Revert "Remove unnecessary use of arguments from AC_ARG_WITH([extra-cflags])."

This reverts commit 6a917dcd1378e2a50ece9f007e79a8a5058a59cb.

12 years agoRemove unnecessary use of arguments from AC_ARG_WITH([extra-cflags]).
Andres Mejia [Sat, 23 Feb 2013 01:10:08 +0000 (20:10 -0500)] 
Remove unnecessary use of arguments from AC_ARG_WITH([extra-cflags]).

12 years agoAllow adding extra CFLAGS with a configure option.
Andres Mejia [Sat, 23 Feb 2013 01:02:40 +0000 (20:02 -0500)] 
Allow adding extra CFLAGS with a configure option.
This is a convenience option to pass in extra CFLAGS without overriding other
CFLAGS.

12 years agoFix compile warning due to -Wcast-qual.
Andres Mejia [Sat, 23 Feb 2013 01:01:42 +0000 (20:01 -0500)] 
Fix compile warning due to -Wcast-qual.

12 years agoFix compiler warning from compiling with clang.
Andres Mejia [Fri, 22 Feb 2013 01:14:16 +0000 (20:14 -0500)] 
Fix compiler warning from compiling with clang.
Assigning from a read-only variable to a regular variable will issue
a warning from clang.