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