]> git.99rst.org Git - openwrt-packages.git/commitdiff
bash: update to 5.3 patch level 12
authorWei-Ting Yang <redacted>
Tue, 9 Jun 2026 04:26:11 +0000 (12:26 +0800)
committerJosef Schlehofer <redacted>
Tue, 9 Jun 2026 11:17:25 +0000 (13:17 +0200)
- Fix loop in subshells calling wait builtin with inherited job list
- Fix mapfile problem when callback unsets the variable it is modifying
- Fix subshells inappropriately running the EXIT trap if they receive a
  fatal signal before resetting traps

Signed-off-by: Wei-Ting Yang <redacted>
14 files changed:
utils/bash/Makefile
utils/bash/patches/000-bash_5.3_patch_1.patch [moved from utils/bash/patches/000-bash-5.3-patch-1.patch with 100% similarity]
utils/bash/patches/001-bash_5.3_patch_2.patch [moved from utils/bash/patches/001-bash-5.3-patch-2.patch with 100% similarity]
utils/bash/patches/002-bash_5.3_patch_3.patch [moved from utils/bash/patches/002-bash-5.3-patch-3.patch with 100% similarity]
utils/bash/patches/003-bash_5.3_patch_4.patch [moved from utils/bash/patches/003-bash-5.3-patch-4.patch with 100% similarity]
utils/bash/patches/004-bash_5.3_patch_5.patch [moved from utils/bash/patches/004-bash-5.3-patch-5.patch with 100% similarity]
utils/bash/patches/005-bash_5.3_patch_6.patch [moved from utils/bash/patches/005-bash-5.3-patch-6.patch with 100% similarity]
utils/bash/patches/006-bash_5.3_patch_7.patch [moved from utils/bash/patches/006-bash-5.3-patch-7.patch with 100% similarity]
utils/bash/patches/007-bash_5.3_patch_8.patch [moved from utils/bash/patches/007-bash-5.3-patch-8.patch with 100% similarity]
utils/bash/patches/008-bash_5.3_patch_9.patch [moved from utils/bash/patches/008-bash-5.3-patch-9.patch with 100% similarity]
utils/bash/patches/009-bash_5.3_patch_10.patch [new file with mode: 0644]
utils/bash/patches/010-bash_5.3_patch_11.patch [new file with mode: 0644]
utils/bash/patches/011-bash_5.3_patch_12.patch [new file with mode: 0644]
utils/bash/patches/901-startup_files.patch [moved from utils/bash/patches/901-startup-files.patch with 100% similarity]

index 7bd91fd001ffabedd0e1ce5554ff2dbb94146d8b..ba11738f8709c97e02cd748c7f3508d3a0ebc5b8 100644 (file)
@@ -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/009-bash_5.3_patch_10.patch b/utils/bash/patches/009-bash_5.3_patch_10.patch
new file mode 100644 (file)
index 0000000..3e0631d
--- /dev/null
@@ -0,0 +1,27 @@
+From d129c77127233051b8235cbec0cff1d6bea1f5f1 Mon Sep 17 00:00:00 2001
+From: Chet Ramey <chet.ramey@case.edu>
+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 (file)
index 0000000..b0d7122
--- /dev/null
@@ -0,0 +1,45 @@
+From eb9d01914bb2320faaa8bad68859da449884744c Mon Sep 17 00:00:00 2001
+From: Chet Ramey <chet.ramey@case.edu>
+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 (file)
index 0000000..d0e4bec
--- /dev/null
@@ -0,0 +1,48 @@
+From ecb2456d6357bfd3b2965aafe2f2021d1ced5b72 Mon Sep 17 00:00:00 2001
+From: Chet Ramey <chet.ramey@case.edu>
+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);
+ }
git clone https://git.99rst.org/PROJECT