...
 
Commits (437)
As libarchive requires large-file support enabled under i386 on Linux
you must add the following to any of your own source files:
#define _FILE_OFFSET_BITS 64
Applications compiled under i386 on Linux without this option will
produce empty archives and corrupt output from archives when reading
them.
-- John Goerzen <jgoerzen@complete.org>, Thu, 5 Jun 2008 15:36:22 -0500
This diff is collapsed.
Source: libarchive
Priority: optional
Maintainer: Peter Pentchev <roam@debian.org>
Build-Depends: debhelper-compat (= 12),
pkg-config,
libbz2-dev,
liblz4-dev,
liblzma-dev,
libxml2-dev,
libzstd-dev,
zlib1g-dev,
libacl1-dev [!hurd-any],
libext2fs-dev,
libattr1-dev,
sharutils,
nettle-dev,
liblzo2-dev,
locales | locales-all
Standards-Version: 4.4.0
Section: libs
Homepage: https://www.libarchive.org/
Vcs-Browser: https://salsa.debian.org/debian/libarchive
Vcs-Git: https://salsa.debian.org/debian/libarchive.git
Rules-Requires-Root: no
Package: libarchive-dev
Section: libdevel
Architecture: any
Multi-Arch: same
Depends: libarchive13 (= ${binary:Version}), ${misc:Depends}
Description: Multi-format archive and compression library (development files)
The libarchive library provides a flexible interface for reading and writing
archives in various formats such as tar and cpio. libarchive also supports
reading and writing archives compressed using various compression filters such
as gzip and bzip2. The library is inherently stream-oriented; readers serially
iterate through the archive, writers serially add things to the archive.
.
Archive formats supported are:
.
* tar (read and write, including GNU extensions)
* pax (read and write, including GNU and star extensions)
* cpio (read and write, including odc and newc variants)
* iso9660 (read and write, including Joliet and Rockridge extensions, with
some limitations)
* zip (read only, with some limitations, uses zlib)
* mtree (read and write)
* shar (write only)
* ar (read and write, including BSD and GNU/SysV variants)
* empty (read only; in particular, note that no other format will accept an
empty file)
* raw (read only)
* xar (read only)
* rar (read only, with some limitations)
* 7zip (read and write, with some limitations)
.
Filters supported are:
.
* gzip (read and write, uses zlib)
* bzip2 (read and write, uses bzlib)
* compress (read and write, uses an internal implementation)
* uudecode (read only)
* separate command-line compressors with fixed-signature auto-detection
* xz and lzma (read and write using liblzma)
* zstandard (read and write using libzstd)
.
This package provides the files necessary for development with libarchive.
Package: libarchive13
Architecture: any
Multi-Arch: same
Depends: ${shlibs:Depends}, ${misc:Depends}
Suggests: lrzip
Description: Multi-format archive and compression library (shared library)
The libarchive library provides a flexible interface for reading and writing
archives in various formats such as tar and cpio. libarchive also supports
reading and writing archives compressed using various compression filters such
as gzip and bzip2. The library is inherently stream-oriented; readers serially
iterate through the archive, writers serially add things to the archive.
.
Archive formats supported are:
.
* tar (read and write, including GNU extensions)
* pax (read and write, including GNU and star extensions)
* cpio (read and write, including odc and newc variants)
* iso9660 (read and write, including Joliet and Rockridge extensions, with
some limitations)
* zip (read only, with some limitations, uses zlib)
* mtree (read and write)
* shar (write only)
* ar (read and write, including BSD and GNU/SysV variants)
* empty (read only; in particular, note that no other format will accept an
empty file)
* raw (read only)
* xar (read only)
* rar (read only, with some limitations)
* 7zip (read and write, with some limitations)
.
Filters supported are:
.
* gzip (read and write, uses zlib)
* bzip2 (read and write, uses bzlib)
* compress (read and write, uses an internal implementation)
* uudecode (read only)
* separate command-line compressors with fixed-signature auto-detection
* xz and lzma (read and write using liblzma)
* zstandard (read and write using libzstd)
.
This package provides the libarchive shared library.
Package: libarchive-tools
Architecture: any
Depends: libarchive13 (= ${binary:Version}), ${shlibs:Depends}, ${misc:Depends}
Section: utils
Breaks: bsdcpio (<< 3.2.1-2~), bsdtar (<< 3.2.1-2~)
Replaces: bsdcpio (<< 3.2.1-2~), bsdtar (<< 3.2.1-2~)
Description: FreeBSD implementations of 'tar' and 'cpio' and other archive tools
This package contains several command-line tools based on the libarchive
library.
.
The bsdtar program is the default system 'tar' program used on FreeBSD. bsdtar
uses the libarchive library as a backend which does all of the work for reading
and writing archives in various formats.
.
The bsdcpio program is the default system 'cpio' program used on FreeBSD.
bsdcpio uses the libarchive library as a backend which does all of the work for
reading and writing archives in various formats.
.
The bsdcat program reads archived data from files or from its standard input
and uses the libarchive library to decompresses it to its standard output.
It may be used for viewing the contents of archives or for passing it to other
tools for further processing.
This diff is collapsed.
[DEFAULT]
debian-branch = master
upstream-branch = upstream
pristine-tar = True
sign-tags = True
[buildpackage]
tarball-dir = ../tarballs/
export-dir = ../build-area/
[pq]
patch-numbers = False
[import-orig]
upstream-vcs-tag = v%(version)s
include:
- https://salsa.debian.org/salsa-ci-team/pipeline/raw/master/salsa-ci.yml
- https://salsa.debian.org/salsa-ci-team/pipeline/raw/master/pipeline-jobs.yml
usr/include
usr/lib/*/lib*.a
usr/lib/*/lib*.so
usr/lib/*/pkgconfig/*
debian/tmp/usr/share/man/man3/*
debian/tmp/usr/share/man/man5/*
usr/bin/bsdcat
usr/bin/bsdcpio
usr/bin/bsdtar
debian/tmp/usr/share/man/man1/bsdtar.1
debian/tmp/usr/share/man/man1/bsdcat.1
debian/tmp/usr/share/man/man1/bsdcpio.1
This diff is collapsed.
upstream-rar-use-after-free.patch
upstream-rar-uaf-test-eof.patch
upstream-rar-window-mask.patch
upstream-rar-window-test.patch
upstream-rar-filter-beyond.patch
upstream-archive-read-sparse.patch
upstream-archive-clean.patch
upstream-doc-7zip-zip.patch
upstream-open-without-openat.patch
upstream-lz4-uint32.patch
typos.patch
This diff is collapsed.
Description: archive_read_next_header2: clean old entry data
We need to clean old entry data in archive_read_next_header2 in Windows
and Posix disk readers to ensure consistent results. One possible
failure mode: sparse data from the previous entry is carried over to
next non-sparse file entry, causing it to be mishandled.
Origin: upstream, https://github.com/libarchive/libarchive/pull/1218/commits/ea9c2354bac56ec7fc9c9d613c1706bf13809962
Author: Dmitry Torokhov <dtor@chromium.org>
Last-Update: 2019-09-20
--- a/libarchive/archive_read_disk_posix.c
+++ b/libarchive/archive_read_disk_posix.c
@@ -1143,6 +1143,8 @@
t->entry_fd = -1;
}
+ archive_entry_clear(entry);
+
for (;;) {
r = next_entry(a, t, entry);
if (t->entry_fd >= 0) {
--- a/libarchive/archive_read_disk_windows.c
+++ b/libarchive/archive_read_disk_windows.c
@@ -1126,6 +1126,8 @@
t->entry_fh = INVALID_HANDLE_VALUE;
}
+ archive_entry_clear(entry);
+
while ((r = next_entry(a, t, entry)) == ARCHIVE_RETRY)
archive_entry_clear(entry);
Description: archive_read: fix handling of sparse files
If a file ends with a sparse "hole" that is larger than buffer supplied
to archive_read(), then archive_read() will return prematurely because
archive_read_data_block() will return ARHCIVE_EOF as there is no more
"real" data. We can fix that by not trying to refill data buffer until
we exhaust the hole range.
.
Fixes libarchive#1194
Origin: upstream, https://github.com/libarchive/libarchive/pull/1218/commits/aa48bfac0f4ede8a6a4dfa545ad91684b41a9285
Bug: https://github.com/libarchive/libarchive/issues/1194
Author: Dmitry Torokhov <dtor@chromium.org>
Last-Update: 2019-09-20
--- a/libarchive/archive_read.c
+++ b/libarchive/archive_read.c
@@ -844,7 +844,8 @@
dest = (char *)buff;
while (s > 0) {
- if (a->read_data_remaining == 0) {
+ if (a->read_data_offset == a->read_data_output_offset &&
+ a->read_data_remaining == 0) {
read_buf = a->read_data_block;
a->read_data_is_posix_read = 1;
a->read_data_requested = s;
Description: Update option documentation for 7zip and zip options.
Origin: upstream, https://github.com/libarchive/libarchive/commit/968178574f0ff1c45b65d844a40881725d86852b
Author: Joerg Sonnenberger <joerg@bec.de>
Last-Update: 2019-09-20
--- a/libarchive/archive_write_set_options.3
+++ b/libarchive/archive_write_set_options.3
@@ -24,7 +24,7 @@
.\"
.\" $FreeBSD$
.\"
-.Dd February 2, 2012
+.Dd July 27, 2019
.Dt ARCHIVE_WRITE_OPTIONS 3
.Os
.Sh NAME
@@ -398,6 +398,27 @@
This option can be provided multiple times to suppress compression
on many files.
.El
+.It Format 7zip
+.Bl -tag -compact -width indent
+.It Cm compression
+The value is one of
+.Dq store ,
+.Dq deflate ,
+.Dq bzip2 ,
+.Dq lzma1 ,
+.Dq lzma2
+or
+.Dq ppmd
+to indicate how the following entries should be compressed.
+Note that this setting is ignored for directories, symbolic links,
+and other special entries.
+.It Cm compression-level
+The value is interpreted as a decimal integer specifying the
+compression level.
+Values between 0 and 9 are supported.
+The interpretation of the compression level depends on the choosen
+compression method.
+.El
.It Format zip
.Bl -tag -compact -width indent
.It Cm compression
@@ -408,6 +429,15 @@
to indicate how the following entries should be compressed.
Note that this setting is ignored for directories, symbolic links,
and other special entries.
+.It Cm compression-level
+The value is interpreted as a decimal integer specifying the
+compression level.
+Values between 0 and 9 are supported.
+A compression level of 0 switches the compression method to
+.Dq store ,
+other values will enable
+.Dq deflate
+compression with the given level.
.It Cm experimental
This boolean option enables or disables experimental Zip features
that may not be compatible with other Zip implementations.
Description: archive_read_support_filter_lz4.c: use uint32_c for compressed
Origin: upstream, https://github.com/libarchive/libarchive/commit/57c8ea90e498f7eb3750248fdad0f6c4a49b60ae
Bug: https://github.com/libarchive/libarchive/issues/1237
Author: Martin Matuska <martin@matuska.org>
Last-Update: 2019-09-20
--- a/libarchive/archive_read_support_filter_lz4.c
+++ b/libarchive/archive_read_support_filter_lz4.c
@@ -674,7 +674,7 @@
lz4_filter_read_legacy_stream(struct archive_read_filter *self, const void **p)
{
struct private_data *state = (struct private_data *)self->data;
- int compressed;
+ uint32_t compressed;
const char *read_buf;
ssize_t ret;
Description: Correct invalid function call in la_opendirat()
Origin: upstream, https://github.com/libarchive/libarchive/commit/36c675a4722450f2ac0cb2a79d83e44af781d450
Bug: https://github.com/libarchive/libarchive/issues/1239
Author: Martin Matuska <martin@matuska.org>
Last-Update: 2019-09-20
--- a/libarchive/archive_write_disk_posix.c
+++ b/libarchive/archive_write_disk_posix.c
@@ -431,7 +431,7 @@
errno = ENOTSUP;
return (-1);
} else
- return (open(fd, path, flags));
+ return (open(path, flags));
#else
return (openat(fd, path, flags));
#endif
Description: RAR5 reader: fix ARM filter going beyond window buffer boundary
RAR5 uses filters in order to mutate data just before compression, to
achieve a better compression ratio. After decompression, this mutation
needs to be reversed by processing various filters that the compressor
uses.
.
One of such filters is an ARM executable file filter, which changes some
bytes in the input stream if the stream is recognized as an executable
file with ARM native code.
.
This commit fixes the situation when the decompressor using an ARM filter
was referencing a byte outside current window buffer. Such action is
invalid and can produce segmentation faults.
.
This commit also adds a test using OSSFuzz sample #15431.
Origin: upstream; https://github.com/libarchive/libarchive/pull/1217/commits/2331456dc1f83e6b20e656e69fa01b6e30302865
Author: Grzegorz Antoniak <ga@anadoxin.org>
Last-Update: 2019-09-20
--- a/Makefile.am
+++ b/Makefile.am
@@ -865,6 +865,7 @@
libarchive/test/test_read_format_rar5_symlink.rar.uu \
libarchive/test/test_read_format_rar5_truncated_huff.rar.uu \
libarchive/test/test_read_format_rar5_win32.rar.uu \
+ libarchive/test/test_read_format_rar5_arm_filter_on_window_boundary.rar.uu \
libarchive/test/test_read_format_raw.bufr.uu \
libarchive/test/test_read_format_raw.data.gz.uu \
libarchive/test/test_read_format_raw.data.Z.uu \
--- a/libarchive/archive_read_support_format_rar5.c
+++ b/libarchive/archive_read_support_format_rar5.c
@@ -623,9 +623,9 @@
for(i = 0; i < flt->block_length - 3; i += 4) {
uint8_t* b = &rar->cstate.window_buf[
(rar->cstate.solid_offset +
- flt->block_start + i) & rar->cstate.window_mask];
+ flt->block_start + i + 3) & rar->cstate.window_mask];
- if(b[3] == 0xEB) {
+ if(*b == 0xEB) {
/* 0xEB = ARM's BL (branch + link) instruction. */
offset = read_filter_data(rar,
(rar->cstate.solid_offset + flt->block_start + i) &
--- a/libarchive/test/test_read_format_rar5.c
+++ b/libarchive/test/test_read_format_rar5.c
@@ -1215,3 +1215,18 @@
EPILOGUE();
}
+
+DEFINE_TEST(test_read_format_rar5_arm_filter_on_window_boundary)
+{
+ char buf[4096];
+ PROLOGUE("test_read_format_rar5_arm_filter_on_window_boundary.rar");
+
+ /* Return codes of those calls are ignored, because this sample file
+ * is invalid. However, the unpacker shouldn't produce any SIGSEGV
+ * errors during processing. */
+
+ (void) archive_read_next_header(a, &ae);
+ while(0 != archive_read_data(a, buf, sizeof(buf))) {}
+
+ EPILOGUE();
+}
--- /dev/null
+++ b/libarchive/test/test_read_format_rar5_arm_filter_on_window_boundary.rar.uu
@@ -0,0 +1,9 @@
+begin 600 test_read_format_rar5_arm_filter_on_window_boundary.rar
+M4F%R(1H'`0"-[P+2``(''(`'`/[_(`#_!``"(0$``/X(TB`!'O___P@``/W_
+M_Q``_]U84%"0_P1LAFVQ9,S,M[$`20"#__\`_P#_`/G___!DSR0V2+$`20`Z
+M@R[_______\I:!<**-@P70D`KB1!<YOZFQ/___^<`^5L*0```/________\_
+M`0#__RE@%PHHV#!="0"N)$%S"```_?]84/7___]0D/\$;(9ML63,S/\R'Q\?
+M'Q\?'Q\?'Q\?'Q\?'[$`20"#__\`_P#_`/G___!DSR0V2+$`20`Z@R[_____
+0_Q\?'Q\?'Q\?'Q]5"E`*4```
+`
+end
Description: Add EOF test to test_read_format_rar_ppmd_use_after_free
and test_read_format_rar_ppmd_use_after_free2
Origin: upstream, https://github.com/libarchive/libarchive/commit/fa2f626ac0ebe0841370eadd3ffd69679258fa0a
Author: Martin Matuska <martin@matuska.org>
Last-Update: 2019-09-20
--- a/libarchive/test/test_read_format_rar.c
+++ b/libarchive/test/test_read_format_rar.c
@@ -3776,6 +3776,9 @@
assertA(ARCHIVE_OK == archive_read_next_header(a, &ae));
assertA(archive_read_data(a, buf, sizeof(buf)) <= 0);
+ /* Test EOF */
+ assertA(1 == archive_read_next_header(a, &ae));
+
assertEqualIntA(a, ARCHIVE_OK, archive_read_close(a));
assertEqualInt(ARCHIVE_OK, archive_read_free(a));
}
@@ -3799,6 +3802,9 @@
assertA(ARCHIVE_OK == archive_read_next_header(a, &ae));
assertA(archive_read_data(a, buf, sizeof(buf)) <= 0);
+ /* Test EOF */
+ assertA(1 == archive_read_next_header(a, &ae));
+
assertEqualIntA(a, ARCHIVE_OK, archive_read_close(a));
assertEqualInt(ARCHIVE_OK, archive_read_free(a));
}
Description: RAR reader: extend fix user after free
If read_data_compressed() returns ARCHIVE_FAILED, the caller is allowed
to continue with next archive headers. In addition to
rar->start_new_table=1 we need to set rar->ppmd_valid=0.
.
Reported by: OSS-Fuzz issue 15120
Origin: upstream, https://github.com/libarchive/libarchive/commit/cb76165ac5b091545c32d26483b0c0d7a2c47e4f
Author: Martin Matuska <martin@matuska.org>
Last-Update: 2019-09-20
--- a/Makefile.am
+++ b/Makefile.am
@@ -826,6 +826,7 @@
libarchive/test/test_read_format_rar_noeof.rar.uu \
libarchive/test/test_read_format_rar_ppmd_lzss_conversion.rar.uu \
libarchive/test/test_read_format_rar_ppmd_use_after_free.rar.uu \
+ libarchive/test/test_read_format_rar_ppmd_use_after_free2.rar.uu \
libarchive/test/test_read_format_rar_sfx.exe.uu \
libarchive/test/test_read_format_rar_subblock.rar.uu \
libarchive/test/test_read_format_rar_unicode.rar.uu \
--- a/libarchive/archive_read_support_format_rar.c
+++ b/libarchive/archive_read_support_format_rar.c
@@ -1027,6 +1027,7 @@
if (ret != ARCHIVE_OK && ret != ARCHIVE_WARN) {
__archive_ppmd7_functions.Ppmd7_Free(&rar->ppmd7_context);
rar->start_new_table = 1;
+ rar->ppmd_valid = 0;
}
break;
--- a/libarchive/test/test_read_format_rar.c
+++ b/libarchive/test/test_read_format_rar.c
@@ -3779,3 +3779,26 @@
assertEqualIntA(a, ARCHIVE_OK, archive_read_close(a));
assertEqualInt(ARCHIVE_OK, archive_read_free(a));
}
+
+DEFINE_TEST(test_read_format_rar_ppmd_use_after_free2)
+{
+ uint8_t buf[16];
+ const char* reffile = "test_read_format_rar_ppmd_use_after_free2.rar";
+
+ struct archive_entry *ae;
+ struct archive *a;
+
+ extract_reference_file(reffile);
+ assert((a = archive_read_new()) != NULL);
+ assertA(0 == archive_read_support_filter_all(a));
+ assertA(0 == archive_read_support_format_all(a));
+ assertA(0 == archive_read_open_filename(a, reffile, 10240));
+
+ assertA(ARCHIVE_OK == archive_read_next_header(a, &ae));
+ assertA(archive_read_data(a, buf, sizeof(buf)) <= 0);
+ assertA(ARCHIVE_OK == archive_read_next_header(a, &ae));
+ assertA(archive_read_data(a, buf, sizeof(buf)) <= 0);
+
+ assertEqualIntA(a, ARCHIVE_OK, archive_read_close(a));
+ assertEqualInt(ARCHIVE_OK, archive_read_free(a));
+}
--- /dev/null
+++ b/libarchive/test/test_read_format_rar_ppmd_use_after_free2.rar.uu
@@ -0,0 +1,10 @@
+begin 664 test_read_format_rar_ppmd_use_after_free2.rar
+M4F%R(1H'``1G=$Q24`!W````>U!+`P0Q`'#_J7\`+@TU'`#]`0`7__]"0D)"
+M+W5N)B8F)F=I9`UD#1T+``!"`````````&%R(1H'``3_________`F@`H2``
+M``"`P\/#2\/#P\/#P\/#P\-3PP"`P\/#PYZ>AYZ>GI[#4\,`@,/#`L,@(""=
+M("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@(/______
+M__\@("`@("`@("`@("`@("`@("`@("`@("`$9W1,4E``=P```'M02P,$,0!P
+M_ZE_`"X--1P`_0$`%___0D)"0B]U;B8F)B9G:60-9`T="P``0@````````!A
+0<B$:!P`$_________P)H````
+`
+end
This diff is collapsed.
Description: Add test_read_format_rar5_different_window_size.rar.uu to Makefile.am
Origin: upstream, https://github.com/libarchive/libarchive/commit/869cf8109217d4f9387fc9220b43871ddc9d1c0d
Author: Martin Matuska <martin@matuska.org>
Last-Update: 2019-09-20
--- a/Makefile.am
+++ b/Makefile.am
@@ -834,6 +834,7 @@
libarchive/test/test_read_format_rar5_arm.rar.uu \
libarchive/test/test_read_format_rar5_blake2.rar.uu \
libarchive/test/test_read_format_rar5_compressed.rar.uu \
+ libarchive/test/test_read_format_rar5_different_window_size.rar.uu \
libarchive/test/test_read_format_rar5_distance_overflow.rar.uu \
libarchive/test/test_read_format_rar5_extra_field_version.rar.uu \
libarchive/test/test_read_format_rar5_fileattr.rar.uu \
#!/usr/bin/make -f
# Aim for the top, adapt if anything should break on the buildds.
DEB_BUILD_MAINT_OPTIONS= hardening=+all
export DEB_BUILD_MAINT_OPTIONS
DEB_LDFLAGS_MAINT_APPEND= -Wl,--as-needed
export DEB_LDFLAGS_MAINT_APPEND
.PHONY: build
%:
dh $@
build:
dh $@
override_dh_auto_configure:
dh_auto_configure -- --without-openssl --with-nettle \
--enable-bsdtar=shared --enable-bsdcpio=shared \
--enable-bsdcat=shared
override_dh_autoreconf:
dh_autoreconf build/autogen.sh
override_dh_makeshlibs:
dh_makeshlibs -- -c4
override_dh_install:
find debian -name '*.la' -delete
dh_install
override_dh_missing:
dh_missing --fail-missing
override_dh_auto_test:
ifneq (,$(filter check,$(DEB_BUILD_OPTIONS)))
ifneq (,$(shell locale -a | grep en_US.utf8))
_VERBOSITY_LEVEL=1 dh_auto_test --parallel
else
mkdir -p tmp-locales
localedef -i /usr/share/i18n/locales/en_US -c -f UTF-8 \
-A /usr/share/locale/locale.alias tmp-locales/en_US.UTF-8
_VERBOSITY_LEVEL=1 LOCPATH=$(CURDIR)/tmp-locales dh_auto_test --parallel
rm -rf tmp-locales
endif
endif
override_dh_installchangelogs:
dh_installchangelogs
set -e; for p in $$(dh_listpackages); do \
install -m 644 NEWS debian/$$p/usr/share/doc/$$p/; \
done
abort-on-upstream-changes
unapply-patches
Tests: minitar
Depends: build-essential, file, libarchive-dev, pkg-config
Test-Command: adequate libarchive-dev libarchive13 libarchive-tools bsdtar bsdcpio
Depends: @, adequate
Features: test-name=adequate
Restrictions: superficial
#!/bin/sh
set -e
# autopkgtest check: Build and run the example minitar program against
# libarchive, to verify that the headers and pkg-config file are installed
# correctly and minitar works as expected.
# Author: Benjamin Drung <bdrung@ubuntu.com>
gcc -O2 -g -Wno-unused-result -o minitar examples/minitar/minitar.c $(pkg-config --cflags --libs libarchive)
# Create different tarballs
echo "Deadbeaf" > foo
echo "Compressing foo.tar..."
./minitar -cf foo.tar foo
echo "Compressing foo.tar.gz..."
./minitar -czf foo.tar.gz foo
echo "Compressing foo.tar.bz2..."
./minitar -cyf foo.tar.bz2 foo
# Test tarballs for correct mime type
echo "Testing mime type of foo.tar..."
test "$(file -b --mime-type foo.tar)" = "application/x-tar"
echo "Testing mime type of foo.tar.gz..."
test "$(file -b --mime-type foo.tar.gz)" = "application/gzip"
echo "Testing mime type of foo.tar.bz2..."
test "$(file -b --mime-type foo.tar.bz2)" = "application/x-bzip2"
# Test untar, too, for extracting.
gcc -O2 -g -Wno-unused-result -o untar examples/untar.c $(pkg-config --cflags --libs libarchive)
# Extract tarballs and compare content
mv foo foo.orig
echo "Extracting foo.tar..."
./minitar -xf foo.tar
cmp foo foo.orig
rm foo
./untar -xf foo.tar
cmp foo foo.orig
rm foo foo.tar
echo "Extracting foo.tar.gz..."
./minitar -xf foo.tar.gz
cmp foo foo.orig
rm foo foo.tar.gz
echo "Extracting foo.tar.bz2..."
./minitar -xf foo.tar.bz2
cmp foo foo.orig
rm foo foo.tar.bz2
# Clean-up
rm foo.orig minitar untar
Name: libarchive
Bug-Submit: https://github.com/libarchive/libarchive/issues
Contact: https://groups.google.com/group/libarchive-discuss
FAQ: https://github.com/libarchive/libarchive/wiki
Security-Contact: Tim Kientzle <kientzle@FreeBSD.org>
Repository: https://github.com/libarchive/libarchive.git
Repository-Browse: https://github.com/libarchive/libarchive
CPE: cpe:/a:freebsd:libarchive cpe:/a:libarchive:libarchive
-----BEGIN PGP PUBLIC KEY BLOCK-----
mQINBFhUn/MBEACxbpg9G9KKuROKDLgugNKr6c4lrp3lTvx4XwuA+EGLCC/tBwOE
8ak5f21g/QogUnYkhpuI3XLqKGsuWCDFQHB3Wk1dUYE/7wk4Um4DyHrMncyUmAHY
fy9OZ+ZVYDBcodxlBDtVHKG0lzNhTs/HNO4Ep6Ja/37GsbEJRqz0XRgqM6l7GYwC
iltTaU3nJuGDeWtRsaZO5Xqm36NoXNTlR4MYy1m+ddAZZexgonNX33MNaATlkcJg
o1HIr7fUt2JcLjrM0LVd5BAbLEcaXSlE0Dl6MjnOYsJLL/zjMQ8esfRzVNYYZiZv
qHCCDLii3rOzdCiuaJ0D2BfZKZNF4ETi+tvtL4YkmiDUb9+jc7p/CbYRpk0eV/9O
4JERtwI7TVvObksY4N88Oc882dNvbw8y3R9WLuIoRx69lBwTmiYYlDt6kCd/7Wgp
rqq2Spmvyp5KOVm7qFi0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9Q3BNNQnqeFNvA+D5TjM7uFL7Sg9BwAsuOwTodhd2WJpeYknnWZZ+LqJ9Bl
Heo9XgfmVI+nhV7kXqil0pKc1D2SguOTqtRiBRJznEuAsaaCmQclkA==
=jHVf
-----END PGP PUBLIC KEY BLOCK-----
version=4
opts=dversionmangle=s/[-.+~]?(cvs|svn|git|snapshot|pre|hg|repack)(.*)$//i,\
pgpsigurlmangle=s/$/.asc/ \
https://www.libarchive.org/downloads/libarchive-@ANY_VERSION@@ARCHIVE_EXT@