From 1375cfdb1ac9e9de4d82090f0ddd3e969e67f3c8 Mon Sep 17 00:00:00 2001 From: Linux_zhang Date: Mon, 23 Jun 2025 15:28:12 +0800 Subject: [PATCH] sync patches from bash community --- ...dates-fix-for-null-commands-with-red.patch | 39 +++++++++++++++++++ ...-redisplay-issue-in-C-locale-fix-for.patch | 31 +++++++++++++++ ...line-custom-LS_COLORS-extension-fix-.patch | 28 +++++++++++++ ...SI-C-changes-size_t-rest-globskipdot.patch | 26 +++++++++++++ bash.spec | 9 ++++- 5 files changed, 132 insertions(+), 1 deletion(-) create mode 100644 backport-documentation-updates-fix-for-null-commands-with-red.patch create mode 100644 backport-fix-for-readline-redisplay-issue-in-C-locale-fix-for.patch create mode 100644 backport-fix-typo-in-readline-custom-LS_COLORS-extension-fix-.patch create mode 100644 backport-fourth-set-of-ANSI-C-changes-size_t-rest-globskipdot.patch diff --git a/backport-documentation-updates-fix-for-null-commands-with-red.patch b/backport-documentation-updates-fix-for-null-commands-with-red.patch new file mode 100644 index 0000000..f88e6be --- /dev/null +++ b/backport-documentation-updates-fix-for-null-commands-with-red.patch @@ -0,0 +1,39 @@ +From 2610d40b32301cd7256bf1dfc49c9f8bfe0dcd53 Mon Sep 17 00:00:00 2001 +From: Chet Ramey +Date: Wed, 28 Aug 2024 11:42:10 -0400 +Subject: [PATCH] documentation updates; fix for null commands with redirection expansion errors; changes to job notifications for interactive shells sourcing files; fix underflow issue with word_top + +Conflict:only the modified content of execute_cmd.c is rounded. +Reference:https://git.savannah.gnu.org/cgit/bash.git/commit/?id=2610d40b32301cd7256bf1dfc49c9f8bfe0dcd53 + +--- + execute_cmd.c | 6 +++++- + 1 file changed, 5 insertions(+), 1 deletion(-) + +diff --git a/execute_cmd.c b/execute_cmd.c +index 1e3354c..4416f39 100644 +--- a/execute_cmd.c ++++ b/execute_cmd.c +@@ -4089,7 +4089,7 @@ execute_null_command (redirects, pipe_in, pipe_out, async) + REDIRECT *redirects; + int pipe_in, pipe_out, async; + { +- int r; ++ int r,code; + int forcefork, fork_flags; + REDIRECT *rd; + +@@ -4123,6 +4123,10 @@ execute_null_command (redirects, pipe_in, pipe_out, async) + subshell_environment |= SUBSHELL_ASYNC; + if (pipe_in != NO_PIPE || pipe_out != NO_PIPE) + subshell_environment |= SUBSHELL_PIPE; ++ ++ code = setjmp_nosigs(top_level); ++ if (code) ++ exit(EXECUTION_FAILURE); + + if (do_redirections (redirects, RX_ACTIVE) == 0) + exit (EXECUTION_SUCCESS); +-- +2.43.0 + diff --git a/backport-fix-for-readline-redisplay-issue-in-C-locale-fix-for.patch b/backport-fix-for-readline-redisplay-issue-in-C-locale-fix-for.patch new file mode 100644 index 0000000..7390ad2 --- /dev/null +++ b/backport-fix-for-readline-redisplay-issue-in-C-locale-fix-for.patch @@ -0,0 +1,31 @@ +From b116cfe57df2c061cd953b77a0fc1b738dd5fe94 Mon Sep 17 00:00:00 2001 +From: Chet Ramey +Date: Fri, 8 Nov 2024 11:13:57 -0500 +Subject: [PATCH] fix for readline redisplay issue in C locale; fix for small memory leak in termcap replacement library; updates to formatted documentation; fix problem with distclean and y.tab.h; Makefile clean targets updates + +Conflict:only the modified content of lib/termcap/termcap.c is rounded. +Reference:https://git.savannah.gnu.org/cgit/bash.git/commit/?id=b116cfe57df2c061cd953b77a0fc1b738dd5fe94 + +--- + lib/termcap/termcap.c | 5 ++++- + 1 file changed, 4 insertions(+), 1 deletion(-) + +diff --git a/lib/termcap/termcap.c b/lib/termcap/termcap.c +index 87fae05..9ce932f 100644 +--- a/lib/termcap/termcap.c ++++ b/lib/termcap/termcap.c +@@ -536,7 +536,10 @@ tgetent (bp, name) + fd = open (termcap_name, O_RDONLY, 0); + #endif + if (fd < 0) +- return -1; ++ { ++ free(indirect); ++ return -1; ++ } + + buf.size = BUFSIZE; + /* Add 1 to size to ensure room for terminating null. */ +-- +2.43.0 + diff --git a/backport-fix-typo-in-readline-custom-LS_COLORS-extension-fix-.patch b/backport-fix-typo-in-readline-custom-LS_COLORS-extension-fix-.patch new file mode 100644 index 0000000..bed53ab --- /dev/null +++ b/backport-fix-typo-in-readline-custom-LS_COLORS-extension-fix-.patch @@ -0,0 +1,28 @@ +From aab2c1fb1dec189c271cc38e9dd5bd4d1749616d Mon Sep 17 00:00:00 2001 +From: Chet Ramey +Date: Thu, 7 Sep 2023 17:09:24 -0400 +Subject: [PATCH] fix typo in readline custom LS_COLORS extension; fix so `time' is recognized as a reserved word after $( and ${; don't run traps while parsing a command substitution + +Conflict:only the modified content of eval.c is rounded. +Reference:https://git.savannah.gnu.org/cgit/bash.git/commit/?id=aab2c1fb1dec189c271cc38e9dd5bd4d1749616d + +--- + eval.c | 3 ++- + 1 file changed, 2 insertions(+), 1 deletion(-) + +diff --git a/eval.c b/eval.c +index 17fbf73..f3b59e7 100644 +--- a/eval.c ++++ b/eval.c +@@ -325,7 +325,8 @@ parse_command () + int r; + + need_here_doc = 0; +- run_pending_traps (); ++ if ((parser_state & PST_CMDSUBST) == 0) ++ run_pending_traps (); + + /* Allow the execution of a random command just before the printing + of each primary prompt. If the shell variable PROMPT_COMMAND +-- +2.43.0 diff --git a/backport-fourth-set-of-ANSI-C-changes-size_t-rest-globskipdot.patch b/backport-fourth-set-of-ANSI-C-changes-size_t-rest-globskipdot.patch new file mode 100644 index 0000000..9a19294 --- /dev/null +++ b/backport-fourth-set-of-ANSI-C-changes-size_t-rest-globskipdot.patch @@ -0,0 +1,26 @@ +From 5b512e1121b25b0e1652fb812932676b830ab531 Mon Sep 17 00:00:00 2001 +From: Chet Ramey +Date: Wed, 4 Jan 2023 09:18:59 -0500 +Subject: [PATCH] fourth set of ANSI C changes: size_t; rest globskipdots to enabled default in subshells + +Conflict:only the modified content of shopt.def is rounded. +Reference:https://git.savannah.gnu.org/cgit/bash.git/commit/?id=5b512e1121b25b0e1652fb812932676b830ab531 + +--- + builtins/shopt.def | 1 + + 1 files changed, 1 insertions(+) + +diff --git a/builtins/shopt.def b/builtins/shopt.def +index ba97e70..f5bbde1 100644 +--- a/builtins/shopt.def ++++ b/builtins/shopt.def +@@ -384,6 +384,7 @@ reset_shopt_options () + #if defined (EXTENDED_GLOB) + extended_glob = extglob_flag = EXTGLOB_DEFAULT; + #endif ++ glob_always_skip_dot_and_dotdot = 1; /* new default as of bash-5.2 */ + + #if defined (ARRAY_VARS) + expand_once_flag = assoc_expand_once = 0; +-- +2.43.0 diff --git a/bash.spec b/bash.spec index 52bc1e7..ec5dfa8 100644 --- a/bash.spec +++ b/bash.spec @@ -2,7 +2,7 @@ Name: bash Version: 5.2.15 -Release: 16 +Release: 17 Summary: It is the Bourne Again Shell License: GPLv3 URL: https://www.gnu.org/software/bash @@ -40,6 +40,10 @@ Patch6010: backport-posix-change-for-undoing-redirections-after-failed-e.patch Patch6011: backport-fix-issue-with-failed-history-expansion-changing-the.patch Patch6012: backport-revert-change-that-suppressed-array-subscript-expans.patch Patch6013: backport-documentation-updates-for-arithmetic-expansion-and-a.patch +Patch6014: backport-fix-typo-in-readline-custom-LS_COLORS-extension-fix-.patch +Patch6015: backport-fourth-set-of-ANSI-C-changes-size_t-rest-globskipdot.patch +Patch6016: backport-documentation-updates-fix-for-null-commands-with-red.patch +Patch6017: backport-fix-for-readline-redisplay-issue-in-C-locale-fix-for.patch %if %{enable_safecheck} Patch9000: only-scripts-verified-by-execveat-are-allowed-to-run.patch @@ -172,6 +176,9 @@ make check %exclude %{_infodir}/dir %changelog +* Mon Jun 23 2025 Linux_zhang - 5.2.15-17 +- sync patches from bash community + * Thu Jun 5 2025 yixiangzhike - 5.2.15-16 - sync patches from bash community: fix default file descriptor for <> redirection when printing command -- Gitee