58251f
Name:           libarchive
58251f
Version:        3.1.2
5da6bd
Release:        14%{?dist}
58251f
Summary:        A library for handling streaming archive formats
58251f
58251f
Group:          System Environment/Libraries
58251f
License:        BSD
58251f
URL:            http://www.libarchive.org/
58251f
Source0:        http://www.libarchive.org/downloads/%{name}-%{version}.tar.gz
58251f
BuildRoot:      %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
58251f
58251f
58251f
BuildRequires: bison
58251f
BuildRequires: sharutils
58251f
BuildRequires: zlib-devel
58251f
BuildRequires: bzip2-devel
58251f
BuildRequires: xz-devel
58251f
BuildRequires: lzo-devel
58251f
BuildRequires: e2fsprogs-devel
58251f
BuildRequires: libacl-devel
58251f
BuildRequires: libattr-devel
58251f
BuildRequires: openssl-devel
58251f
BuildRequires: libxml2-devel
58251f
BuildRequires: automake autoconf libtool
58251f
58251f
58251f
# CVE-2013-0211 libarchive: read buffer overflow on 64-bit systems
58251f
# https://bugzilla.redhat.com/show_bug.cgi?id=927105
58251f
Patch0: libarchive-3.1.3-CVE-2013-0211_read_buffer_overflow.patch
58251f
58251f
Patch1: libarchive-3.1.2-testsuite.patch
58251f
58251f
# A bunch of security patches from 2016 summer
58251f
Patch2: libarchive-3.1.2-rhbz-1347085.patch
58251f
Patch3: libarchive-3.1.2-rhbz-1347086.patch
58251f
Patch4: libarchive-3.1.2-CVE-2015-8916-CVE-2015-8917.patch
58251f
Patch5: libarchive-3.1.2-CVE-2015-8919.patch
58251f
Patch6: libarchive-3.1.2-CVE-2015-8920.patch
58251f
Patch7: libarchive-3.1.2-CVE-2015-8921.patch
58251f
Patch8: libarchive-3.1.2-CVE-2015-8922.patch
58251f
Patch9: libarchive-3.1.2-CVE-2015-8923.patch
58251f
Patch10: libarchive-3.1.2-CVE-2015-8924.patch
58251f
Patch11: libarchive-3.1.2-CVE-2015-8925.patch
58251f
Patch12: libarchive-3.1.2-CVE-2015-8926.patch
58251f
Patch13: libarchive-3.1.2-CVE-2015-8928.patch
58251f
Patch14: libarchive-3.1.2-CVE-2015-8930.patch
58251f
Patch15: libarchive-3.1.2-CVE-2015-8931.patch
58251f
Patch16: libarchive-3.1.2-CVE-2015-8932.patch
58251f
Patch17: libarchive-3.1.2-CVE-2015-8934.patch
58251f
Patch18: libarchive-3.1.2-CVE-2016-4300.patch
58251f
Patch19: libarchive-3.1.2-CVE-2016-4302.patch
58251f
Patch20: libarchive-3.1.2-CVE-2016-4809.patch
58251f
Patch21: libarchive-3.1.2-CVE-2016-5844.patch
58251f
Patch22: libarchive-3.1.2-CVE-2016-1541.patch
58251f
Patch23: libarchive-3.1.2-CVE-2016-5418.patch
58251f
Patch24: libarchive-3.1.2-CVE-2016-5418-variation.patch
58251f
Patch25: libarchive-3.1.2-CVE-2017-14503.patch
58251f
Patch26: libarchive-3.1.2-CVE-2019-1000019.patch
58251f
Patch27: libarchive-3.1.2-CVE-2019-1000020.patch
58251f
Patch28: libarchive-3.3.2-CVE-2018-1000878.patch
58251f
Patch29: libarchive-3.3.2-CVE-2018-1000877.patch
5da6bd
Patch30: libarchive-3.2.1-CVE-2019-18408.patch
58251f
58251f
%description
58251f
Libarchive is a programming library that can create and read several different
58251f
streaming archive formats, including most popular tar variants, several cpio
58251f
formats, and both BSD and GNU ar variants. It can also write shar archives and
58251f
read ISO9660 CDROM images and ZIP archives.
58251f
58251f
%package        devel
58251f
Summary:        Development files for %{name}
58251f
Group:          Development/Libraries
58251f
Requires:       %{name}%{?_isa} = %{version}-%{release}
58251f
58251f
%description    devel
58251f
The %{name}-devel package contains libraries and header files for
58251f
developing applications that use %{name}.
58251f
58251f
58251f
%package -n     bsdtar
58251f
Summary:        Manipulate tape archives
58251f
Group:          Applications/File
58251f
Requires:       %{name} = %{version}-%{release}
58251f
58251f
%description -n bsdtar
58251f
The bsdtar package contains standalone bsdtar utility split off regular
58251f
libarchive packages.
58251f
58251f
58251f
%package -n     bsdcpio
58251f
Summary:        Copy files to and from archives
58251f
Group:          Applications/File
58251f
Requires:       %{name} = %{version}-%{release}
58251f
58251f
%description -n bsdcpio
58251f
The bsdcpio package contains standalone bsdcpio utility split off regular
58251f
libarchive packages.
58251f
58251f
%global _hardened_build 1
58251f
58251f
%prep
58251f
%setup -q -n %{name}-%{version}
58251f
%patch0 -p1 -b .CVE-2013-0211
58251f
# fix bugs in testsuite
58251f
# ~> upstream ~> 26629c191a & b539b2e597 & 9caa49246
58251f
%patch1 -p1 -b .fix-testsuite
58251f
58251f
%patch2 -p1 -b .rhbz-1347085
58251f
%patch3 -p1 -b .rhbz-1347086
58251f
%patch4 -p1 -b .CVE-2015-8916-CVE-2015-8917
58251f
%patch5 -p1 -b .CVE-2015-8919
58251f
%patch6 -p1 -b .CVE-2015-8920
58251f
%patch7 -p1 -b .CVE-2015-8921
58251f
%patch8 -p1 -b .CVE-2015-8922
58251f
%patch9 -p1 -b .CVE-2015-8923
58251f
%patch10 -p1 -b .CVE-2015-8924
58251f
%patch11 -p1 -b .CVE-2015-8925
58251f
%patch12 -p1 -b .CVE-2015-8926
58251f
%patch13 -p1 -b .CVE-2015-8928
58251f
%patch14 -p1 -b .CVE-2015-8930
58251f
%patch15 -p1 -b .CVE-2015-8931
58251f
%patch16 -p1 -b .CVE-2015-8932
58251f
%patch17 -p1 -b .CVE-2015-8934
58251f
%patch18 -p1 -b .CVE-2016-4300
58251f
%patch19 -p1 -b .CVE-2016-4302
58251f
%patch20 -p1 -b .CVE-2016-4809
58251f
%patch21 -p1 -b .CVE-2016-5844
58251f
%patch22 -p1 -b .CVE-2016-1541
58251f
%patch23 -p1 -b .CVE-2016-5418
58251f
%patch24 -p1 -b .CVE-2016-5418-var
58251f
%patch25 -p1 -b .CVE-2017-14503
58251f
%patch26 -p1 -b .CVE-2019-1000019
58251f
%patch27 -p1 -b .CVE-2019-1000020
58251f
%patch28 -p1 -b .CVE-2019-1000878
58251f
%patch29 -p1 -b .CVE-2019-1000877
5da6bd
%patch30 -p1 -b .CVE-2019-18408
58251f
58251f
58251f
%build
58251f
build/autogen.sh
58251f
%configure --disable-static --disable-rpath
58251f
# remove rpaths
58251f
sed -i 's|^hardcode_libdir_flag_spec=.*|hardcode_libdir_flag_spec=""|g' libtool
58251f
sed -i 's|^runpath_var=LD_RUN_PATH|runpath_var=DIE_RPATH_DIE|g' libtool
58251f
58251f
test -z "$V" && verbose_make="V=1"
58251f
make %{?_smp_mflags} $verbose_make
58251f
58251f
58251f
%install
58251f
rm -rf $RPM_BUILD_ROOT
58251f
make install DESTDIR=$RPM_BUILD_ROOT
58251f
find $RPM_BUILD_ROOT -name '*.la' -exec rm -f {} ';'
58251f
58251f
58251f
%check
58251f
run_testsuite()
58251f
{
58251f
    LD_LIBRARY_PATH=`pwd`/.libs make check -j1
58251f
    res=$?
58251f
    echo $res
58251f
    if [ $res -ne 0 ]; then
58251f
        # error happened - try to extract in koji as much info as possible
58251f
        cat test-suite.log
58251f
        echo "========================="
58251f
        err=`cat test-suite.log | grep "Details for failing tests" | cut -d: -f2`
58251f
        for i in $err; do
58251f
            find $i -printf "%p\n    ~> a: %a\n    ~> c: %c\n    ~> t: %t\n    ~> %s B\n"
58251f
            echo "-------------------------"
58251f
            cat $i/*.log
58251f
        done
58251f
        return 1
58251f
    else
58251f
        find -name '*_test.log' -exec cat {} +
58251f
        return 0
58251f
    fi
58251f
}
58251f
58251f
# On a ppc/ppc64 is some race condition causing 'make check' fail on ppc
58251f
# when both 32 and 64 builds are done in parallel on the same machine in
58251f
# koji.  Try to run once again if failed.
58251f
%ifarch ppc
58251f
run_testsuite || run_testsuite
58251f
%else
58251f
run_testsuite
58251f
%endif
58251f
58251f
58251f
%clean
58251f
rm -rf $RPM_BUILD_ROOT
58251f
58251f
58251f
%post -p /sbin/ldconfig
58251f
58251f
58251f
%postun -p /sbin/ldconfig
58251f
58251f
58251f
%files
58251f
%defattr(-,root,root,-)
58251f
%doc COPYING README NEWS
58251f
%{_libdir}/libarchive.so.13*
58251f
%{_mandir}/*/cpio.*
58251f
%{_mandir}/*/mtree.*
58251f
%{_mandir}/*/tar.*
58251f
58251f
%files devel
58251f
%defattr(-,root,root,-)
58251f
%doc
58251f
%{_includedir}/*.h
58251f
%{_mandir}/*/archive*
58251f
%{_mandir}/*/libarchive*
58251f
%{_libdir}/libarchive.so
58251f
%{_libdir}/pkgconfig/libarchive.pc
58251f
58251f
%files -n bsdtar
58251f
%defattr(-,root,root,-)
58251f
%doc COPYING README NEWS
58251f
%{_bindir}/bsdtar
58251f
%{_mandir}/*/bsdtar*
58251f
58251f
%files -n bsdcpio
58251f
%defattr(-,root,root,-)
58251f
%doc COPYING README NEWS
58251f
%{_bindir}/bsdcpio
58251f
%{_mandir}/*/bsdcpio*
58251f
58251f
58251f
%changelog
5da6bd
* Fri Jan 17 2020 Patrik Novotný <panovotn@redhat.com> - 3.1.2-14
5da6bd
- Fix patch application error
5da6bd
5da6bd
* Wed Jan 15 2020 Patrik Novotný <panovotn@redhat.com> - 3.1.2-13
5da6bd
- Fix CVE-2019-18408: RAR use-after-free
5da6bd
58251f
* Tue Apr 30 2019 Ondrej Dubaj <odubaj@redhat.com> - 3.1.2-12
58251f
- fixed use after free in RAR decoder (#1700749)
58251f
- fixed double free in RAR decoder (#1700748)
58251f
58251f
* Fri Feb 22 2019 Pavel Raiskup <praiskup@redhat.com> - 3.1.2-11
58251f
- fix out-of-bounds read within lha_read_data_none() (CVE-2017-14503)
58251f
- fix crash on crafted 7zip archives (CVE-2019-1000019)
58251f
- fix infinite loop in ISO9660 (CVE-2019-1000020)
58251f
58251f
* Fri Aug 12 2016 Petr Kubat <pkubat@redhat.com> - 3.1.2-10
58251f
- Fixes variation of CVE-2016-5418: Hard links could include ".." in their path.
58251f
58251f
* Thu Aug 11 2016 Petr Kubat <pkubat@redhat.com> - 3.1.2-9
58251f
- Fixes CVE-2016-5418: Archive Entry with type 1 (hardlink) causes file overwrite (#1365777)
58251f
58251f
* Fri Jul 08 2016 Pavel Raiskup <praiskup@redhat.com> - 3.1.2-8
58251f
- a bunch of security fixes (rhbz#1353065)
58251f
58251f
* Fri Jan 24 2014 Daniel Mach <dmach@redhat.com> - 3.1.2-7
58251f
- Mass rebuild 2014-01-24
58251f
58251f
* Fri Dec 27 2013 Daniel Mach <dmach@redhat.com> - 3.1.2-6
58251f
- Mass rebuild 2013-12-27
58251f
58251f
* Mon Jul 22 2013 Pavel Raiskup <praiskup@redhat.com> - 3.1.2-5
58251f
- try to workaround racy testsuite fail
58251f
58251f
* Sun Jun 30 2013 Pavel Raiskup <praiskup@redhat.com> - 3.1.2-4
58251f
- enable testsuite in the %%check phase
58251f
58251f
* Mon Jun 24 2013 Pavel Raiskup <praiskup@redhat.com> - 3.1.2-3
58251f
- bsdtar/bsdcpio should require versioned libarchive
58251f
58251f
* Wed Apr  3 2013 Tomas Bzatek <tbzatek@redhat.com> - 3.1.2-2
58251f
- Remove libunistring-devel build require
58251f
58251f
* Thu Mar 28 2013 Tomas Bzatek <tbzatek@redhat.com> - 3.1.2-1
58251f
- Update to 3.1.2
58251f
- Fix CVE-2013-0211: read buffer overflow on 64-bit systems (#927105)
58251f
58251f
* Thu Feb 14 2013 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 3.1.1-2
58251f
- Rebuilt for https://fedoraproject.org/wiki/Fedora_19_Mass_Rebuild
58251f
58251f
* Mon Jan 14 2013 Tomas Bzatek <tbzatek@redhat.com> - 3.1.1-1
58251f
- Update to 3.1.1
58251f
- NEWS seems to be valid UTF-8 nowadays
58251f
58251f
* Wed Oct 03 2012 Pavel Raiskup <praiskup@redhat.com> - 3.0.4-3
58251f
- better install manual pages for libarchive/bsdtar/bsdcpio (# ... )
58251f
- several fedora-review fixes ...:
58251f
- Source0 has moved to github.com
58251f
- remove trailing white spaces
58251f
- repair summary to better describe bsdtar/cpiotar utilities
58251f
58251f
* Thu Jul 19 2012 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 3.0.4-2
58251f
- Rebuilt for https://fedoraproject.org/wiki/Fedora_18_Mass_Rebuild
58251f
58251f
* Mon May  7 2012 Tomas Bzatek <tbzatek@redhat.com> - 3.0.4-1
58251f
- Update to 3.0.4
58251f
58251f
* Wed Feb  1 2012 Tomas Bzatek <tbzatek@redhat.com> - 3.0.3-2
58251f
- Enable bsdtar and bsdcpio in separate subpackages (#786400)
58251f
58251f
* Fri Jan 13 2012 Tomas Bzatek <tbzatek@redhat.com> - 3.0.3-1
58251f
- Update to 3.0.3
58251f
58251f
* Fri Jan 13 2012 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 3.0.0-0.3.a
58251f
- Rebuilt for https://fedoraproject.org/wiki/Fedora_17_Mass_Rebuild
58251f
58251f
* Tue Nov 15 2011 Rex Dieter <rdieter@fedoraproject.org> 3.0.0-0.2.a
58251f
- track files/sonames closer, so abi bumps aren't a surprise
58251f
- tighten subpkg deps via %%_isa
58251f
58251f
* Mon Nov 14 2011 Tomas Bzatek <tbzatek@redhat.com> - 3.0.0-0.1.a
58251f
- Update to 3.0.0a (alpha release)
58251f
58251f
* Mon Sep  5 2011 Tomas Bzatek <tbzatek@redhat.com> - 2.8.5-1
58251f
- Update to 2.8.5
58251f
58251f
* Mon Feb 07 2011 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 2.8.4-3
58251f
- Rebuilt for https://fedoraproject.org/wiki/Fedora_15_Mass_Rebuild
58251f
58251f
* Thu Jan 13 2011 Tomas Bzatek <tbzatek@redhat.com> - 2.8.4-2
58251f
- Rebuild for new xz-libs
58251f
58251f
* Wed Jun 30 2010 Tomas Bzatek <tbzatek@redhat.com> - 2.8.4-1
58251f
- Update to 2.8.4
58251f
58251f
* Fri Jun 25 2010 Tomas Bzatek <tbzatek@redhat.com> - 2.8.3-2
58251f
- Fix ISO9660 reader data type mismatches (#597243)
58251f
58251f
* Tue Mar 16 2010 Tomas Bzatek <tbzatek@redhat.com> - 2.8.3-1
58251f
- Update to 2.8.3
58251f
58251f
* Mon Mar  8 2010 Tomas Bzatek <tbzatek@redhat.com> - 2.8.1-1
58251f
- Update to 2.8.1
58251f
58251f
* Fri Feb  5 2010 Tomas Bzatek <tbzatek@redhat.com> - 2.8.0-1
58251f
- Update to 2.8.0
58251f
58251f
* Wed Jan  6 2010 Tomas Bzatek <tbzatek@redhat.com> - 2.7.902a-1
58251f
- Update to 2.7.902a
58251f
58251f
* Fri Aug 21 2009 Tomas Mraz <tmraz@redhat.com> - 2.7.1-2
58251f
- rebuilt with new openssl
58251f
58251f
* Fri Aug  7 2009 Tomas Bzatek <tbzatek@redhat.com> 2.7.1-1
58251f
- Update to 2.7.1
58251f
- Drop deprecated lzma dependency, libxz handles both formats
58251f
58251f
* Mon Jul 27 2009 Tomas Bzatek <tbzatek@redhat.com> 2.7.0-3
58251f
- Enable XZ compression format
58251f
58251f
* Fri Jul 24 2009 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 2.7.0-2
58251f
- Rebuilt for https://fedoraproject.org/wiki/Fedora_12_Mass_Rebuild
58251f
58251f
* Tue May 12 2009 Tomas Bzatek <tbzatek@redhat.com> 2.7.0-1
58251f
- Update to 2.7.0
58251f
58251f
* Fri Mar  6 2009 Tomas Bzatek <tbzatek@redhat.com> 2.6.2-1
58251f
- Update to 2.6.2
58251f
58251f
* Wed Feb 25 2009 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 2.6.1-2
58251f
- Rebuilt for https://fedoraproject.org/wiki/Fedora_11_Mass_Rebuild
58251f
58251f
* Mon Feb 16 2009 Tomas Bzatek <tbzatek@redhat.com> 2.6.1-1
58251f
- Update to 2.6.1
58251f
58251f
* Thu Jan  8 2009 Tomas Bzatek <tbzatek@redhat.com> 2.6.0-1
58251f
- Update to 2.6.0
58251f
58251f
* Mon Dec 15 2008 Tomas Bzatek <tbzatek@redhat.com> 2.5.904a-1
58251f
- Update to 2.5.904a
58251f
58251f
* Tue Dec  9 2008 Tomas Bzatek <tbzatek@redhat.com> 2.5.903a-2
58251f
- Add LZMA support
58251f
58251f
* Mon Dec  8 2008 Tomas Bzatek <tbzatek@redhat.com> 2.5.903a-1
58251f
- Update to 2.5.903a
58251f
58251f
* Tue Jul 22 2008 Tomas Bzatek <tbzatek@redhat.com> 2.5.5-1
58251f
- Update to 2.5.5
58251f
58251f
* Wed Apr  2 2008 Tomas Bzatek <tbzatek@redhat.com> 2.4.17-1
58251f
- Update to 2.4.17
58251f
58251f
* Wed Mar 19 2008 Tomas Bzatek <tbzatek@redhat.com> 2.4.14-1
58251f
- Initial packaging