From 7d70e4ce7c228d3b5b022fc409b2af0f3185b5258af9408eb5d58f472d34c678 Mon Sep 17 00:00:00 2001 From: "Dr. Werner Fink" Date: Wed, 28 Feb 2024 14:05:40 +0000 Subject: [PATCH] Harden for gcc 14 OBS-URL: https://build.opensuse.org/package/show/Base:System/bash?expand=0&rev=381 --- bash-4.2-nscdunmap.dif | 5 +++-- bash-5.2-gcc14.patch | 16 ++++++++++++++++ bash-5.2.dif | 8 ++++---- bash.changes | 8 ++++++++ bash.spec | 3 +++ 5 files changed, 34 insertions(+), 6 deletions(-) create mode 100644 bash-5.2-gcc14.patch diff --git a/bash-4.2-nscdunmap.dif b/bash-4.2-nscdunmap.dif index 578a6af..28dfc43 100644 --- a/bash-4.2-nscdunmap.dif +++ b/bash-4.2-nscdunmap.dif @@ -4,15 +4,16 @@ --- shell.c +++ shell.c 2018-09-20 08:08:34.242204532 +0000 -@@ -43,6 +43,7 @@ +@@ -43,6 +43,8 @@ #endif #if defined (HAVE_UNISTD_H) ++# include +# include # include #endif -@@ -1888,6 +1893,28 @@ init_interactive_script () +@@ -1888,6 +1894,28 @@ init_interactive_script () #endif } diff --git a/bash-5.2-gcc14.patch b/bash-5.2-gcc14.patch new file mode 100644 index 0000000..f4ca197 --- /dev/null +++ b/bash-5.2-gcc14.patch @@ -0,0 +1,16 @@ +--- + aclocal.m4 | 3 +++ + 1 file changed, 3 insertions(+) + +--- aclocal.m4 ++++ aclocal.m4 2024-02-28 13:50:24.552597535 +0000 +@@ -238,6 +238,9 @@ AC_CACHE_VAL(bash_cv_dup2_broken, + #include + #include + #include ++#ifdef HAVE_UNISTD_H ++#include ++#endif + int + main() + { diff --git a/bash-5.2.dif b/bash-5.2.dif index bcab90f..5877348 100644 --- a/bash-5.2.dif +++ b/bash-5.2.dif @@ -151,15 +151,15 @@ static int --- shell.c +++ shell.c 2022-04-28 11:56:12.623015117 +0000 -@@ -45,6 +45,7 @@ - #if defined (HAVE_UNISTD_H) +@@ -46,6 +46,7 @@ + # include # include # include +# include #endif #include "bashintl.h" -@@ -511,7 +512,7 @@ main (argc, argv, env) +@@ -512,7 +513,7 @@ main (argc, argv, env) read_but_dont_execute = 1; #endif @@ -168,7 +168,7 @@ disable_priv_mode (); /* Need to get the argument to a -c option processed in the -@@ -1341,6 +1342,9 @@ disable_priv_mode () +@@ -1342,6 +1343,9 @@ disable_priv_mode () { int e; diff --git a/bash.changes b/bash.changes index 8285484..c7f21b2 100644 --- a/bash.changes +++ b/bash.changes @@ -1,3 +1,11 @@ +------------------------------------------------------------------- +Wed Feb 28 13:52:24 UTC 2024 - Dr. Werner Fink + +- Harden bash to be compiled with gcc 14 (boo#1220564) + * Modify patch bash-4.2-nscdunmap.dif to include + * Port bash-5.2.dif to the former change + * Add patch bash-5.2-gcc14.patch + ------------------------------------------------------------------- Tue Jan 16 08:49:57 UTC 2024 - Dr. Werner Fink diff --git a/bash.spec b/bash.spec index e03989c..fdd02f3 100644 --- a/bash.spec +++ b/bash.spec @@ -88,6 +88,8 @@ Patch48: bash-4.3-extra-import-func.patch Patch49: bash-4.3-pathtemp.patch # PATCH-FIX-SUSE Patch50: quotes-man2html.patch +# PATCH-FIX-UPSTREAM +Patch51: bash-5.2-gcc14.patch BuildRequires: autoconf # latest bash uses with patch 18 the tag YYEOF BuildRequires: bison @@ -281,6 +283,7 @@ set -x %endif %patch -P49 -b .pthtmp %patch -P50 -b .qd +%patch -P51 -b .gcc14 %patch -P0 -b .p0 # This has to be always the same version as included in the bash its self