]> git.ipfire.org Git - thirdparty/libarchive.git/log
thirdparty/libarchive.git
8 years agoWrite xattr as LIBARCHIVE.xattr and/or SCHILY.xattr 691/head
Stefan Berger [Fri, 6 May 2016 20:24:27 +0000 (16:24 -0400)] 
Write xattr as LIBARCHIVE.xattr and/or SCHILY.xattr

Introduce flags to write extended attributes either with the prefix
LIBARCHIVE.xattr or SCHIL.xattr. For the existing bsdtar formats
'pax' and 'posix' we now choose to write both. This enables backwards
compatibility and allow us to exchange tar files carrying extended
attributes with GNU tar.

8 years agoIntroduce add_pax_attr_binary and have add_pax_attr call it
Stefan Berger [Fri, 6 May 2016 18:34:01 +0000 (14:34 -0400)] 
Introduce add_pax_attr_binary and have add_pax_attr call it

To prepare for being able to write binary values in the PAX extended
header, introduce add_pax_attr_binary and have add_pax_attr call it
by determining the length of the string being passed.

8 years agoIntroduce archive_array_append to append a raw array to an archive_string
Stefan Berger [Fri, 6 May 2016 19:20:30 +0000 (15:20 -0400)] 
Introduce archive_array_append to append a raw array to an archive_string

Introduce archive_array_append to append a raw array to an archive_string.
We need this for binary values in the PAX header.

We can append arbitray data to the archive_string since its string append
operations simply append at the end pointer rather than walking the string
and appending at the zero byte.

8 years agoAdd test case for SCHILY.xattr support
Stefan Berger [Fri, 6 May 2016 17:51:56 +0000 (13:51 -0400)] 
Add test case for SCHILY.xattr support

Add a test case for the SCHILY.xattr support. We test whether the
provided archive's PAX header is parsed correctly.

Signed-off-by: Stefan Berger <stefanb@linux.vnet.ibm.com>
8 years agoAdd support for extracting SCHIL.xattr extended attributes
Stefan Berger [Mon, 25 Apr 2016 14:41:01 +0000 (10:41 -0400)] 
Add support for extracting SCHIL.xattr extended attributes

This patch adds support for extracting SCHIL.xattr extended attributes
found in the PAX extended header. Since some of the attributes found
there can be binary data, we extend the parser for support of binary data.

One example for an attribute with binary data is SCHILY.xattr.security.ima,
which contains a digital signature.

Signed-off-by: Stefan Berger <stefanb@linux.vnet.ibm.com>
8 years agoFix build on Solaris-based systems
Martin Matuska [Mon, 2 Jan 2017 15:51:00 +0000 (16:51 +0100)] 
Fix build on Solaris-based systems

8 years agoUse __LA_DEPRECATED for functions deprecated in 379867e
Martin Matuska [Fri, 30 Dec 2016 22:44:27 +0000 (23:44 +0100)] 
Use __LA_DEPRECATED for functions deprecated in 379867e

Reported-By: Jamie Kenyon

8 years agoMerge pull request #851 from Tarsnap/spelling-upload
Martin Matuska [Fri, 30 Dec 2016 01:10:05 +0000 (02:10 +0100)] 
Merge pull request #851 from Tarsnap/spelling-upload

Spelling fixes

8 years agoMerge pull request #843 from yaneurabeya/cpio-coverity-fixes
Martin Matuska [Fri, 30 Dec 2016 00:30:13 +0000 (01:30 +0100)] 
Merge pull request #843 from yaneurabeya/cpio-coverity-fixes
Fix memory leak of struct archive_entry in cpio/cpio.c

8 years agoFix prototypes to match headers. From Thomas Klausner.
Joerg Sonnenberger [Thu, 29 Dec 2016 23:55:09 +0000 (00:55 +0100)] 
Fix prototypes to match headers. From Thomas Klausner.

8 years agoFix style typo in tar.5
Martin Matuska [Thu, 29 Dec 2016 01:04:04 +0000 (02:04 +0100)] 
Fix style typo in tar.5

8 years agoSpelling fixes 851/head
Graham Percival [Wed, 28 Dec 2016 04:32:44 +0000 (20:32 -0800)] 
Spelling fixes

Sponsored by: Tarsnap Backup Inc.

8 years agoExtend NFSv4 ACL support in libarchive
Martin Matuska [Tue, 27 Dec 2016 22:21:39 +0000 (23:21 +0100)] 
Extend NFSv4 ACL support in libarchive
Break up, simplify and improve OS-independent ACL code
Add star-compatible NFSv4 ACL read/write support to pax (SCHILY.acl.ace)
Remap ARCHIVE_ACL_ENTRY_STYLE_* flags

New functions:
  archive_entry_acl_from_text()
  archive_entry_acl_from_text_w()
  archive_entry_acl_to_text()
  archive_entry_acl_to_text_w()

Deprecated functions:
  archive_entry_acl_text()
  archive_entry_acl_text_w()

Closes #771

8 years agoarchive_strncat_l(): allocate and do not convert if length == 0
Martin Matuska [Mon, 26 Dec 2016 21:23:24 +0000 (22:23 +0100)] 
archive_strncat_l(): allocate and do not convert if length == 0

This ensures e.g. that archive_mstring_copy_mbs_len_l() does not set
aes_set = AES_SET_MBS with aes_mbs.s == NULL.

Resolves possible null-pointer dereference reported by OSS-Fuzz.

Reported-By: OSS-Fuzz issue 286

8 years agoFilter options need to be freed in all liblzma versions
Martin Matuska [Sun, 25 Dec 2016 02:02:57 +0000 (03:02 +0100)] 
Filter options need to be freed in all liblzma versions

This reverts commit 00f4bd830f6c2c83cf11f4f4f7db06b4b238cb71,
reversing changes made to 6070852668fe4881d1d308983f5c87153235feff.
This reverts commit b5ffcc0bd7f0f39102863d5c96ae91f02c74aaae.

Reported-By: OSS-Fuzz 232

8 years agoMerge pull request #850 from Lekensteyn/zip-directory-mode
Tim Kientzle [Fri, 23 Dec 2016 18:19:05 +0000 (10:19 -0800)] 
Merge pull request #850 from Lekensteyn/zip-directory-mode

Issue #822: Try harder to detect directories in zip archives

8 years agoIssue #822: Try harder to detect directories in zip archives 850/head
Peter Wu [Fri, 23 Dec 2016 11:45:43 +0000 (12:45 +0100)] 
Issue #822: Try harder to detect directories in zip archives

Assume that anything with a trailing slash is a directory. This avoids
creating regular files when a directory is expected and could occur
when the External File Attributes (EFA) field in the Central Directory
contains bogus values:

 - Jar file: observed to have OS MS-DOS (0) and EFA 0.
 - dex2jar-2.0.zip: observed to have OS Unix (3), but EFA 0xffff0010.
   After this patch, bsdtar tv still shows mode drwsrwsrwt, but at least
   it successfully creates a directory instead of a regular file.

A test case has been added for the first case (based on
test_read_format_zip_nofiletype).

8 years agoSpelling fixes (#846)
Graham Percival [Tue, 20 Dec 2016 22:11:29 +0000 (14:11 -0800)] 
Spelling fixes (#846)

Sponsored by: Tarsnap Backup Inc.

8 years agoCompute correct size for buffer. Avoid recomputation of lengths.
Joerg Sonnenberger [Sun, 18 Dec 2016 10:55:30 +0000 (11:55 +0100)] 
Compute correct size for buffer. Avoid recomputation of lengths.

Based on Coverity reports from pull request #844.

8 years agoAllocate memory precisely. Avoid recomputions of sizes.
Joerg Sonnenberger [Sun, 18 Dec 2016 10:50:10 +0000 (11:50 +0100)] 
Allocate memory precisely. Avoid recomputions of sizes.

Based on Coverity report from pull request #844.

8 years agoTravis CI: use custom test driver, don't build with gcc on OSX
Martin Matuska [Thu, 15 Dec 2016 11:06:18 +0000 (12:06 +0100)] 
Travis CI: use custom test driver, don't build with gcc on OSX

8 years agoTravis CI: split build and test into two steps
Martin Matuska [Thu, 15 Dec 2016 00:16:17 +0000 (01:16 +0100)] 
Travis CI: split build and test into two steps

8 years agoAdd OSx to Travis CI build
Martin Matuska [Wed, 14 Dec 2016 13:00:29 +0000 (14:00 +0100)] 
Add OSx to Travis CI build

8 years agoDon't check for duplicates when adding NFSv4 ACL entries
Martin Matuska [Tue, 13 Dec 2016 12:35:27 +0000 (13:35 +0100)] 
Don't check for duplicates when adding NFSv4 ACL entries

8 years agoDon't leak `entry` in `file_to_archive` if archive_read_disk_entry_from_file 843/head
Ngie Cooper [Tue, 13 Dec 2016 03:32:32 +0000 (19:32 -0800)] 
Don't leak `entry` in `file_to_archive` if archive_read_disk_entry_from_file
fails with `ARCHIVE_FAILED`

This greatly reduces memory usage when the call fails, e.g. a file cannot be
stat'ed

Confirmed with the following snippet:

% d=/tmp/cpio_test
% mkdir -p $d
% while : ; do echo /nonexistent ; done | cpio -dump $d 2>/dev/null

Reported by: Coverity
CID: 1016757

8 years agoMerge pull request #807 from csanchezdll/issue696
Tim Kientzle [Sun, 11 Dec 2016 17:09:21 +0000 (09:09 -0800)] 
Merge pull request #807 from csanchezdll/issue696

Issue 696: ppc64le mache ckech failure

8 years agoMerge pull request #818 from JPeterMugaas/cygwin-msys2-fixes
Tim Kientzle [Sun, 11 Dec 2016 17:08:14 +0000 (09:08 -0800)] 
Merge pull request #818 from JPeterMugaas/cygwin-msys2-fixes

Cygwin msys2 fixes

8 years agoMerge pull request #833 from Tarsnap/spelling-upload
Tim Kientzle [Sun, 11 Dec 2016 17:06:10 +0000 (09:06 -0800)] 
Merge pull request #833 from Tarsnap/spelling-upload

Spelling upload

8 years agoMerge pull request #839 from yaneurabeya/tar-test-coverity-fixes
Tim Kientzle [Sun, 11 Dec 2016 17:04:53 +0000 (09:04 -0800)] 
Merge pull request #839 from yaneurabeya/tar-test-coverity-fixes

tar/test coverity fixes

8 years agoMerge pull request #840 from yaneurabeya/libarchive-test-coverity-fixes
Tim Kientzle [Sun, 11 Dec 2016 17:02:27 +0000 (09:02 -0800)] 
Merge pull request #840 from yaneurabeya/libarchive-test-coverity-fixes

libarchive/test coverity fixes

8 years agoFix memory management issues 840/head
Ngie Cooper [Sun, 11 Dec 2016 02:32:11 +0000 (18:32 -0800)] 
Fix memory management issues

1. Assert that `f` isn't NULL to strengthen the guarantee that
   it's valid.
2. Assert that `rawimage` isn't NULL to strengthen the guarantee
   that it's valid.
3. Do not leak `tmp`
4. Free `rawimage` in all instances; NULL out the value to avoid
   double-free'ing it by accident

Reported by: Coverity
CID: 1331454 [1], 1361651 [2], 1361669 [3], 1361679 [4]

8 years ago- Only allocate `mine` when level == 1 to clarify its lifetime and
Ngie Cooper [Sun, 11 Dec 2016 02:17:01 +0000 (18:17 -0800)] 
- Only allocate `mine` when level == 1 to clarify its lifetime and
  leak the value less often.
- Only free mine->copy_buff when mine != NULL to avoid segfaults if
  memory_read_close(..) is called with client_data == NULL.

This should either address or mitigate the issue reported with Coverity
(CID # 1331663)

8 years agoFix several coverity issues with test_read_append_filter_wrong_program
Ngie Cooper [Sun, 11 Dec 2016 01:59:03 +0000 (17:59 -0800)] 
Fix several coverity issues with test_read_append_filter_wrong_program

1. Ignore errors from fsetpos to mute complaint from Coverity
2. Make sure the first dup2 succeeds to quell complaints from Coverity
   about negative values being passed into the subsequent dup2 call.
3. Unconditionally close fd [3]. Although it's unlikely for freopen to
   fail, it can happen.. closing fd shouldn't be contingent on freopen's
   success.

CID: 1364318 [1], 1364322 [2], 1365233 [3]

8 years agoFree `m` before returning after allocating it
Ngie Cooper [Sun, 11 Dec 2016 01:49:55 +0000 (17:49 -0800)] 
Free `m` before returning after allocating it

Reported by: Coverity
CID: 1331667

8 years agoFree `testprog_ustar` when done 839/head
Ngie Cooper [Sun, 11 Dec 2016 00:38:02 +0000 (16:38 -0800)] 
Free `testprog_ustar` when done

Reported by: Coverity
CID: 1355330

8 years agoFree p (the memory allocated via slurpfile) when done with the contents
Ngie Cooper [Sun, 11 Dec 2016 00:34:51 +0000 (16:34 -0800)] 
Free p (the memory allocated via slurpfile) when done with the contents

Reported by: Coverity
CID: 1331627-133163013553321331634-133164513316471355331

8 years agoMerge pull request #838 from yaneurabeya/cpio-test-coverity-fixes
Tim Kientzle [Sun, 11 Dec 2016 00:51:21 +0000 (16:51 -0800)] 
Merge pull request #838 from yaneurabeya/cpio-test-coverity-fixes

Free p (the memory allocated via slurpfile) when done with the contents

8 years agoDon't leak memory if returning from
Ngie Cooper [Sun, 11 Dec 2016 00:32:16 +0000 (16:32 -0800)] 
Don't leak memory if returning from
assertion_file_contains_lines_any_order(..) early

Free memory consistently at the bottom of the function

Reported by: Coverity
CID: 1331678

8 years agoDon't leak the file descriptor pointed to by `in` if the first call to
Ngie Cooper [Sun, 11 Dec 2016 00:24:35 +0000 (16:24 -0800)] 
Don't leak the file descriptor pointed to by `in` if the first call to
fgets fails.

Reported by: Coverity
CID: 1331677

8 years agoDon't overrun `tmpdir` buffer with sprintf
Ngie Cooper [Sun, 11 Dec 2016 00:22:10 +0000 (16:22 -0800)] 
Don't overrun `tmpdir` buffer with sprintf

If progname is sufficiently large enough, it would overflow the `tmpdir`
buffer, causing an illegal memory access

Reported by: Coverity
CID: 1331594

8 years agoIncrease the size of buff by 1 and adjust the readlink(2) call to
Ngie Cooper [Sun, 11 Dec 2016 00:15:18 +0000 (16:15 -0800)] 
Increase the size of buff by 1 and adjust the readlink(2) call to
subtract the buffer len by 1 to account for the needed space for a
NUL terminator, as readlink isn't guaranteed to provide one

Reported by: Coverity
CID: 13312931332105

8 years agoFree p (the memory allocated via slurpfile) when done with the contents 838/head
Ngie Cooper [Sat, 10 Dec 2016 23:41:58 +0000 (15:41 -0800)] 
Free p (the memory allocated via slurpfile) when done with the contents

Reported by: Coverity
CID: 1331631133163213316331331646

8 years agoIssue #837: Fix iteration over the available error codes
Tim Kientzle [Fri, 9 Dec 2016 05:56:34 +0000 (21:56 -0800)] 
Issue #837: Fix iteration over the available error codes

8 years agoSpelling fix in "struct tree{}" code 833/head
Graham Percival [Thu, 8 Dec 2016 17:46:33 +0000 (09:46 -0800)] 
Spelling fix in "struct tree{}" code

Sponsored by: Tarsnap Backup Inc.

8 years agoSpelling fixes
Graham Percival [Thu, 8 Dec 2016 17:46:25 +0000 (09:46 -0800)] 
Spelling fixes

Sponsored by: Tarsnap Backup Inc.

8 years agoDo not read beyond strtab table size in _ar_read_header()
Martin Matuska [Thu, 8 Dec 2016 01:45:41 +0000 (02:45 +0100)] 
Do not read beyond strtab table size in _ar_read_header()

Reported-by: OSS-Fuzz issue 237

8 years agoClose filters before freeing
Martin Matuska [Wed, 7 Dec 2016 11:14:25 +0000 (12:14 +0100)] 
Close filters before freeing

Plugs memory leak of allocated filter buffers if archive_read_free()
is called and archive state is ARCHIVE_STATE_FATAL.

Reported-by: OSS-Fuzz issue 227, 230, 239
8 years agoCheck for EVP_CIPHER_CTX_new failure (#836)
Brad King [Tue, 6 Dec 2016 16:35:14 +0000 (11:35 -0500)] 
Check for EVP_CIPHER_CTX_new failure (#836)

If this OpenSSL function fails to allocate memory it returns NULL.

8 years agoReplace malloc + memset with calloc.
Joerg Sonnenberger [Tue, 6 Dec 2016 14:58:03 +0000 (15:58 +0100)] 
Replace malloc + memset with calloc.

8 years agoSimplify by using strdup. Check for allocation failure.
Joerg Sonnenberger [Tue, 6 Dec 2016 14:38:09 +0000 (15:38 +0100)] 
Simplify by using strdup. Check for allocation failure.

8 years agoExplicitly free archive to reduce valgrind noise.
Joerg Sonnenberger [Tue, 6 Dec 2016 14:23:26 +0000 (15:23 +0100)] 
Explicitly free archive to reduce valgrind noise.

8 years agoDon't recommend deprecated functions.
Joerg Sonnenberger [Tue, 6 Dec 2016 14:22:29 +0000 (15:22 +0100)] 
Don't recommend deprecated functions.

8 years agoMerge branch 'master' of github.com:libarchive/libarchive
Joerg Sonnenberger [Tue, 6 Dec 2016 14:09:41 +0000 (15:09 +0100)] 
Merge branch 'master' of github.com:libarchive/libarchive

8 years agoMerge branch 'openssl-1.1'
Brad King [Mon, 5 Dec 2016 16:17:46 +0000 (11:17 -0500)] 
Merge branch 'openssl-1.1'

Pull-request: #826

8 years agoAdd more explanation comments to validate_number_field()
Martin Matuska [Mon, 5 Dec 2016 15:24:54 +0000 (16:24 +0100)] 
Add more explanation comments to validate_number_field()

8 years agoRelax sanity checks of number fields in tar header even more.
Martin Matuska [Mon, 5 Dec 2016 00:05:12 +0000 (01:05 +0100)] 
Relax sanity checks of number fields in tar header even more.

This fixes reading tar archives created by plexus-archiver (used e.g. by
maven-assembly-plugin to create source and binary tar distributions)
version 2.6.2 and lower. These archives may have entries with uid and gid
header fields filled with spaces without any octal digits.

Fixes #832

8 years agoFix hang in uudecode_filter_read()
Martin Matuska [Sat, 3 Dec 2016 01:16:18 +0000 (02:16 +0100)] 
Fix hang in uudecode_filter_read()

Reported-by: OSS-Fuzz issue 16
8 years agoSpelling fixes (#831)
Graham Percival [Sat, 3 Dec 2016 23:00:40 +0000 (15:00 -0800)] 
Spelling fixes (#831)

Sponsored by: Tarsnap Backup Inc.

8 years agoReject an 'ar' filename table larger than 1GB or a filename larger than 1MB.
Tim Kientzle [Sat, 3 Dec 2016 07:41:52 +0000 (23:41 -0800)] 
Reject an 'ar' filename table larger than 1GB or a filename larger than 1MB.

Suggested by issue 220 from OSS-Fuzz project.

8 years agoDramatically simplify loop and avoid a read-beyond-buffer issue.
Joerg Sonnenberger [Fri, 2 Dec 2016 11:00:28 +0000 (12:00 +0100)] 
Dramatically simplify loop and avoid a read-beyond-buffer issue.

Triggered by OSS-fuzz reports.

8 years agoFix heap buffer overflow in uudecode_bidder_bid()
Martin Matuska [Fri, 2 Dec 2016 09:08:02 +0000 (10:08 +0100)] 
Fix heap buffer overflow in uudecode_bidder_bid()

Reported-by: OSS-Fuzz issue 139, 145, 152
8 years agoRework the valid_number_field test function to be more
Tim Kientzle [Fri, 2 Dec 2016 04:09:59 +0000 (20:09 -0800)] 
Rework the valid_number_field test function to be more
lenient.  There are an enormous number of tar writing
programs, many which don't quite follow the specs.

Note:  I don't think I recall seeing any that left
number fields with trailing garbage; I may be wrong
about that, in which case, this would have to stop
at the first NUL (after the first octal character).

8 years agoReread the CAB header skipping the self-extracting binary code.
Joerg Sonnenberger [Thu, 1 Dec 2016 18:56:43 +0000 (19:56 +0100)] 
Reread the CAB header skipping the self-extracting binary code.

Fixes https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=15 as found
by the "OSS-Fuzz" project.

8 years agoRestore compatibility with Perl Archive::Tar that was broken with #825
Martin Matuska [Thu, 1 Dec 2016 14:58:06 +0000 (15:58 +0100)] 
Restore compatibility with Perl Archive::Tar that was broken with #825

8 years agoSpelling fixes (#830)
Graham Percival [Wed, 30 Nov 2016 21:46:10 +0000 (13:46 -0800)] 
Spelling fixes (#830)

* Spelling: previos -> previous

Sponsored by: Tarsnap Backup Inc.

* Spelling: Preparre -> Prepare

Sponsored by: Tarsnap Backup Inc.

* Spelling: Invalide -> Invalid

Sponsored by: Tarsnap Backup Inc.

* Spelling: leagal -> legal

Sponsored by: Tarsnap Backup Inc.

* Spelling: lengthe -> length

Sponsored by: Tarsnap Backup Inc.

* Spelling: cotents -> contents

Sponsored by: Tarsnap Backup Inc.

* Spelling: travesal -> traversal

Sponsored by: Tarsnap Backup Inc.

* Spelling: functinos -> functions

Sponsored by: Tarsnap Backup Inc.

* Spelling: particluar -> particular

Sponsored by: Tarsnap Backup Inc.

* Spelling: uncapable -> incapable

Sponsored by: Tarsnap Backup Inc.

8 years agoMerge pull request #819 from andrewgregory/mtree-hashtable
Martin Matuška [Wed, 30 Nov 2016 15:45:48 +0000 (16:45 +0100)] 
Merge pull request #819 from andrewgregory/mtree-hashtable

mtree: use hash table for duplicate entry search

8 years agoAdd test archives from #825 to Makefile.am
Martin Matuska [Tue, 29 Nov 2016 21:59:19 +0000 (22:59 +0100)] 
Add test archives from #825 to Makefile.am

8 years agoFix extracting hardlinks over symlinks
Martin Matuska [Tue, 29 Nov 2016 15:55:41 +0000 (16:55 +0100)] 
Fix extracting hardlinks over symlinks

Closes #821

8 years agoarchive_write_disk_posix.c: make *_fsobj functions more readable
Martin Matuska [Tue, 29 Nov 2016 15:47:37 +0000 (16:47 +0100)] 
archive_write_disk_posix.c: make *_fsobj functions more readable

8 years agoStyle fixes in archive_write_disk_posix.c
Martin Matuska [Tue, 29 Nov 2016 14:08:13 +0000 (15:08 +0100)] 
Style fixes in archive_write_disk_posix.c

8 years agoAdd archive_entry_acl_types() to check ACL types in an entry's ACL
Martin Matuska [Wed, 23 Nov 2016 23:17:17 +0000 (00:17 +0100)] 
Add archive_entry_acl_types() to check ACL types in an entry's ACL

8 years agoMerge pull request #825 from josusky/master
Tim Kientzle [Wed, 23 Nov 2016 21:54:56 +0000 (13:54 -0800)] 
Merge pull request #825 from josusky/master

Add sanity check of tar "uid, "gid" and "mtime" fields

8 years agoAllow tar header fields without null terminator 825/head
Jan Osusky [Wed, 23 Nov 2016 19:24:38 +0000 (20:24 +0100)] 
Allow tar header fields without null terminator

The "archive_read_format_tar_bid" and related "validate_number_field"
were revisited to allow one more non-standard way of coding UID/GID
and similar number fields in the tar header.
Modified "test_compat_gtar" to verify reading of such value.

8 years agoAdd missing check for acl_is_trivial_np() to configure.ac
Martin Matuska [Wed, 23 Nov 2016 16:52:03 +0000 (17:52 +0100)] 
Add missing check for acl_is_trivial_np() to configure.ac

8 years agoReset acl_types in archive_acl_clear()
Martin Matuska [Wed, 23 Nov 2016 15:45:47 +0000 (16:45 +0100)] 
Reset acl_types in archive_acl_clear()

8 years agoAdd test of GNU tar with GID greater 10000000 octal
Jan Osusky [Tue, 22 Nov 2016 17:29:17 +0000 (18:29 +0100)] 
Add test of GNU tar with GID greater 10000000 octal

GNU tar encodes such field as base256 (raw binary).

8 years agoAdd test of raw file which fooled tar
Jan Osusky [Tue, 22 Nov 2016 17:17:31 +0000 (18:17 +0100)] 
Add test of raw file which fooled tar

Added test with raw file (truncated to 4kB) which was mis-detected
as tar and caused quite an issue. The file was originally compressed
that's why any libarchive functionality was used on it but the
key issue was the similarity of the raw data to a tar file header.
The data is a BUFR bulletin in WMO FTP file format.

8 years agoMake sanity check of UID/GID/... fields compatible GNU TAR
Jan Osusky [Tue, 22 Nov 2016 15:19:25 +0000 (16:19 +0100)] 
Make sanity check of UID/GID/... fields compatible GNU TAR

The GNU tar uses a nasty trick to overcome size limitation of certain fields.
If the value is reasonable it uses octal numbers but if the value is too big,
e.g. 2097152 (10000000 octal) for UID, then it switches to base265 encoding
(i.e. raw binary representation of the corresponding integer).
Now the sanity check in "archive_read_format_tar_bid" uses helper function
validate_number_field() which validates what can be validated.

8 years agoAdd support for building with OpenSSL 1.1 826/head
Tomas Mraz [Thu, 17 Nov 2016 20:44:44 +0000 (15:44 -0500)] 
Add support for building with OpenSSL 1.1

OpenSSL 1.1 made some CTX structures opaque.  Port our code to use the
structures only through pointers via OpenSSL 1.1 APIs.  Use our adaption
layer to make this work with OpenSSL 1.0 and below.

Closes: #810
Patch-from: https://bugzilla.redhat.com/1383744

8 years agoAdd infrastructure to adapt between OpenSSL 1.1 and older versions
Brad King [Thu, 17 Nov 2016 20:26:41 +0000 (15:26 -0500)] 
Add infrastructure to adapt between OpenSSL 1.1 and older versions

Add private forwarding headers for `openssl/{evp,hmac}.h` to give us a
central place to add adaptation code to work across multiple
incompatible OpenSSL versions.  Provide compatibility implementations of
some OpenSSL 1.1 APIs when using older OpenSSL versions.

8 years agoFix return code of ci_build.sh if tests fail with autotools
Martin Matuska [Thu, 17 Nov 2016 23:17:31 +0000 (00:17 +0100)] 
Fix return code of ci_build.sh if tests fail with autotools

8 years agoDo not treat user or group ACL entries without an id as identical
Martin Matuska [Mon, 14 Nov 2016 21:09:54 +0000 (22:09 +0100)] 
Do not treat user or group ACL entries without an id as identical
Add compat test for star archives with POSIX.1e ACLs

8 years agoAdd sanity check of tar "uid, "gid" and "mtime" fields
Jan Osusky [Mon, 14 Nov 2016 10:24:35 +0000 (11:24 +0100)] 
Add sanity check of tar "uid, "gid" and "mtime" fields

Sometimes a bz2 file is identified as tar.bz2, i.e. a chunk of
raw data may look like a tar header (metadata block).
To reduce chance of such false positive, the format of uid, gid
and mtime field is checked. This fields are expected to contain
octal numbers. In fact, also space and '\0' are allowed - perhaps
I am too liberal.

8 years agoci_build: be more verbose on test errors if building with autotools
Martin Matuska [Mon, 7 Nov 2016 14:52:36 +0000 (15:52 +0100)] 
ci_build: be more verbose on test errors if building with autotools

8 years agoUnbreak build with Linux kernels older than 3.8
Martin Matuska [Mon, 7 Nov 2016 14:38:30 +0000 (15:38 +0100)] 
Unbreak build with Linux kernels older than 3.8

8 years agoSupport SEEK_HOLE under Linux, fallback to FIEMAP
Martin Matuska [Wed, 26 Oct 2016 21:18:37 +0000 (23:18 +0200)] 
Support SEEK_HOLE under Linux, fallback to FIEMAP

Closes #814

8 years agomtree: use hash table for duplicate entry search 819/head
Andrew Gregory [Tue, 1 Nov 2016 16:42:14 +0000 (12:42 -0400)] 
mtree: use hash table for duplicate entry search

Because mtree combines multiple non-adjacent entries for the same file,
parse_file() has to compare every entry to every other entry.  For large
mtree files, this results in extremely long parse times.  By breaking
the entries down into a hash table, the number of comparisons required
can be drastically reduced.  The hash function was taken directly from
the standard user/group lookup code.

8 years agoAddl lzo2 to Travis CI builds (lz4 on Ubuntu 14.04 is unsupported)
Martin Matuska [Tue, 1 Nov 2016 10:07:56 +0000 (11:07 +0100)] 
Addl lzo2 to Travis CI builds (lz4 on Ubuntu 14.04 is unsupported)

8 years agoAdd libmzmadec removal to NEWS
Martin Matuska [Tue, 1 Nov 2016 10:07:25 +0000 (11:07 +0100)] 
Add libmzmadec removal to NEWS

8 years agoadd entries for msys 818/head
J. Peter Mugaas [Tue, 1 Nov 2016 11:30:25 +0000 (07:30 -0400)] 
add entries for msys

Add entries for msys2.  This is part of libarchive-3.2.0-msys2.patch

8 years agoFix cygwin/msys compile errors with cleanup_pathname_win
J. Peter Mugaas [Tue, 1 Nov 2016 07:26:00 +0000 (03:26 -0400)] 
Fix cygwin/msys compile errors with cleanup_pathname_win

8 years agoMerge pull request #809 from praiskup/distribute-readme-md
Tim Kientzle [Sat, 29 Oct 2016 05:10:08 +0000 (22:10 -0700)] 
Merge pull request #809 from praiskup/distribute-readme-md

distribute README.md

8 years agoRemove support for liblzmadec and use FindLibLZMA 806/head
Martin Matuska [Mon, 17 Oct 2016 11:02:21 +0000 (13:02 +0200)] 
Remove support for liblzmadec and use FindLibLZMA

Closes #806

8 years agolibarchive 3.3 development, restore DEV_CFLAGS
Martin Matuska [Tue, 25 Oct 2016 22:02:29 +0000 (00:02 +0200)] 
libarchive 3.3 development, restore DEV_CFLAGS

8 years agodistribute README.md 809/head
Pavel Raiskup [Tue, 25 Oct 2016 12:30:31 +0000 (14:30 +0200)] 
distribute README.md

This issue happened because 'foreign' automake option is enabled,
and the file README was renamed as README.md (not included
automatically by automake).

8 years agoAdd missing define to libarchive/config_freebsd.h
Martin Matuska [Mon, 24 Oct 2016 14:04:37 +0000 (16:04 +0200)] 
Add missing define to libarchive/config_freebsd.h

8 years agoLibarchive 3.2.2 v3.2.2
Tim Kientzle [Mon, 24 Oct 2016 03:37:27 +0000 (20:37 -0700)] 
Libarchive 3.2.2

8 years agoClarify some skipping messages
Tim Kientzle [Mon, 24 Oct 2016 03:10:57 +0000 (20:10 -0700)] 
Clarify some skipping messages

8 years agoSkip gzip format check when both zlib and gzip are missing
Tim Kientzle [Mon, 24 Oct 2016 03:10:30 +0000 (20:10 -0700)] 
Skip gzip format check when both zlib and gzip are missing

8 years agoDo not try to redirect stderr on Windows
Tim Kientzle [Sun, 23 Oct 2016 23:24:00 +0000 (16:24 -0700)] 
Do not try to redirect stderr on Windows