572a74
%global gnulib_ver 20180203
572a74
572a74
Summary: Utility for modifying/upgrading files
572a74
Name: patch
572a74
Version: 2.7.6
784d9f
Release: 11%{?dist}
572a74
License: GPLv3+
572a74
URL: http://www.gnu.org/software/patch/patch.html
572a74
Group: Development/Tools
572a74
Source: ftp://ftp.gnu.org/gnu/patch/patch-%{version}.tar.xz
572a74
Patch1: patch-2.7.6-CVE-2018-6951.patch
572a74
Patch2: patch-CVE-2018-1000156.patch
572a74
Patch3: patch-2.7.6-gcc8.patch
572a74
Patch4: patch-2.7.6-CVE-2018-6952.patch
f13c65
Patch5: patch-2.7.6-CVE-2018-20969.patch
784d9f
Patch6: patch-2.7.6-CVE-2019-13636-symlinks.patch
784d9f
Patch7: patch-2.7.x-abort_when_cleaning_up_fails.patch
572a74
Patch100: patch-selinux.patch
572a74
BuildRequires: libselinux-devel
572a74
BuildRequires: libattr-devel
572a74
BuildRequires: ed
572a74
BuildRequires: automake autoconf
572a74
572a74
Provides: bundled(gnulib) = %{gnulib_ver}
572a74
572a74
%description
572a74
The patch program applies diff files to originals.  The diff command
572a74
is used to compare an original to a changed file.  Diff lists the
572a74
changes made to the file.  A person who has the original file can then
572a74
use the patch command with the diff file to add the changes to their
572a74
original file (patching the file).
572a74
572a74
Patch should be installed because it is a common way of upgrading
572a74
applications.
572a74
572a74
%prep
572a74
%setup -q
572a74
572a74
# CVE-2018-6951, NULL pointer dereference causes a crash
572a74
%patch1 -p1 -b .CVE-2018-6951
572a74
572a74
# CVE-2018-1000156, Malicious patch files cause ed to execute arbitrary commands
572a74
%patch2 -p1 -b .CVE-2018-1000156
572a74
572a74
# Fix to build with gcc8
572a74
%patch3 -p1 -b .gcc8
572a74
572a74
# CVE-2018-6952, Double free of memory
572a74
%patch4 -p1 -b .CVE-2018-6952
572a74
f13c65
# CVE-2018-20969, do_ed_script in pch.c does not block strings beginning with a ! character
f13c65
%patch5 -p1 -b .CVE-2018-20969
f13c65
784d9f
# CVE-2019-13636, Don't follow symlinks unless --follow-symlinks is given
784d9f
%patch6 -p1 -b .CVE-2019-13636
784d9f
784d9f
# bz#1665928, Abort when cleaning up fails
784d9f
%patch7 -p1 -b .abort_when_cleaning_up_fails
784d9f
572a74
# SELinux support.
572a74
%patch100 -p1 -b .selinux
572a74
572a74
%build
572a74
CFLAGS="$RPM_OPT_FLAGS -D_GNU_SOURCE"
572a74
%ifarch sparcv9
572a74
CFLAGS=`echo $CFLAGS|sed -e 's|-fstack-protector||g'`
572a74
%endif
572a74
%configure --disable-silent-rules
572a74
make %{?_smp_mflags}
572a74
572a74
%check
572a74
make check
572a74
572a74
%install
572a74
rm -rf $RPM_BUILD_ROOT
572a74
%makeinstall
572a74
572a74
%files
572a74
%defattr(-,root,root,-)
572a74
%license COPYING
572a74
%doc NEWS README
572a74
%{_bindir}/*
572a74
%{_mandir}/*/*
572a74
572a74
%changelog
784d9f
* Tue Nov 19 2019 Than Ngo <than@redhat.com> - 2.7.6-11
784d9f
- Related: #1733565, apply the patch correctly
784d9f
784d9f
* Tue Nov 19 2019 Than Ngo <than@redhat.com> - 2.7.6-10
784d9f
- CVE-2019-13636 , Don't follow symlinks unless --follow-symlinks is given
784d9f
- Resolves: #1665928, patch has a huge error output and segfaults when the file to be patched does not exist
784d9f
f13c65
* Mon Sep 02 2019 Than Ngo <than@redhat.com> - 2.7.6-9
f13c65
- CVE-2018-20969, invoke ed directly instead of using the shell
f13c65
572a74
* Tue Nov 27 2018 Than Ngo <than@redhat.com> - 2.7.6-8
572a74
- Added virtual provides for bundled gnulib library
572a74
572a74
* Wed Sep 12 2018 Than Ngo <than@redhat.com> - 2.7.6-7
572a74
- Resolves: #1554752, CVE-2018-6952 Double free of memory
572a74
572a74
* Mon Jun 18 2018 Than Ngo <than@redhat.com> - 2.7.6-6
572a74
- avoid warnings from GCC8
572a74
572a74
* Mon Apr 09 2018 Than Ngo <than@redhat.com> - 2.7.6-5
572a74
- fixed CVE-2018-1000156
572a74
572a74
* Tue Mar 13 2018 Than Ngo <than@redhat.com> - 2.7.6-4
572a74
- apply the patch for CVE-2018-6951
572a74
572a74
* Mon Feb 12 2018 Tim Waugh <twaugh@redhat.com> - 2.7.6-3
572a74
- 2.7.6 (CVE-2016-10713, CVE-2018-6951, CVE-2018-6952).
572a74
572a74
* Thu Feb 08 2018 Fedora Release Engineering <releng@fedoraproject.org> - 2.7.5-7
572a74
- Rebuilt for https://fedoraproject.org/wiki/Fedora_28_Mass_Rebuild
572a74
572a74
* Thu Aug 03 2017 Fedora Release Engineering <releng@fedoraproject.org> - 2.7.5-6
572a74
- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Binutils_Mass_Rebuild
572a74
572a74
* Thu Jul 27 2017 Fedora Release Engineering <releng@fedoraproject.org> - 2.7.5-5
572a74
- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Mass_Rebuild
572a74
572a74
* Wed Feb 01 2017 Stephen Gallagher <sgallagh@redhat.com> - 2.7.5-4
572a74
- Add missing %%license macro
572a74
572a74
* Thu Feb 04 2016 Fedora Release Engineering <releng@fedoraproject.org> - 2.7.5-3
572a74
- Rebuilt for https://fedoraproject.org/wiki/Fedora_24_Mass_Rebuild
572a74
572a74
* Thu Jun 18 2015 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 2.7.5-2
572a74
- Rebuilt for https://fedoraproject.org/wiki/Fedora_23_Mass_Rebuild
572a74
572a74
* Mon Mar  9 2015 Tim Waugh <twaugh@redhat.com> - 2.7.5-1
572a74
- Fixed memory leak in selinux patch.
572a74
- 2.7.5, including an even better fix for CVE-2015-1196 that still
572a74
  allows relative symlinks to be created/used.
572a74
572a74
* Sat Feb 21 2015 Till Maas <opensource@till.name> - 2.7.4-2
572a74
- Rebuilt for Fedora 23 Change
572a74
  https://fedoraproject.org/wiki/Changes/Harden_all_packages_with_position-independent_code
572a74
572a74
* Sun Feb  1 2015 Tim Waugh <twaugh@redhat.com> - 2.7.4-1
572a74
- 2.7.4, including a better fix for CVE-2015-1196 that still allows
572a74
  symlinks referencing ".." to be created.
572a74
572a74
* Fri Jan 23 2015 Tim Waugh <twaugh@redhat.com> - 2.7.3-1
572a74
- 2.7.3 (bug #1182157, CVE-2015-1196, bug #1184491, CVE-2014-9637).
572a74
572a74
* Tue Jan 20 2015 Tim Waugh <twaugh@redhat.com> - 2.7.1-12
572a74
- Apply upstream patch to fix line numbering integer overflow.
572a74
572a74
* Tue Jan 20 2015 Tim Waugh <twaugh@redhat.com> - 2.7.1-11
572a74
- Apply upstream patch to fix directory traversal via symlinks
572a74
  (bug #1182157, CVE-2015-1196).
572a74
572a74
* Sun Aug 17 2014 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 2.7.1-9
572a74
- Rebuilt for https://fedoraproject.org/wiki/Fedora_21_22_Mass_Rebuild
572a74
572a74
* Fri Jun 06 2014 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 2.7.1-8
572a74
- Rebuilt for https://fedoraproject.org/wiki/Fedora_21_Mass_Rebuild
572a74
572a74
* Sat Aug 03 2013 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 2.7.1-7
572a74
- Rebuilt for https://fedoraproject.org/wiki/Fedora_20_Mass_Rebuild
572a74
572a74
* Wed Jun 12 2013 Tim Waugh <twaugh@redhat.com> 2.7.1-6
572a74
- Don't segfault when given bad arguments (bug #972330).
572a74
572a74
* Thu Apr 11 2013 Tim Waugh <twaugh@redhat.com> 2.7.1-5
572a74
- Don't document unsupported -m option; document -x option (bug #948972).
572a74
572a74
* Mon Mar 25 2013 Ville Skyttä <ville.skytta@iki.fi> - 2.7.1-4
572a74
- Build with xattr support.
572a74
- Make build output more verbose.
572a74
- Fix bogus date in %%changelog.
572a74
572a74
* Mon Mar 11 2013 Tim Waugh <twaugh@redhat.com> 2.7.1-3
572a74
- Upstream patch to fix removal of empty directories (bug #919489).
572a74
572a74
* Thu Feb 14 2013 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 2.7.1-2
572a74
- Rebuilt for https://fedoraproject.org/wiki/Fedora_19_Mass_Rebuild
572a74
572a74
* Thu Oct 18 2012 Tim Waugh <twaugh@redhat.com> 2.7.1-1
572a74
- Fixed license (since 2.6 it has been GPLv3+).
572a74
- 2.7.1.
572a74
572a74
* Thu Oct 18 2012 Tim Waugh <twaugh@redhat.com> 2.7-1
572a74
- 2.7.  No longer need sigsegv, get-arg, CVE-2010-4651,
572a74
  backup-if-mismatch or coverity-leak patches.
572a74
572a74
* Fri Jul 20 2012 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 2.6.1-13
572a74
- Rebuilt for https://fedoraproject.org/wiki/Fedora_18_Mass_Rebuild
572a74
572a74
* Fri Jan 13 2012 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 2.6.1-12
572a74
- Rebuilt for https://fedoraproject.org/wiki/Fedora_17_Mass_Rebuild
572a74
572a74
* Fri Nov 25 2011 Tim Waugh <twaugh@redhat.com> 2.6.1-11
572a74
- Fixed NULL dereference in selinux patch.
572a74
572a74
* Mon May 16 2011 Tim Waugh <twaugh@redhat.com> 2.6.1-10
572a74
- Applied Jiri Popelka's fixes from Coverity scan (bug #704554):
572a74
  - Avoid unchecked return from getfilecon() in patch-selinux.patch.
572a74
  - Fix memory leak.
572a74
572a74
* Wed Feb 16 2011 Tim Waugh <twaugh@redhat.com> 2.6.1-9
572a74
- Let --posix cause --no-backup-if-mismatch (bug #678016).
572a74
572a74
* Thu Feb 10 2011 Tim Waugh <twaugh@redhat.com> 2.6.1-8
572a74
- Incorporate upstream fix for CVE-2010-4651 patch so that a target
572a74
  name given on the command line is not validated (bug #667529).
572a74
572a74
* Tue Feb  8 2011 Tim Waugh <twaugh@redhat.com> 2.6.1-7
572a74
- Applied upstream patch to fix CVE-2010-4651 so that malicious
572a74
  patches cannot create files above the current directory
572a74
  (bug #667529).
572a74
572a74
* Tue Jan  4 2011 Tim Waugh <twaugh@redhat.com> 2.6.1-6
572a74
- Use smp_mflags correctly (bug #665770).
572a74
572a74
* Mon Aug 16 2010 Tim Waugh <twaugh@redhat.com> 2.6.1-5
572a74
- Another fix for the selinux patch (bug #618215).
572a74
572a74
* Fri Aug  6 2010 Tim Waugh <twaugh@redhat.com> 2.6.1-4
572a74
- Fixed interpretation of return value from getfilecon().
572a74
- Fixed argument type for --get (bug #553624).
572a74
572a74
* Fri Aug  6 2010 Dennis Gilmore <dennis@ausil.us>
572a74
- using -fstack-projector causes weirdness on 32 bit sparc so disabling for now
572a74
572a74
* Tue Jul 27 2010 Tim Waugh <twaugh@redhat.com> 2.6.1-3
572a74
- Fixed argument type for --get (bug #553624).
572a74
572a74
* Wed Mar  3 2010 Tim Waugh <twaugh@redhat.com> 2.6.1-2
572a74
- Added comments for all patches.
572a74
- Ship COPYING file.
572a74
- Removed sparc ifdefs in spec file.
572a74
572a74
* Mon Jan  4 2010 Tim Waugh <twaugh@redhat.com> 2.6.1-1
572a74
- 2.6.1 (bug #551569).  No longer need best-name patch.
572a74
572a74
* Thu Dec 24 2009 Tim Waugh <twaugh@redhat.com> 2.6-2
572a74
- Applied upstream patch to prevent incorrect filename being chosen
572a74
  when adding a new file (bug #549122).
572a74
572a74
* Mon Nov 16 2009 Tim Waugh <twaugh@redhat.com> 2.6-1
572a74
- 2.6.  No longer need stderr, suffix, stripcr, parse, allow-spaces,
572a74
  ifdef, program_name, or posix-backup patches.
572a74
572a74
* Sat Jul 25 2009 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 2.5.4-40
572a74
- Rebuilt for https://fedoraproject.org/wiki/Fedora_12_Mass_Rebuild
572a74
572a74
* Wed Apr 29 2009 Tim Waugh <twaugh@redhat.com> 2.5.4-39
572a74
- Fixed operation when SELinux is disabled (bug #498102).  Patch from
572a74
  Jan Kratochvil.
572a74
572a74
* Thu Feb 26 2009 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 2.5.4-38
572a74
- Rebuilt for https://fedoraproject.org/wiki/Fedora_11_Mass_Rebuild
572a74
572a74
* Tue Feb 17 2009 Tim Waugh <twaugh@redhat.com> 2.5.4-37
572a74
- Don't set SELinux file context if it is already correct.
572a74
572a74
* Mon Nov 24 2008 Tim Waugh <twaugh@redhat.com> 2.5.4-36
572a74
- Better summary.
572a74
572a74
* Mon Jun 30 2008 Tim Waugh <twaugh@redhat.com> 2.5.4-35
572a74
- Don't fail if setfilecon() returns EPERM (bug #453365), although the
572a74
  setfilecon man page suggests that ENOTSUP will be returned in this
572a74
  case.
572a74
572a74
* Mon Jun 16 2008 Tim Waugh <twaugh@redhat.com> 2.5.4-34
572a74
- Only write simple backups for each file once during a run
572a74
  (bug #234822).
572a74
572a74
* Thu Jun 12 2008 Tim Waugh <twaugh@redhat.com> 2.5.4-33
572a74
- Fix selinux patch and apply it.  Build requires libselinux-devel.
572a74
572a74
* Fri Feb  8 2008 Tim Waugh <twaugh@redhat.com> 2.5.4-32
572a74
- Applied patch from 2.5.9 to allow spaces in filenames (bug #431887).
572a74
572a74
* Mon Dec  3 2007 Tim Waugh <twaugh@redhat.com> 2.5.4-31
572a74
- Convert spec file to UTF-8 (bug #226233).
572a74
- Use _bindir macro in %%files (bug #226233).
572a74
- Parallel make (bug #226233).
572a74
- Better defattr declaration (bug #226233).
572a74
572a74
* Thu Oct  4 2007 Tim Waugh <twaugh@redhat.com>
572a74
- Beginnings of an SELinux patch (bug #165799); not applied yet.
572a74
572a74
* Wed Aug 29 2007 Tim Waugh <twaugh@redhat.com> 2.5.4-30
572a74
- Added dist tag.
572a74
- More specific license tag.
572a74
- Fixed summary.
572a74
- Better buildroot tag.
572a74
572a74
* Wed Jul 12 2006 Jesse Keating <jkeating@redhat.com> - 2.5.4-29.2.2
572a74
- rebuild
572a74
572a74
* Fri Feb 10 2006 Jesse Keating <jkeating@redhat.com> - 2.5.4-29.2.1
572a74
- bump again for double-long bug on ppc(64)
572a74
572a74
* Tue Feb 07 2006 Jesse Keating <jkeating@redhat.com> - 2.5.4-29.2
572a74
- rebuilt for new gcc4.1 snapshot and glibc changes
572a74
572a74
* Fri Dec 09 2005 Jesse Keating <jkeating@redhat.com>
572a74
- rebuilt
572a74
572a74
* Thu Sep  8 2005 Tim Waugh <twaugh@redhat.com> 2.5.4-29
572a74
- Remove SELinux patch for now (bug #167822).
572a74
572a74
* Wed Sep  7 2005 Tim Waugh <twaugh@redhat.com> 2.5.4-27
572a74
- Applied patch from Ulrich Drepper to fix string overread (bug #167675).
572a74
572a74
* Tue Sep  6 2005 Tim Waugh <twaugh@redhat.com> 2.5.4-26
572a74
- Preserve SELinux file contexts (bug #165799).
572a74
572a74
* Thu Aug 11 2005 Tim Waugh <twaugh@redhat.com> 2.5.4-25
572a74
- Fixed CRLF detection (bug #154283).
572a74
572a74
* Wed May  4 2005 Tim Waugh <twaugh@redhat.com> 2.5.4-24
572a74
- Reverted last change (bug #154283, bug #156762).
572a74
572a74
* Fri Apr 29 2005 Tim Waugh <twaugh@redhat.com> 2.5.4-23
572a74
- Applied patch from Toshio Kuratomi to avoid problems with DOS-format
572a74
  newlines (bug #154283).
572a74
572a74
* Wed Mar  2 2005 Tim Waugh <twaugh@redhat.com> 2.5.4-22
572a74
- Rebuild for new GCC.
572a74
572a74
* Wed Feb  9 2005 Tim Waugh <twaugh@redhat.com> 2.5.4-21
572a74
- Rebuilt.
572a74
572a74
* Tue Jun 15 2004 Elliot Lee <sopwith@redhat.com>
572a74
- rebuilt
572a74
572a74
* Fri Feb 13 2004 Elliot Lee <sopwith@redhat.com>
572a74
- rebuilt
572a74
572a74
* Sat Oct 25 2003 Tim Waugh <twaugh@redhat.com> 2.5.4-18
572a74
- Rebuilt.
572a74
572a74
* Wed Jun 04 2003 Elliot Lee <sopwith@redhat.com>
572a74
- rebuilt
572a74
572a74
* Wed Jan 22 2003 Tim Powers <timp@redhat.com>
572a74
- rebuilt
572a74
572a74
* Wed Nov 20 2002 Tim Powers <timp@redhat.com>
572a74
- rebuilt in current collinst
572a74
572a74
* Fri Jun 21 2002 Tim Powers <timp@redhat.com>
572a74
- automated rebuild
572a74
572a74
* Thu May 23 2002 Tim Powers <timp@redhat.com>
572a74
- automated rebuild
572a74
572a74
* Tue Apr  9 2002 Tim Waugh <twaugh@redhat.com> 2.5.4-12
572a74
- Fix error reporting when given bad options (bug #62981).
572a74
572a74
* Tue Mar  5 2002 Tim Waugh <twaugh@redhat.com> 2.5.4-11
572a74
- s/Copyright:/License:/.
572a74
- Fix -D behaviour (bug #60688).
572a74
572a74
* Tue May 29 2001 Tim Waugh <twaugh@redhat.com> 2.5.4-10
572a74
- Merge Mandrake patch:
572a74
  - fix possible segfault
572a74
572a74
* Fri Dec  1 2000 Tim Waugh <twaugh@redhat.com>
572a74
- Rebuild because of fileutils bug.
572a74
572a74
* Thu Nov  2 2000 Tim Waugh <twaugh@redhat.com>
572a74
- use .orig as default suffix, as per man page and previous behaviour
572a74
  (bug #20202).
572a74
- use better patch for this, from maintainer.
572a74
572a74
* Wed Oct  4 2000 Tim Waugh <twaugh@redhat.com>
572a74
- actually use the RPM_OPT_FLAGS
572a74
572a74
* Wed Jul 12 2000 Prospector <bugzilla@redhat.com>
572a74
- automatic rebuild
572a74
572a74
* Tue Jun 13 2000 Trond Eivind Glomsrød <teg@redhat.com>
572a74
- Use %%makeinstall, %%{_tmppath} and %%{_mandir}
572a74
572a74
* Fri May 12 2000 Trond Eivind Glomsrød <teg@redhat.com>
572a74
- added URL
572a74
572a74
* Wed Feb 16 2000 Bernhard Rosenkraenzer <bero@redhat.com>
572a74
- 2.5.4
572a74
- Fix up LFS support on Alpha (Bug #5732)
572a74
572a74
* Mon Feb  7 2000 Bill Nottingham <notting@redhat.com>
572a74
- handle compressed manpages
572a74
572a74
* Sun Jun 06 1999 Alan Cox <alan@redhat.com>
572a74
- Fix the case where stderr isnt flushed for ask(). Now the 'no such file'
572a74
  appears before the skip patch question, not at the very end, Doh!
572a74
572a74
* Mon Mar 22 1999 Jeff Johnson <jbj@redhat.com>
572a74
- (ultra?) sparc was getting large file system support.
572a74
572a74
* Sun Mar 21 1999 Cristian Gafton <gafton@redhat.com> 
572a74
- auto rebuild in the new build environment (release 7)
572a74
572a74
* Fri Dec 18 1998 Cristian Gafton <gafton@redhat.com>
572a74
- build against glibc 2.1
572a74
572a74
* Tue Sep  1 1998 Jeff Johnson <jbj@redhat.com>
572a74
- bump release to preserve newer than back-ported 4.2.
572a74
572a74
* Tue Jun 09 1998 Prospector System <bugs@redhat.com>
572a74
- translations modified for de, fr
572a74
572a74
* Tue Jun  9 1998 Jeff Johnson <jbj@redhat.com>
572a74
- Fix for problem #682 segfault.
572a74
572a74
* Fri Apr 24 1998 Prospector System <bugs@redhat.com>
572a74
- translations modified for de, fr, tr
572a74
572a74
* Tue Apr 07 1998 Cristian Gafton <gafton@redhat.com>
572a74
- added buildroot
572a74
572a74
* Tue Oct 21 1997 Cristian Gafton <gafton@redhat.com>
572a74
- updated to 2.5
572a74
572a74
* Mon Jun 02 1997 Erik Troan <ewt@redhat.com>
572a74
- built against glibc