From f6207843e5f5f9b40ae22f98f855ace8e7c76e84425f1796450c324b4a8d736a Mon Sep 17 00:00:00 2001 From: "Dr. Werner Fink" Date: Tue, 10 Jul 2018 09:59:35 +0000 Subject: [PATCH 1/2] Accepting request 621385 from home:bmwiedemann:reproducible:test Add bash-memmove.patch to make bash.html build reproducible (boo#1100488) OBS-URL: https://build.opensuse.org/request/show/621385 OBS-URL: https://build.opensuse.org/package/show/Base:System/bash?expand=0&rev=266 --- bash-memmove.patch | 19 +++++++++++++++++++ bash.changes | 5 +++++ bash.spec | 2 ++ 3 files changed, 26 insertions(+) create mode 100644 bash-memmove.patch diff --git a/bash-memmove.patch b/bash-memmove.patch new file mode 100644 index 0000000..bdc299a --- /dev/null +++ b/bash-memmove.patch @@ -0,0 +1,19 @@ +Author: Bernhard M. Wiedemann +Date: 2018-07-07 + +strcpy can cause corruption when working on overlapping strings +so we use memmove instead that handles this case correctly + +Index: bash-4.4/support/man2html.c +=================================================================== +--- bash-4.4.orig/support/man2html.c ++++ bash-4.4/support/man2html.c +@@ -1992,7 +1993,7 @@ unescape (char *c) + while (i < l && c[i]) { + if (c[i] == '\a') { + if (c[i+1]) +- strcpy(c + i, c + i + 1); /* should be memmove */ ++ memmove(c + i, c + i + 1, strlen(c + i)); + else { + c[i] = '\0'; + break; diff --git a/bash.changes b/bash.changes index 821463d..96ee432 100644 --- a/bash.changes +++ b/bash.changes @@ -1,3 +1,8 @@ +------------------------------------------------------------------- +Sat Jul 7 05:03:48 UTC 2018 - bwiedemann@suse.com + +- Add bash-memmove.patch to make bash.html build reproducible (boo#1100488) + ------------------------------------------------------------------- Mon Jun 4 09:21:15 UTC 2018 - werner@suse.de diff --git a/bash.spec b/bash.spec index 801a84b..1c49796 100644 --- a/bash.spec +++ b/bash.spec @@ -83,6 +83,7 @@ Patch47: bash-4.3-perl522.patch Patch48: bash-4.3-extra-import-func.patch # PATCH-EXTEND-SUSE Allow root to clean file system if filled up Patch49: bash-4.3-pathtemp.patch +Patch50: bash-memmove.patch %global _sysconfdir /etc %global _incdir %{_includedir} %global _ldldir /%{_lib}/bash @@ -225,6 +226,7 @@ done %endif %patch49 -p0 -b .pthtmp %patch0 -p0 -b .0 +%patch50 -p1 # This has to be always the same version as included in the bash its self rl1=($(sed -rn '/RL_READLINE_VERSION/p' lib/readline/readline.h)) rl2=($(sed -rn '/RL_READLINE_VERSION/p' /usr/include/readline/readline.h)) From b7bd90094251ce6cd64597d5566cf1891608bc98514dd2af392267e8563c53ce Mon Sep 17 00:00:00 2001 From: "Dr. Werner Fink" Date: Tue, 10 Jul 2018 10:01:43 +0000 Subject: [PATCH 2/2] boo#1100488 OBS-URL: https://build.opensuse.org/package/show/Base:System/bash?expand=0&rev=267 --- bash.changes | 2 +- bash.spec | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/bash.changes b/bash.changes index 96ee432..638e333 100644 --- a/bash.changes +++ b/bash.changes @@ -6,7 +6,7 @@ Sat Jul 7 05:03:48 UTC 2018 - bwiedemann@suse.com ------------------------------------------------------------------- Mon Jun 4 09:21:15 UTC 2018 - werner@suse.de -- In patch bash-4.4.dif avoud setgroups(2) but use initgroups(3) (boo#1095670) +- In patch bash-4.4.dif avoid setgroups(2) but use initgroups(3) (boo#1095670) ------------------------------------------------------------------- Sat Jun 2 17:17:13 UTC 2018 - avindra@opensuse.org diff --git a/bash.spec b/bash.spec index 1c49796..c6dbb09 100644 --- a/bash.spec +++ b/bash.spec @@ -225,8 +225,8 @@ done %patch48 -b .eif %endif %patch49 -p0 -b .pthtmp +%patch50 -p1 -b .mmv %patch0 -p0 -b .0 -%patch50 -p1 # This has to be always the same version as included in the bash its self rl1=($(sed -rn '/RL_READLINE_VERSION/p' lib/readline/readline.h)) rl2=($(sed -rn '/RL_READLINE_VERSION/p' /usr/include/readline/readline.h))