From 05df16418fe58ace38ac4c921038108cbc8b1932 Mon Sep 17 00:00:00 2001 From: fly_fzc <2385803914@qq.com> Date: Wed, 16 Jul 2025 13:59:57 +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 +++++++++++++++ ...SI-C-changes-size_t-rest-globskipdot.patch | 26 +++++++++++++ bash.spec | 11 +++++- 4 files changed, 106 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-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-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 5950f2f..43510e8 100644 --- a/bash.spec +++ b/bash.spec @@ -2,7 +2,7 @@ Name: bash Version: 5.2.37 -Release: 5 +Release: 6 Summary: It is the Bourne Again Shell License: GPL-3.0-or-later URL: https://www.gnu.org/software/bash @@ -39,6 +39,9 @@ Patch6009: backport-posix-change-for-undoing-redirections-after-failed-e.patch Patch6010: backport-fix-issue-with-failed-history-expansion-changing-the.patch Patch6011: backport-revert-change-that-suppressed-array-subscript-expans.patch Patch6012: backport-documentation-updates-for-arithmetic-expansion-and-a.patch +Patch6013: backport-fourth-set-of-ANSI-C-changes-size_t-rest-globskipdot.patch +Patch6014: backport-documentation-updates-fix-for-null-commands-with-red.patch +Patch6015: 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 @@ -171,6 +174,12 @@ make check %exclude %{_infodir}/dir %changelog +* Wed Jul 16 2025 fuanan - 5.2.37-6 +- sync patches from bash community: + add backport-fourth-set-of-ANSI-C-changes-size_t-rest-globskipdot.patch + add backport-documentation-updates-fix-for-null-commands-with-red.patch + add backport-fix-for-readline-redisplay-issue-in-C-locale-fix-for.patch + * Thu Jun 12 2025 yixiangzhike - 5.2.37-5 - sync patches from bash community: fix default file descriptor for <> redirection when printing command -- Gitee