diff --git a/utils/bash/Makefile b/utils/bash/Makefile index f77e0b9a1d8e4..243052d3ebc32 100644 --- a/utils/bash/Makefile +++ b/utils/bash/Makefile @@ -9,7 +9,7 @@ include $(TOPDIR)/rules.mk PKG_NAME:=bash PKG_VERSION:=5.3 -PKG_RELEASE:=2 +PKG_RELEASE:=3 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz PKG_SOURCE_URL:=@GNU/bash diff --git a/utils/bash/patches/000-bash-5.3-patch-1.patch b/utils/bash/patches/000-bash_5.3_patch_1.patch similarity index 100% rename from utils/bash/patches/000-bash-5.3-patch-1.patch rename to utils/bash/patches/000-bash_5.3_patch_1.patch diff --git a/utils/bash/patches/001-bash-5.3-patch-2.patch b/utils/bash/patches/001-bash_5.3_patch_2.patch similarity index 100% rename from utils/bash/patches/001-bash-5.3-patch-2.patch rename to utils/bash/patches/001-bash_5.3_patch_2.patch diff --git a/utils/bash/patches/002-bash-5.3-patch-3.patch b/utils/bash/patches/002-bash_5.3_patch_3.patch similarity index 100% rename from utils/bash/patches/002-bash-5.3-patch-3.patch rename to utils/bash/patches/002-bash_5.3_patch_3.patch diff --git a/utils/bash/patches/003-bash-5.3-patch-4.patch b/utils/bash/patches/003-bash_5.3_patch_4.patch similarity index 100% rename from utils/bash/patches/003-bash-5.3-patch-4.patch rename to utils/bash/patches/003-bash_5.3_patch_4.patch diff --git a/utils/bash/patches/004-bash-5.3-patch-5.patch b/utils/bash/patches/004-bash_5.3_patch_5.patch similarity index 100% rename from utils/bash/patches/004-bash-5.3-patch-5.patch rename to utils/bash/patches/004-bash_5.3_patch_5.patch diff --git a/utils/bash/patches/005-bash-5.3-patch-6.patch b/utils/bash/patches/005-bash_5.3_patch_6.patch similarity index 100% rename from utils/bash/patches/005-bash-5.3-patch-6.patch rename to utils/bash/patches/005-bash_5.3_patch_6.patch diff --git a/utils/bash/patches/006-bash-5.3-patch-7.patch b/utils/bash/patches/006-bash_5.3_patch_7.patch similarity index 100% rename from utils/bash/patches/006-bash-5.3-patch-7.patch rename to utils/bash/patches/006-bash_5.3_patch_7.patch diff --git a/utils/bash/patches/007-bash-5.3-patch-8.patch b/utils/bash/patches/007-bash_5.3_patch_8.patch similarity index 100% rename from utils/bash/patches/007-bash-5.3-patch-8.patch rename to utils/bash/patches/007-bash_5.3_patch_8.patch diff --git a/utils/bash/patches/008-bash-5.3-patch-9.patch b/utils/bash/patches/008-bash_5.3_patch_9.patch similarity index 100% rename from utils/bash/patches/008-bash-5.3-patch-9.patch rename to utils/bash/patches/008-bash_5.3_patch_9.patch diff --git a/utils/bash/patches/009-bash_5.3_patch_10.patch b/utils/bash/patches/009-bash_5.3_patch_10.patch new file mode 100644 index 0000000000000..3e0631d013986 --- /dev/null +++ b/utils/bash/patches/009-bash_5.3_patch_10.patch @@ -0,0 +1,27 @@ +From d129c77127233051b8235cbec0cff1d6bea1f5f1 Mon Sep 17 00:00:00 2001 +From: Chet Ramey +Date: Wed, 3 Jun 2026 10:19:04 -0400 +Subject: Bash-5.3 patch 10: fix loop in subshells calling wait builtin with + inherited job list + +--- a/jobs.c ++++ b/jobs.c +@@ -2839,7 +2839,7 @@ wait_for_background_pids (struct procsta + ps->pid = pid; + ps->status = (r < 0 || r > 256) ? 127 : r; + } +- if (r == -1 && errno == ECHILD) ++ if ((r < 0 || r > 256) && errno == ECHILD) + { + /* If we're mistaken about job state, compensate. */ + check_async = 0; +--- a/patchlevel.h ++++ b/patchlevel.h +@@ -25,6 +25,6 @@ + regexp `^#define[ ]*PATCHLEVEL', since that's what support/mkversion.sh + looks for to find the patch level (for the sccs version string). */ + +-#define PATCHLEVEL 9 ++#define PATCHLEVEL 10 + + #endif /* _PATCHLEVEL_H_ */ diff --git a/utils/bash/patches/010-bash_5.3_patch_11.patch b/utils/bash/patches/010-bash_5.3_patch_11.patch new file mode 100644 index 0000000000000..b0d7122487021 --- /dev/null +++ b/utils/bash/patches/010-bash_5.3_patch_11.patch @@ -0,0 +1,45 @@ +From eb9d01914bb2320faaa8bad68859da449884744c Mon Sep 17 00:00:00 2001 +From: Chet Ramey +Date: Wed, 3 Jun 2026 10:20:22 -0400 +Subject: Bash-5.3 patch 11: fix mapfile problem when callback unsets the + variable it is modifying + +--- a/builtins/mapfile.def ++++ b/builtins/mapfile.def +@@ -153,9 +153,7 @@ mapfile (int fd, long line_count_goal, l + line_length = 0; + unbuffered_read = 0; + +- /* The following check should be done before reading any lines. Doing it +- here allows us to call bind_array_element instead of bind_array_variable +- and skip the variable lookup on every call. */ ++ /* The following check should be done before reading any lines. */ + entry = builtin_find_indexed_array (array_name, flags & MAPF_CLEARARRAY); + if (entry == 0) + return EXECUTION_FAILURE; +@@ -201,8 +199,13 @@ mapfile (int fd, long line_count_goal, l + run_callback (callback, array_index, line); + } + +- /* XXX - bad things can happen if the callback modifies ENTRY, e.g., +- unsetting it or changing it to a non-indexed-array type. */ ++ /* Bad things can happen if the callback modifies ENTRY, e.g., ++ unsetting it or changing it to a non-indexed-array type, so we ++ look it up again every time we need to assign something */ ++ entry = bind_array_variable (array_name, array_index, line, 0); ++ if (entry == 0 || ASSIGN_DISALLOWED (entry, 0)) ++ return EXECUTION_FAILURE; ++ + bind_array_element (entry, array_index, line, 0); + + /* Have we exceeded # of lines to store? */ +--- a/patchlevel.h ++++ b/patchlevel.h +@@ -25,6 +25,6 @@ + regexp `^#define[ ]*PATCHLEVEL', since that's what support/mkversion.sh + looks for to find the patch level (for the sccs version string). */ + +-#define PATCHLEVEL 10 ++#define PATCHLEVEL 11 + + #endif /* _PATCHLEVEL_H_ */ diff --git a/utils/bash/patches/011-bash_5.3_patch_12.patch b/utils/bash/patches/011-bash_5.3_patch_12.patch new file mode 100644 index 0000000000000..d0e4beccc8937 --- /dev/null +++ b/utils/bash/patches/011-bash_5.3_patch_12.patch @@ -0,0 +1,48 @@ +From ecb2456d6357bfd3b2965aafe2f2021d1ced5b72 Mon Sep 17 00:00:00 2001 +From: Chet Ramey +Date: Wed, 3 Jun 2026 10:21:45 -0400 +Subject: Bash-5.3 patch 12: fix subshells inappropriately running the EXIT + trap if they receive a fatal signal before resetting traps + +--- a/execute_cmd.c ++++ b/execute_cmd.c +@@ -1643,13 +1643,13 @@ execute_in_subshell (COMMAND *command, i + + if (user_subshell) + { +- subshell_environment = SUBSHELL_PAREN; /* XXX */ ++ subshell_environment = SUBSHELL_PAREN|SUBSHELL_IGNTRAP; /* XXX */ + if (asynchronous) + subshell_environment |= SUBSHELL_ASYNC; + } + else + { +- subshell_environment = 0; /* XXX */ ++ subshell_environment = SUBSHELL_IGNTRAP; /* XXX */ + if (asynchronous) + subshell_environment |= SUBSHELL_ASYNC; + if (pipe_in != NO_PIPE || pipe_out != NO_PIPE) +--- a/patchlevel.h ++++ b/patchlevel.h +@@ -25,6 +25,6 @@ + regexp `^#define[ ]*PATCHLEVEL', since that's what support/mkversion.sh + looks for to find the patch level (for the sccs version string). */ + +-#define PATCHLEVEL 11 ++#define PATCHLEVEL 12 + + #endif /* _PATCHLEVEL_H_ */ +--- a/sig.c ++++ b/sig.c +@@ -638,7 +638,10 @@ termsig_handler (int sig) + interrupt_execution = retain_fifos = executing_funsub = 0; + comsub_ignore_return = return_catch_flag = wait_intr_flag = 0; + +- run_exit_trap (); /* XXX - run exit trap possibly in signal context? */ ++ /* Don't run the exit trap if we're supposed to be ignoring traps in a ++ subshell environment. */ ++ if ((subshell_environment & SUBSHELL_IGNTRAP) == 0) ++ run_exit_trap (); /* XXX - run exit trap possibly in signal context? */ + + kill_shell (sig); + } diff --git a/utils/bash/patches/901-startup-files.patch b/utils/bash/patches/901-startup_files.patch similarity index 100% rename from utils/bash/patches/901-startup-files.patch rename to utils/bash/patches/901-startup_files.patch