diff --git a/backport-documentation-updates-for-arithmetic-expansion-and-a.patch b/backport-documentation-updates-for-arithmetic-expansion-and-a.patch new file mode 100644 index 0000000000000000000000000000000000000000..89d152cf9c7fc80bb48d3479ebc902da35664f4c --- /dev/null +++ b/backport-documentation-updates-for-arithmetic-expansion-and-a.patch @@ -0,0 +1,33 @@ +From c3997d51f8ba359eeabb45b90b9cdae4fe599b5a Mon Sep 17 00:00:00 2001 +From: Chet Ramey +Date: Fri, 7 Mar 2025 10:23:58 -0500 +Subject: [PATCH] documentation updates for arithmetic expansion and array + subscripts; update BASH_COMMAND for subshells; fix potential file descriptor + leak in here document pipes + +--- + execute_cmd.c | 8 + + 1 files changed, 8 insertions(+), 0 deletions(-) + +diff --git a/execute_cmd.c b/execute_cmd.c +index 03931c6c..6b2b20cf 100644 +--- a/execute_cmd.c ++++ b/execute_cmd.c +@@ -776,6 +776,14 @@ execute_command_internal (COMMAND *command, int asynchronous, int pipe_in, int p + + if (user_subshell && ignore_return == 0 && invert == 0 && exit_immediately_on_error && exec_result != EXECUTION_SUCCESS) + { ++ /* Update BASH_COMMAND before running any traps, ++ including the exit trap, since we are going to exit ++ the shell. */ ++ if (signal_in_progress (DEBUG_TRAP) == 0 && running_trap == 0) ++ { ++ FREE (the_printed_command_except_trap); ++ the_printed_command_except_trap = savestring (the_printed_command); ++ } + run_pending_traps (); + jump_to_top_level (ERREXIT); + } +-- +2.43.0 + diff --git a/backport-revert-change-that-suppressed-array-subscript-expans.patch b/backport-revert-change-that-suppressed-array-subscript-expans.patch new file mode 100644 index 0000000000000000000000000000000000000000..7810d0b5e390e375d1e7a4b3ed8ca9123fa782bc --- /dev/null +++ b/backport-revert-change-that-suppressed-array-subscript-expans.patch @@ -0,0 +1,27 @@ +From e608233770b0ba5fe20cb46842992b64f7252383 Mon Sep 17 00:00:00 2001 +From: Chet Ramey +Date: Mon, 24 Feb 2025 11:36:49 -0500 +Subject: [PATCH] revert change that suppressed array subscript expansion when + called by the let builtin; fix default file descriptor for <> redirection + when printing command + +--- + print_cmd.c | 2 +- + 1 file changed, 1 insertions(+), 1 deletions(-) + +diff --git a/print_cmd.c b/print_cmd.c +index e7021338..2ad4b8ef 100644 +--- a/print_cmd.c ++++ b/print_cmd.c +@@ -1199,7 +1199,7 @@ print_redirection (REDIRECT *redirect) + case r_input_output: + if (redirect->rflags & REDIR_VARASSIGN) + cprintf ("{%s}", redir_word->word); +- else if (redirector != 1) ++ else if (redirector != 0) + cprintf ("%d", redirector); + cprintf ("<> %s", redirectee->word); + break; +-- +2.43.0 + diff --git a/bash.spec b/bash.spec index eb238755ec3d2db4f142427fee8506c34ea92ce9..966723e0b5acf70f70631fee83ea58c15506003e 100644 --- a/bash.spec +++ b/bash.spec @@ -1,6 +1,6 @@ Name: bash Version: 5.0 -Release: 21 +Release: 22 Summary: It is the Bourne Again Shell License: GPLv3 URL: https://www.gnu.org/software/bash @@ -50,6 +50,8 @@ Patch6002: backport-Bash-5.1-patch-16-fix-interpretation-of-multiple-ins.patch Patch6003: backport-fix-for-nofork-comsub-command-printing-fix-for-crash.patch Patch6004: backport-fix-small-memleak-in-globbing.patch Patch6005: backport-fix-for-leak-when-completing-command-word-with-glob-.patch +Patch6006: backport-revert-change-that-suppressed-array-subscript-expans.patch +Patch6007: backport-documentation-updates-for-arithmetic-expansion-and-a.patch BuildRequires: gcc bison texinfo autoconf ncurses-devel @@ -136,6 +138,12 @@ make check %exclude %{_infodir}/dir %changelog +* Thu Jun 12 2025 yixiangzhike - 5.0-22 +- sync patches from bash community: + fix default file descriptor for <> redirection when printing command + update BASH_COMMAND for subshells + fix potential file descriptor leak in here document pipes + * Thu Dec 7 2023 wangyuhang - 5.0-21 - del doesn't exist PATH dirs in bashrc