diff --git a/modbuild/files/bash53-010 b/modbuild/files/bash53-010 new file mode 100644 index 0000000..3797675 --- /dev/null +++ b/modbuild/files/bash53-010 @@ -0,0 +1,49 @@ + BASH PATCH REPORT + ================= + +Bash-Release: 5.3 +Patch-ID: bash53-010 + +Bug-Reported-by: Aleksey Covacevice +Bug-Reference-ID: +Bug-Reference-URL: https://lists.gnu.org/archive/html/bug-bash/2026-01/msg00003.html + +Bug-Description: + +Patch (apply with `patch -p0'): + +Under some circumstances, a subshell or asynchronous job with an active +EXIT trap that contains a call to `wait' can loop trying to wait for +processes that are not its children. It usually inherits these jobs from +its parent in the jobs list. + +*** ../bash-5.3-patched/jobs.c Fri Jul 25 08:53:22 2025 +--- jobs.c Fri Jan 9 10:21:03 2026 +*************** +*** 2840,2844 **** + ps->status = (r < 0 || r > 256) ? 127 : r; + } +! if (r == -1 && errno == ECHILD) + { + /* If we're mistaken about job state, compensate. */ +--- 2842,2846 ---- + ps->status = (r < 0 || r > 256) ? 127 : r; + } +! if ((r < 0 || r > 256) && errno == ECHILD) + { + /* If we're mistaken about job state, compensate. */ +*** ../bash-5.3/patchlevel.h 2020-06-22 14:51:03.000000000 -0400 +--- patchlevel.h 2020-10-01 11:01:28.000000000 -0400 +*************** +*** 26,30 **** + looks for to find the patch level (for the sccs version string). */ + +! #define PATCHLEVEL 9 + + #endif /* _PATCHLEVEL_H_ */ +--- 26,30 ---- + looks for to find the patch level (for the sccs version string). */ + +! #define PATCHLEVEL 10 + + #endif /* _PATCHLEVEL_H_ */ diff --git a/modbuild/files/bash53-011 b/modbuild/files/bash53-011 new file mode 100644 index 0000000..5aa8b92 --- /dev/null +++ b/modbuild/files/bash53-011 @@ -0,0 +1,70 @@ + BASH PATCH REPORT + ================= + +Bash-Release: 5.3 +Patch-ID: bash53-011 + +Bug-Reported-by: Philippe Grégoire +Bug-Reference-ID: +Bug-Reference-URL: + +Bug-Description: + +If a `mapfile' callback unsets the array variable `mapfile' is using to save +the lines it reads, `mapfile' can try to reference freed memory, which can +cause corruption or shell crashes. + +Patch (apply with `patch -p0'): + +*** ../bash-5.3-patched/builtins/mapfile.def Mon May 6 11:58:48 2024 +--- builtins/mapfile.def Mon May 25 16:23:50 2026 +*************** +*** 154,160 **** + 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. */ + entry = builtin_find_indexed_array (array_name, flags & MAPF_CLEARARRAY); + if (entry == 0) +--- 154,158 ---- + unbuffered_read = 0; + +! /* The following check should be done before reading any lines. */ + entry = builtin_find_indexed_array (array_name, flags & MAPF_CLEARARRAY); + if (entry == 0) +*************** +*** 202,207 **** + } + +! /* XXX - bad things can happen if the callback modifies ENTRY, e.g., +! unsetting it or changing it to a non-indexed-array type. */ + bind_array_element (entry, array_index, line, 0); + +--- 200,210 ---- + } + +! /* 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); + +*** ../bash-5.3/patchlevel.h 2020-06-22 14:51:03.000000000 -0400 +--- patchlevel.h 2020-10-01 11:01:28.000000000 -0400 +*************** +*** 26,30 **** + looks for to find the patch level (for the sccs version string). */ + +! #define PATCHLEVEL 10 + + #endif /* _PATCHLEVEL_H_ */ +--- 26,30 ---- + looks for to find the patch level (for the sccs version string). */ + +! #define PATCHLEVEL 11 + + #endif /* _PATCHLEVEL_H_ */ diff --git a/modbuild/files/bash53-012 b/modbuild/files/bash53-012 new file mode 100644 index 0000000..aac53bc --- /dev/null +++ b/modbuild/files/bash53-012 @@ -0,0 +1,80 @@ + BASH PATCH REPORT + ================= + +Bash-Release: 5.3 +Patch-ID: bash53-012 + +Bug-Reported-by: earl_chew@yahoo.com +Bug-Reference-ID: +Bug-Reference-URL: https://savannah.gnu.org/bugs/?67745 + +Bug-Description: + +If a subshell with an inherited EXIT trap receives a fatal signal before +it clears the exit trap, and before it restores its original signal +handlers, it's possible for it to inappropriately run the inherited EXIT +trap. + +Patch (apply with `patch -p0'): + +*** ../bash-5.3-patched/execute_cmd.c Thu Jun 5 11:02:01 2025 +--- execute_cmd.c Fri Jan 9 10:21:30 2026 +*************** +*** 1644,1648 **** + if (user_subshell) + { +! subshell_environment = SUBSHELL_PAREN; /* XXX */ + if (asynchronous) + subshell_environment |= SUBSHELL_ASYNC; +--- 1681,1685 ---- + if (user_subshell) + { +! subshell_environment = SUBSHELL_PAREN|SUBSHELL_IGNTRAP; /* XXX */ + if (asynchronous) + subshell_environment |= SUBSHELL_ASYNC; +*************** +*** 1650,1654 **** + else + { +! subshell_environment = 0; /* XXX */ + if (asynchronous) + subshell_environment |= SUBSHELL_ASYNC; +--- 1687,1691 ---- + else + { +! subshell_environment = SUBSHELL_IGNTRAP; /* XXX */ + if (asynchronous) + subshell_environment |= SUBSHELL_ASYNC; +*** ../bash-5.3-patched/sig.c Wed Dec 18 15:52:06 2024 +--- sig.c Fri Jan 9 10:21:43 2026 +*************** +*** 639,643 **** + comsub_ignore_return = return_catch_flag = wait_intr_flag = 0; + +! run_exit_trap (); /* XXX - run exit trap possibly in signal context? */ + + kill_shell (sig); +--- 645,652 ---- + comsub_ignore_return = return_catch_flag = wait_intr_flag = 0; + +! /* 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); +*** ../bash-5.3/patchlevel.h 2020-06-22 14:51:03.000000000 -0400 +--- patchlevel.h 2020-10-01 11:01:28.000000000 -0400 +*************** +*** 26,30 **** + looks for to find the patch level (for the sccs version string). */ + +! #define PATCHLEVEL 11 + + #endif /* _PATCHLEVEL_H_ */ +--- 26,30 ---- + looks for to find the patch level (for the sccs version string). */ + +! #define PATCHLEVEL 12 + + #endif /* _PATCHLEVEL_H_ */ diff --git a/modbuild/files/bash53-013 b/modbuild/files/bash53-013 new file mode 100644 index 0000000..16ff707 --- /dev/null +++ b/modbuild/files/bash53-013 @@ -0,0 +1,54 @@ + BASH PATCH REPORT + ================= + +Bash-Release: 5.3 +Patch-ID: bash53-013 + +Bug-Reported-by: Florian Schmaus +Bug-Reference-ID: +Bug-Reference-URL: https://savannah.gnu.org/bugs/?67586 + +Bug-Description: + +Comparing the value of a pointer returned from realloc/xrealloc to the +original pointer passed is technically undefined behavior, which matters +under some circumstances. + +Patch (apply with `patch -p0'): + +*** ../bash-5.3-patched/builtins/read.def Wed Jun 25 15:50:18 2025 +--- builtins/read.def Thu Nov 20 15:10:20 2025 +*************** +*** 789,794 **** + x = (char *)xrealloc (input_string, size += 128); + +! /* Only need to change unwind-protect if input_string changes */ + if (x != input_string) + { + input_string = x; +--- 816,824 ---- + x = (char *)xrealloc (input_string, size += 128); + +! #if 0 +! /* This is, in theory, undefined behavior, since input_string may +! have been freed. */ + if (x != input_string) ++ #endif + { + input_string = x; + +*** ../bash-5.3/patchlevel.h 2020-06-22 14:51:03.000000000 -0400 +--- patchlevel.h 2020-10-01 11:01:28.000000000 -0400 +*************** +*** 26,30 **** + looks for to find the patch level (for the sccs version string). */ + +! #define PATCHLEVEL 12 + + #endif /* _PATCHLEVEL_H_ */ +--- 26,30 ---- + looks for to find the patch level (for the sccs version string). */ + +! #define PATCHLEVEL 13 + + #endif /* _PATCHLEVEL_H_ */ diff --git a/modbuild/files/bash53-014 b/modbuild/files/bash53-014 new file mode 100644 index 0000000..d52d34d --- /dev/null +++ b/modbuild/files/bash53-014 @@ -0,0 +1,68 @@ + BASH PATCH REPORT + ================= + +Bash-Release: 5.3 +Patch-ID: bash53-014 + +Bug-Reported-by: Grisha Levit +Bug-Reference-ID: +Bug-Reference-URL: https://lists.gnu.org/archive/html/bug-bash/2026-06/msg00022.html + +Bug-Description: + +Bash-5.3 patch 11 included an inadvertent extra line, which this patch +removes. This also takes the opportunity to improve that patch, by looking +up the variable each time through the line-reading loop only if there is +a callback and it is invoked. + +Patch (apply with `patch -p0'): + +*** ../bash-5.3-patched/builtins/mapfile.def Sat Jun 6 13:31:02 2026 +--- builtins/mapfile.def Sat Jun 6 13:51:55 2026 +*************** +*** 198,211 **** + + run_callback (callback, array_index, line); +- } + +! /* 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? */ +--- 198,211 ---- + + run_callback (callback, array_index, line); + +! /* 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; +! } +! else +! bind_array_element (entry, array_index, line, 0); + + /* Have we exceeded # of lines to store? */ + +*** ../bash-5.3/patchlevel.h 2020-06-22 14:51:03.000000000 -0400 +--- patchlevel.h 2020-10-01 11:01:28.000000000 -0400 +*************** +*** 26,30 **** + looks for to find the patch level (for the sccs version string). */ + +! #define PATCHLEVEL 13 + + #endif /* _PATCHLEVEL_H_ */ +--- 26,30 ---- + looks for to find the patch level (for the sccs version string). */ + +! #define PATCHLEVEL 14 + + #endif /* _PATCHLEVEL_H_ */ diff --git a/modbuild/files/bash53-015 b/modbuild/files/bash53-015 new file mode 100644 index 0000000..861b3ca --- /dev/null +++ b/modbuild/files/bash53-015 @@ -0,0 +1,79 @@ + BASH PATCH REPORT + ================= + +Bash-Release: 5.3 +Patch-ID: bash53-015 + +Bug-Reported-by: Duncan Roe + Grisha Levit +Bug-Reference-ID: +Bug-Reference-URL: https://lists.gnu.org/archive/html/bug-bash/2025-09/msg00162.html + https://lists.gnu.org/archive/html/bug-bash/2025-10/msg00013.html + +Bug-Description: + +There are circumstances under which index -1 is used to reference into +the input buffer used by the `read' builtin. + +Patch (apply with `patch -p0'): + +*** ../bash-5.3-patched/builtins/read.def Wed Jun 25 15:50:18 2025 +--- builtins/read.def Thu Nov 6 16:51:14 2025 +*************** +*** 539,543 **** + protects, then restore input_string so we can use it later */ + orig_input_string = 0; +! input_string[i] = '\0'; /* make sure it's terminated */ + if (i == 0) + { +--- 568,573 ---- + protects, then restore input_string so we can use it later */ + orig_input_string = 0; +! if (i >= 0) +! input_string[i] = '\0'; /* make sure it's terminated */ + if (i == 0) + { +*************** +*** 593,598 **** + + ttset = ttattrs; +! i = silent ? ttfd_cbreak (fd, &ttset) : ttfd_onechar (fd, &ttset); +! if (i < 0) + sh_ttyerror (1); + tty_modified = 1; +--- 623,627 ---- + + ttset = ttattrs; +! if ((silent ? ttfd_cbreak (fd, &ttset) : ttfd_onechar (fd, &ttset)) < 0) + sh_ttyerror (1); + tty_modified = 1; +*************** +*** 610,615 **** + + ttset = ttattrs; +! i = ttfd_noecho (fd, &ttset); /* ttnoecho (); */ +! if (i < 0) + sh_ttyerror (1); + +--- 639,643 ---- + + ttset = ttattrs; +! if (ttfd_noecho (fd, &ttset) < 0) + sh_ttyerror (1); + + +*** ../bash-5.3/patchlevel.h 2020-06-22 14:51:03.000000000 -0400 +--- patchlevel.h 2020-10-01 11:01:28.000000000 -0400 +*************** +*** 26,30 **** + looks for to find the patch level (for the sccs version string). */ + +! #define PATCHLEVEL 14 + + #endif /* _PATCHLEVEL_H_ */ +--- 26,30 ---- + looks for to find the patch level (for the sccs version string). */ + +! #define PATCHLEVEL 15 + + #endif /* _PATCHLEVEL_H_ */ diff --git a/modbuild/files/bash53-016 b/modbuild/files/bash53-016 new file mode 100644 index 0000000..6aff324 --- /dev/null +++ b/modbuild/files/bash53-016 @@ -0,0 +1,136 @@ + BASH PATCH REPORT + ================= + +Bash-Release: 5.3 +Patch-ID: bash53-016 + +Bug-Reported-by: Ethan Pini +Bug-Reference-ID: +Bug-Reference-URL: https://lists.gnu.org/archive/html/bug-bash/2026-06/msg00126.html + +Bug-Description: + +On recent versions of macOS, the pipe size is dynamic and changes due to +system-wide total pipe usage, so we have to check whether or not bash can +use the size determined at compile time. + +Patch (apply with `patch -p0'): + +*** ../bash-5.3-patched/redir.c Fri Mar 7 18:49:37 2025 +--- redir.c Tue Jul 7 11:21:09 2026 +*************** +*** 473,477 **** +--- 473,500 ---- + #endif + ++ #if defined (PIPESIZE_DYNAMIC) ++ /* If we can't count on the pipe size determined at compile time to be ++ constant across systems, define PIPESIZE_DYNAMIC in configure.ac. ++ We set the pipe's write end to be non-blocking, try to write, and ++ fall back to a temp file on error. */ ++ if (sh_setnodelay (herepipe[1]) < 0) ++ { ++ close (herepipe[0]); ++ close (herepipe[1]); ++ goto use_tempfile; ++ } ++ #endif ++ + r = heredoc_write (herepipe[1], document, document_len); ++ ++ #if defined (PIPESIZE_DYNAMIC) ++ if (r == ENOSPC || r == EAGAIN) ++ { ++ close (herepipe[0]); ++ close (herepipe[1]); ++ goto use_tempfile; ++ } ++ #endif ++ + if (document != redirectee->word) + free (document); +*** ../bash-5.3-patched/general.c Wed Jun 25 15:54:35 2025 +--- general.c Tue Jul 7 11:12:10 2026 +*************** +*** 596,599 **** +--- 596,620 ---- + } + ++ int ++ sh_setnodelay (int fd) ++ { ++ int flags; ++ ++ if ((flags = fcntl (fd, F_GETFL, 0)) < 0) ++ return -1; ++ ++ /* This is defined to O_NDELAY in filecntl.h if O_NONBLOCK is not present ++ and O_NDELAY is defined. */ ++ #ifdef O_NONBLOCK ++ flags |= O_NONBLOCK; ++ #endif ++ ++ #ifdef O_NDELAY ++ flags |= O_NDELAY; ++ #endif ++ ++ return (fcntl (fd, F_SETFL, flags)); ++ } ++ + /* Just a wrapper for the define in include/filecntl.h */ + int +*** ../bash-5.3-patched/general.h Wed Jun 25 15:52:47 2025 +--- general.h Tue Jul 7 11:13:48 2026 +*************** +*** 318,321 **** +--- 318,322 ---- + + extern int sh_unset_nodelay_mode (int); ++ extern int sh_setnodelay (int); + extern int sh_setclexec (int); + extern int sh_validfd (int); +*** ../bash-5.3-patched/configure.ac Mon Jun 30 10:05:24 2025 +--- configure.ac Tue Jul 7 11:25:32 2026 +*************** +*** 1210,1214 **** + isc*) LOCAL_CFLAGS=-Disc386 ;; + rhapsody*) LOCAL_CFLAGS=-DRHAPSODY ;; +! darwin*) LOCAL_CFLAGS=-DMACOSX ;; + sco3.2v5*) LOCAL_CFLAGS="-b elf -DWAITPID_BROKEN -DPATH_MAX=1024" ;; + sco3.2v4*) LOCAL_CFLAGS="-DMUST_UNBLOCK_CHLD -DPATH_MAX=1024" ;; +--- 1210,1214 ---- + isc*) LOCAL_CFLAGS=-Disc386 ;; + rhapsody*) LOCAL_CFLAGS=-DRHAPSODY ;; +! darwin*) LOCAL_CFLAGS="-DMACOSX -DPIPESIZE_DYNAMIC" ;; + sco3.2v5*) LOCAL_CFLAGS="-b elf -DWAITPID_BROKEN -DPATH_MAX=1024" ;; + sco3.2v4*) LOCAL_CFLAGS="-DMUST_UNBLOCK_CHLD -DPATH_MAX=1024" ;; +*** ../bash-5.3-patched/configure Mon Jun 30 10:05:30 2025 +--- configure Tue Jul 7 11:25:36 2026 +*************** +*** 23134,23138 **** + isc*) LOCAL_CFLAGS=-Disc386 ;; + rhapsody*) LOCAL_CFLAGS=-DRHAPSODY ;; +! darwin*) LOCAL_CFLAGS=-DMACOSX ;; + sco3.2v5*) LOCAL_CFLAGS="-b elf -DWAITPID_BROKEN -DPATH_MAX=1024" ;; + sco3.2v4*) LOCAL_CFLAGS="-DMUST_UNBLOCK_CHLD -DPATH_MAX=1024" ;; +--- 23134,23138 ---- + isc*) LOCAL_CFLAGS=-Disc386 ;; + rhapsody*) LOCAL_CFLAGS=-DRHAPSODY ;; +! darwin*) LOCAL_CFLAGS="-DMACOSX -DPIPESIZE_DYNAMIC" ;; + sco3.2v5*) LOCAL_CFLAGS="-b elf -DWAITPID_BROKEN -DPATH_MAX=1024" ;; + sco3.2v4*) LOCAL_CFLAGS="-DMUST_UNBLOCK_CHLD -DPATH_MAX=1024" ;; +*** ../bash-5.3/patchlevel.h 2020-06-22 14:51:03.000000000 -0400 +--- patchlevel.h 2020-10-01 11:01:28.000000000 -0400 +*************** +*** 26,30 **** + looks for to find the patch level (for the sccs version string). */ + +! #define PATCHLEVEL 15 + + #endif /* _PATCHLEVEL_H_ */ +--- 26,30 ---- + looks for to find the patch level (for the sccs version string). */ + +! #define PATCHLEVEL 16 + + #endif /* _PATCHLEVEL_H_ */ diff --git a/modbuild/files/bash53-017 b/modbuild/files/bash53-017 new file mode 100644 index 0000000..6861796 --- /dev/null +++ b/modbuild/files/bash53-017 @@ -0,0 +1,62 @@ + BASH PATCH REPORT + ================= + +Bash-Release: 5.3 +Patch-ID: bash53-017 + +Bug-Reported-by: Lennart Ackermans +Bug-Reference-ID: +Bug-Reference-URL: https://lists.gnu.org/archive/html/bug-bash/2026-05/msg00066.html + +Bug-Description: + +If readline is invoked with the cursor somewhere other than column 0, and +the prompt contains multibyte characters, the display algorithm needs to +use a buffer offset, instead of the physical prompt length, to determine +whether or not to reprint the prompt from column 0 because the cursor is +before the last invisible character in the prompt string. + +Patch (apply with `patch -p0'): + +*** ../bash-5.3-patched/lib/readline/display.c Thu Sep 4 11:55:37 2025 +--- lib/readline/display.c Fri May 22 14:55:01 2026 +*************** +*** 1498,1502 **** + only need to reprint it if the cursor is before the last + invisible character in the prompt string. */ +- /* XXX - why not use local_prompt_len? */ + nleft = prompt_visible_length + wrap_offset; + if (cursor_linenum == prompt_last_screen_line) +--- 1498,1501 ---- +*************** +*** 1510,1518 **** + buffer position, an index into curline + (local_prompt + pmt_offset) */ +! cursor_bufpos = pmt_offset; +! if (mb_cur_max == 1 || rl_byte_oriented) +! cursor_bufpos += _rl_last_c_pos; +! else +! cursor_bufpos += _rl_last_c_pos + curline_invchars; + + if (local_prompt && local_prompt_invis_chars[cursor_linenum] && +--- 1509,1513 ---- + buffer position, an index into curline + (local_prompt + pmt_offset) */ +! cursor_bufpos = pmt_offset + local_prompt_len; + + if (local_prompt && local_prompt_invis_chars[cursor_linenum] && +*** ../bash-5.3/patchlevel.h 2020-06-22 14:51:03.000000000 -0400 +--- patchlevel.h 2020-10-01 11:01:28.000000000 -0400 +*************** +*** 26,30 **** + looks for to find the patch level (for the sccs version string). */ + +! #define PATCHLEVEL 16 + + #endif /* _PATCHLEVEL_H_ */ +--- 26,30 ---- + looks for to find the patch level (for the sccs version string). */ + +! #define PATCHLEVEL 17 + + #endif /* _PATCHLEVEL_H_ */ diff --git a/modbuild/files/bash53-018 b/modbuild/files/bash53-018 new file mode 100644 index 0000000..070e60d --- /dev/null +++ b/modbuild/files/bash53-018 @@ -0,0 +1,71 @@ + BASH PATCH REPORT + ================= + +Bash-Release: 5.3 +Patch-ID: bash53-018 + +Bug-Reported-by: Ben Kallus + Derek Schrock +Bug-Reference-ID: + +Bug-Reference-URL: https://lists.gnu.org/archive/html/bug-readline/2026-06/msg00005.html + https://lists.gnu.org/archive/html/bug-readline/2026-06/msg00002.html + +Bug-Description: + +Patch (apply with `patch -p0'): + +This patch fixes two problems with the redisplay code. The first is a +crash that results if the initial prompt contains more than 256 wrapped +lines. The second is a fix to the redisplay code when the first several +characters of the prompt string are identical, but the prompt has changed +and needs to be redrawn. If these first few characters are part of an escape +sequence, the entire sequence needs to be redrawn. + +*** ../bash-5.3-patched/lib/readline/display.c Fri May 22 14:55:01 2026 +--- lib/readline/display.c Fri Jun 26 11:08:53 2026 +*************** +*** 1025,1028 **** +--- 1025,1029 ---- + { + temp = local_prompt_newlines[newlines+1]; ++ CHECK_INV_LBREAKS (); + inv_lbreaks[++newlines] = temp; + } +*************** +*** 2262,2270 **** + nd = nfd - new; /* nd, od are buffer indexes */ + if (current_line == 0 && !_rl_horizontal_scroll_mode && +! _rl_term_cr && lendiff > prompt_visible_length && _rl_last_c_pos > 0 && + (((od > 0 || nd > 0) && (od <= prompt_last_invisible || nd <= prompt_last_invisible)) || + ((od >= lendiff) && _rl_last_c_pos < PROMPT_ENDING_INDEX))) + { +! _rl_cr (); + if (modmark) + _rl_output_some_chars ("*", 1); +--- 2266,2275 ---- + nd = nfd - new; /* nd, od are buffer indexes */ + if (current_line == 0 && !_rl_horizontal_scroll_mode && +! _rl_term_cr && lendiff > prompt_visible_length && _rl_last_c_pos >= 0 && + (((od > 0 || nd > 0) && (od <= prompt_last_invisible || nd <= prompt_last_invisible)) || + ((od >= lendiff) && _rl_last_c_pos < PROMPT_ENDING_INDEX))) + { +! if (_rl_last_c_pos > 0) +! _rl_cr (); + if (modmark) + _rl_output_some_chars ("*", 1); +*** ../bash-5.3/patchlevel.h 2020-06-22 14:51:03.000000000 -0400 +--- patchlevel.h 2020-10-01 11:01:28.000000000 -0400 +*************** +*** 26,30 **** + looks for to find the patch level (for the sccs version string). */ + +! #define PATCHLEVEL 17 + + #endif /* _PATCHLEVEL_H_ */ +--- 26,30 ---- + looks for to find the patch level (for the sccs version string). */ + +! #define PATCHLEVEL 18 + + #endif /* _PATCHLEVEL_H_ */ diff --git a/modbuild/files/bash53-019 b/modbuild/files/bash53-019 new file mode 100644 index 0000000..e70e5e9 --- /dev/null +++ b/modbuild/files/bash53-019 @@ -0,0 +1,133 @@ + BASH PATCH REPORT + ================= + +Bash-Release: 5.3 +Patch-ID: bash53-019 + +Bug-Reported-by: zheng +Bug-Reference-ID: +Bug-Reference-URL: https://lists.gnu.org/archive/html/bug-bash/2026-08/msg00010.html + +Bug-Description: + +On some systems, macOS in particular, isalpha(3) returns true for bytes +between 128 and 255. Bash uses this to determine whether or not these +characters are permitted to be part of a shell identifier, and can +consume one byte too many when determining the end of a variable name. + +Patch (apply with `patch -p0'): + +*** ../bash-5.3-patched/syntax.h Mon Sep 14 10:20:05 2020 +--- syntax.h Thu Aug 6 14:11:25 2026 +*************** +*** 64,67 **** +--- 64,69 ---- + #define CSUBSTOP 0x1000 /* values of OP for ${word[:]OPstuff} */ + #define CBLANK 0x2000 /* whitespace (blank) character */ ++ #define CNAME 0x4000 /* POSIX name character ([_0-9a-zA-Z]) */ ++ #define CNAMESTART 0x8000 /* POSIX name start character ([_a-zA-Z]) */ + + /* Defines for use by the rest of the shell. */ +*** ../bash-5.3-patched/mksyntax.c Thu May 16 15:35:55 2024 +--- mksyntax.c Wed Aug 5 15:27:45 2026 +*************** +*** 61,64 **** +--- 61,66 ---- + { CSUBSTOP, "CSUBSTOP" }, + { CBLANK, "CBLANK" }, ++ { CNAME, "CNAME" }, ++ { CNAMESTART, "CNAMESTART" } + }; + +*************** +*** 199,202 **** +--- 201,243 ---- + } + ++ static void ++ setnamechars(void) ++ { ++ lsyntax['_'] |= CNAME|CNAMESTART; ++ ++ lsyntax['0'] |= CNAME; lsyntax['1'] |= CNAME; lsyntax['2'] |= CNAME; ++ lsyntax['3'] |= CNAME; lsyntax['4'] |= CNAME; lsyntax['5'] |= CNAME; ++ lsyntax['6'] |= CNAME; lsyntax['7'] |= CNAME; lsyntax['8'] |= CNAME; ++ lsyntax['9'] |= CNAME; ++ ++ lsyntax['a'] |= CNAME|CNAMESTART; lsyntax['b'] |= CNAME|CNAMESTART; ++ lsyntax['c'] |= CNAME|CNAMESTART; lsyntax['d'] |= CNAME|CNAMESTART; ++ lsyntax['e'] |= CNAME|CNAMESTART; lsyntax['f'] |= CNAME|CNAMESTART; ++ lsyntax['g'] |= CNAME|CNAMESTART; lsyntax['h'] |= CNAME|CNAMESTART; ++ lsyntax['i'] |= CNAME|CNAMESTART; lsyntax['j'] |= CNAME|CNAMESTART; ++ lsyntax['k'] |= CNAME|CNAMESTART; lsyntax['l'] |= CNAME|CNAMESTART; ++ lsyntax['m'] |= CNAME|CNAMESTART; lsyntax['n'] |= CNAME|CNAMESTART; ++ lsyntax['o'] |= CNAME|CNAMESTART; lsyntax['p'] |= CNAME|CNAMESTART; ++ lsyntax['q'] |= CNAME|CNAMESTART; lsyntax['r'] |= CNAME|CNAMESTART; ++ lsyntax['s'] |= CNAME|CNAMESTART; lsyntax['t'] |= CNAME|CNAMESTART; ++ lsyntax['u'] |= CNAME|CNAMESTART; lsyntax['v'] |= CNAME|CNAMESTART; ++ lsyntax['w'] |= CNAME|CNAMESTART; lsyntax['x'] |= CNAME|CNAMESTART; ++ lsyntax['y'] |= CNAME|CNAMESTART; lsyntax['z'] |= CNAME|CNAMESTART; ++ ++ lsyntax['A'] |= CNAME|CNAMESTART; lsyntax['B'] |= CNAME|CNAMESTART; ++ lsyntax['C'] |= CNAME|CNAMESTART; lsyntax['D'] |= CNAME|CNAMESTART; ++ lsyntax['E'] |= CNAME|CNAMESTART; lsyntax['F'] |= CNAME|CNAMESTART; ++ lsyntax['G'] |= CNAME|CNAMESTART; lsyntax['H'] |= CNAME|CNAMESTART; ++ lsyntax['I'] |= CNAME|CNAMESTART; lsyntax['J'] |= CNAME|CNAMESTART; ++ lsyntax['K'] |= CNAME|CNAMESTART; lsyntax['L'] |= CNAME|CNAMESTART; ++ lsyntax['M'] |= CNAME|CNAMESTART; lsyntax['N'] |= CNAME|CNAMESTART; ++ lsyntax['O'] |= CNAME|CNAMESTART; lsyntax['P'] |= CNAME|CNAMESTART; ++ lsyntax['Q'] |= CNAME|CNAMESTART; lsyntax['R'] |= CNAME|CNAMESTART; ++ lsyntax['S'] |= CNAME|CNAMESTART; lsyntax['T'] |= CNAME|CNAMESTART; ++ lsyntax['U'] |= CNAME|CNAMESTART; lsyntax['V'] |= CNAME|CNAMESTART; ++ lsyntax['W'] |= CNAME|CNAMESTART; lsyntax['X'] |= CNAME|CNAMESTART; ++ lsyntax['Y'] |= CNAME|CNAMESTART; lsyntax['Z'] |= CNAME|CNAMESTART; ++ } ++ + /* load up the correct flag values in lsyntax */ + static void +*************** +*** 235,238 **** +--- 276,281 ---- + + addblanks (); ++ ++ setnamechars (); + } + +*** ../bash-5.3-patched/general.h Tue Jul 7 11:13:48 2026 +--- general.h Thu Aug 6 14:07:22 2026 +*************** +*** 111,116 **** + + /* Define exactly what a legal shell identifier consists of. */ +! #define legal_variable_starter(c) (ISALPHA(c) || (c == '_')) +! #define legal_variable_char(c) (ISALNUM(c) || c == '_') + + /* Definitions used in subst.c and by the `read' builtin for field +--- 111,121 ---- + + /* Define exactly what a legal shell identifier consists of. */ +! #if 0 +! #define legal_variable_starter(c) (c < 128 && (ISALPHA(c) || c == '_')) +! #define legal_variable_char(c) (c < 128 && (ISALNUM(c) || c == '_')) +! #else +! #define legal_variable_starter(c) (sh_syntaxtab[c] & CNAMESTART) +! #define legal_variable_char(c) (sh_syntaxtab[c] & CNAME) +! #endif + + /* Definitions used in subst.c and by the `read' builtin for field +*** ../bash-5.3/patchlevel.h 2020-06-22 14:51:03.000000000 -0400 +--- patchlevel.h 2020-10-01 11:01:28.000000000 -0400 +*************** +*** 26,30 **** + looks for to find the patch level (for the sccs version string). */ + +! #define PATCHLEVEL 18 + + #endif /* _PATCHLEVEL_H_ */ +--- 26,30 ---- + looks for to find the patch level (for the sccs version string). */ + +! #define PATCHLEVEL 19 + + #endif /* _PATCHLEVEL_H_ */ diff --git a/modbuild/files/bash53-020 b/modbuild/files/bash53-020 new file mode 100644 index 0000000..1e27d19 --- /dev/null +++ b/modbuild/files/bash53-020 @@ -0,0 +1,51 @@ + BASH PATCH REPORT + ================= + +Bash-Release: 5.3 +Patch-ID: bash53-020 + +Bug-Reported-by: Félix Bouynot +Bug-Reference-ID: <39c9472ddcf23881693380c4b895dd3799b45cec.camel@setenforce.one> +Bug-Reference-URL: https://lists.gnu.org/archive/html/bug-bash/2026-05/msg00065.html + +Bug-Description: + +If readline handles a SIGWINCH and resizes its idea of the screen +dimensions, it needs to recompute the columns where the prompt wraps +lines every time, not just when the screen width decreases. + +Patch (apply with `patch -p0'): + +*** ../bash-5.3-patched/lib/readline/display.c Thu Sep 4 11:55:37 2025 +--- lib/readline/display.c Fri May 22 14:55:01 2026 +*************** +*** 3526,3531 **** + rl_crlf (); + +! if (_rl_screenwidth < prompt_visible_length) +! _rl_reset_prompt (); /* update local_prompt_newlines array */ + + /* Redraw only the last line of a multi-line prompt. */ +--- 3521,3527 ---- + rl_crlf (); + +! /* Let expand_prompt() update local_prompt_newlines and local_prompt_invis_chars +! arrays */ +! _rl_reset_prompt (); + + /* Redraw only the last line of a multi-line prompt. */ +*** ../bash-5.3/patchlevel.h 2020-06-22 14:51:03.000000000 -0400 +--- patchlevel.h 2020-10-01 11:01:28.000000000 -0400 +*************** +*** 26,30 **** + looks for to find the patch level (for the sccs version string). */ + +! #define PATCHLEVEL 19 + + #endif /* _PATCHLEVEL_H_ */ +--- 26,30 ---- + looks for to find the patch level (for the sccs version string). */ + +! #define PATCHLEVEL 20 + + #endif /* _PATCHLEVEL_H_ */ diff --git a/modbuild/files/config.yaml b/modbuild/files/config.yaml index 4333b6e..0d25cef 100644 --- a/modbuild/files/config.yaml +++ b/modbuild/files/config.yaml @@ -22,7 +22,7 @@ modbuild: - name: yq version: 4.54.1 - name: bash - version: 5.3.9 + version: 5.3.20 - name: patchelf version: 0.14.5 2.1.4;2.2.0: @@ -55,9 +55,35 @@ modbuild: bash: type: sub_package defaults: + configure_args: + - --bindir=${PREFIX}/libexec shasums: bash-5.3.tar.gz: 0d5cd86965f869a26cf64f4b71be7b96f90a3ba8b3d74e27e8e9d9d5550f31ba versions: + 5.3.20: + config: + urls: + - url: https://ftp.gnu.org/gnu/bash/bash-5.3.tar.gz + - patch_file: files/bash53-001 + - patch_file: files/bash53-002 + - patch_file: files/bash53-003 + - patch_file: files/bash53-004 + - patch_file: files/bash53-005 + - patch_file: files/bash53-006 + - patch_file: files/bash53-007 + - patch_file: files/bash53-008 + - patch_file: files/bash53-009 + - patch_file: files/bash53-010 + - patch_file: files/bash53-011 + - patch_file: files/bash53-012 + - patch_file: files/bash53-013 + - patch_file: files/bash53-014 + - patch_file: files/bash53-015 + - patch_file: files/bash53-016 + - patch_file: files/bash53-017 + - patch_file: files/bash53-018 + - patch_file: files/bash53-019 + - patch_file: files/bash53-020 5.3.9: config: urls: @@ -71,8 +97,6 @@ bash: - patch_file: files/bash53-007 - patch_file: files/bash53-008 - patch_file: files/bash53-009 - configure_args: - - --bindir=${PREFIX}/libexec yq: type: sub_package shasums: