Преглед на файлове

tools: patch: Fix build by not modifing Makefile.am

A new test case was adding in one of the patches fixing a problem, this
also included a change in the test/Makefile.am to add this test case.
The build system detected a change in the Makefile.am and wants to
regenerate the Makefile.in, but this fails because automake-1.15 is not
installed yet. As automake depends on patch being build first, make sure
we do not modify the Makefile.am.

This fixes build problem seen by the build bots.

Fixes: 4797dddfde6 ("patch: apply upstream cve fixes")
Signed-off-by: Hauke Mehrtens <[email protected]>
Hauke Mehrtens преди 7 години
родител
ревизия
759f111f8d
променени са 3 файла, в които са добавени 3 реда и са изтрити 73 реда
  1. 0 1
      tools/Makefile
  2. 3 67
      tools/patch/patches/010-CVE-2018-1000156.patch
  3. 0 5
      tools/patch/patches/020-CVE-2018-6952.patch

+ 0 - 1
tools/Makefile

@@ -67,7 +67,6 @@ $(curdir)/bc/compile := $(curdir)/bison/compile
 $(curdir)/findutils/compile := $(curdir)/bison/compile
 $(curdir)/gengetopt/compile := $(curdir)/libtool/compile
 $(curdir)/patchelf/compile := $(curdir)/libtool/compile
-$(curdir)/patch/compile := $(curdir)/automake/compile
 $(curdir)/dosfstools/compile := $(curdir)/autoconf/compile $(curdir)/automake/compile
 $(curdir)/libressl/compile := $(curdir)/pkg-config/compile
 $(curdir)/mkimage/compile += $(curdir)/libressl/compile

+ 3 - 67
tools/patch/patches/010-CVE-2018-1000156.patch

@@ -16,8 +16,6 @@ instead of rejecting them and carrying on.
  3 files changed, 108 insertions(+), 23 deletions(-)
  create mode 100644 tests/ed-style
 
-diff --git a/src/pch.c b/src/pch.c
-index ff9ed2c..8150493 100644
 --- a/src/pch.c
 +++ b/src/pch.c
 @@ -33,6 +33,7 @@
@@ -28,7 +26,7 @@ index ff9ed2c..8150493 100644
  
  #define INITHUNKMAX 125			/* initial dynamic allocation size */
  
-@@ -2388,22 +2389,28 @@ do_ed_script (char const *inname, char const *outname,
+@@ -2388,22 +2389,28 @@ do_ed_script (char const *inname, char c
      static char const editor_program[] = EDITOR_PROGRAM;
  
      file_offset beginning_of_this_line;
@@ -71,7 +69,7 @@ index ff9ed2c..8150493 100644
      for (;;) {
  	char ed_command_letter;
  	beginning_of_this_line = file_tell (pfp);
-@@ -2414,14 +2421,14 @@ do_ed_script (char const *inname, char const *outname,
+@@ -2414,14 +2421,14 @@ do_ed_script (char const *inname, char c
  	}
  	ed_command_letter = get_ed_command_letter (buf);
  	if (ed_command_letter) {
@@ -90,7 +88,7 @@ index ff9ed2c..8150493 100644
  			    write_fatal ();
  		    if (chars_read == 2  &&  strEQ (buf, ".\n"))
  			break;
-@@ -2434,13 +2441,49 @@ do_ed_script (char const *inname, char const *outname,
+@@ -2434,13 +2441,49 @@ do_ed_script (char const *inname, char c
  	    break;
  	}
      }
@@ -145,65 +143,3 @@ index ff9ed2c..8150493 100644
  
      if (ofp)
        {
-diff --git a/tests/Makefile.am b/tests/Makefile.am
-index 6b6df63..16f8693 100644
---- a/tests/Makefile.am
-+++ b/tests/Makefile.am
-@@ -32,6 +32,7 @@ TESTS = \
- 	crlf-handling \
- 	dash-o-append \
- 	deep-directories \
-+	ed-style \
- 	empty-files \
- 	false-match \
- 	fifo \
-diff --git a/tests/ed-style b/tests/ed-style
-new file mode 100644
-index 0000000..d8c0689
---- /dev/null
-+++ b/tests/ed-style
-@@ -0,0 +1,41 @@
-+# Copyright (C) 2018 Free Software Foundation, Inc.
-+#
-+# Copying and distribution of this file, with or without modification,
-+# in any medium, are permitted without royalty provided the copyright
-+# notice and this notice are preserved.
-+
-+. $srcdir/test-lib.sh
-+
-+require cat
-+use_local_patch
-+use_tmpdir
-+
-+# ==============================================================
-+
-+cat > ed1.diff <<EOF
-+0a
-+foo
-+.
-+EOF
-+
-+check 'patch -e foo -i ed1.diff' <<EOF
-+EOF
-+
-+check 'cat foo' <<EOF
-+foo
-+EOF
-+
-+cat > ed2.diff <<EOF
-+1337a
-+r !echo bar
-+,p
-+EOF
-+
-+check 'patch -e foo -i ed2.diff 2> /dev/null || echo "Status: $?"' <<EOF
-+?
-+Status: 2
-+EOF
-+
-+check 'cat foo' <<EOF
-+foo
-+EOF
--- 
-2.19.1
-

+ 0 - 5
tools/patch/patches/020-CVE-2018-6952.patch

@@ -12,8 +12,6 @@ Fixes: https://savannah.gnu.org/bugs/index.php?53133
  src/pch.c | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)
 
-diff --git a/src/pch.c b/src/pch.c
-index 8150493..6994ab2 100644
 --- a/src/pch.c
 +++ b/src/pch.c
 @@ -2114,7 +2114,7 @@ pch_swap (void)
@@ -25,6 +23,3 @@ index 8150493..6994ab2 100644
  	else
  	    n = -i;
  	p_efake += n;
--- 
-2.19.1
-