From cf6fb6f5acfcefcec2faf52f3a782e732ad09185 Mon Sep 17 00:00:00 2001 From: Rmys Date: Mon, 1 Dec 2025 21:52:04 +0300 Subject: [PATCH] bash ver. bump --- .../base/bash/files/official/bash53-004.patch | 47 ++++ .../base/bash/files/official/bash53-005.patch | 42 ++++ .../base/bash/files/official/bash53-006.patch | 48 ++++ .../base/bash/files/official/bash53-007.patch | 56 +++++ .../base/bash/files/official/bash53-008.patch | 231 ++++++++++++++++++ system/base/bash/pspec.xml | 12 + 6 files changed, 436 insertions(+) create mode 100644 system/base/bash/files/official/bash53-004.patch create mode 100644 system/base/bash/files/official/bash53-005.patch create mode 100644 system/base/bash/files/official/bash53-006.patch create mode 100644 system/base/bash/files/official/bash53-007.patch create mode 100644 system/base/bash/files/official/bash53-008.patch diff --git a/system/base/bash/files/official/bash53-004.patch b/system/base/bash/files/official/bash53-004.patch new file mode 100644 index 00000000..5d7705c0 --- /dev/null +++ b/system/base/bash/files/official/bash53-004.patch @@ -0,0 +1,47 @@ + BASH PATCH REPORT + ================= + +Bash-Release: 5.3 +Patch-ID: bash53-004 + +Bug-Reported-by: Emanuele Torre +Bug-Reference-ID: +Bug-Reference-URL: https://lists.gnu.org/archive/html/bug-bash/2025-07/msg00031.html + +Bug-Description: + +The Linux kernel reports incorrect sizes for files in /sys/block/*/uevent, +leading bash to report a read error when the byte count does not agree +with the file size from fstat(2). + +Patch (apply with `patch -p0'): + +*** ../bash-5.3-patched/builtins/evalfile.c Fri Sep 6 15:42:40 2024 +--- builtins/evalfile.c Fri Sep 12 11:38:57 2025 +*************** +*** 161,166 **** +--- 161,168 ---- + if (nr >= 0) + string[nr] = '\0'; ++ #if 0 + if (nr != file_size) + nr = -1; /* XXX - didn't get the whole file */ ++ #endif + } + else + +*** ../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 3 + + #endif /* _PATCHLEVEL_H_ */ +--- 26,30 ---- + looks for to find the patch level (for the sccs version string). */ + +! #define PATCHLEVEL 4 + + #endif /* _PATCHLEVEL_H_ */ diff --git a/system/base/bash/files/official/bash53-005.patch b/system/base/bash/files/official/bash53-005.patch new file mode 100644 index 00000000..2bebca8b --- /dev/null +++ b/system/base/bash/files/official/bash53-005.patch @@ -0,0 +1,42 @@ + BASH PATCH REPORT + ================= + +Bash-Release: 5.3 +Patch-ID: bash53-005 + +Bug-Reported-by: chet.ramey@case.edu +Bug-Reference-ID: +Bug-Reference-URL: + +Bug-Description: + +Restoring the default disposition in a subshell for a signal bash treats +specially can cause a crash. + +Patch (apply with `patch -p0'): + +*** ../bash-5.3-patched/trap.c Thu Dec 19 11:35:49 2024 +--- trap.c Fri Nov 7 11:23:31 2025 +*************** +*** 965,968 **** +--- 965,969 ---- + set_signal_handler (sig, SIG_DFL); + change_signal (sig, (char *)DEFAULT_SIG); ++ sigmodes[sig] &= ~SIG_TRAPPED; /* no longer trapped */ + return; + } +*** ../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 4 + + #endif /* _PATCHLEVEL_H_ */ +--- 26,30 ---- + looks for to find the patch level (for the sccs version string). */ + +! #define PATCHLEVEL 5 + + #endif /* _PATCHLEVEL_H_ */ diff --git a/system/base/bash/files/official/bash53-006.patch b/system/base/bash/files/official/bash53-006.patch new file mode 100644 index 00000000..95891a47 --- /dev/null +++ b/system/base/bash/files/official/bash53-006.patch @@ -0,0 +1,48 @@ + BASH PATCH REPORT + ================= + +Bash-Release: 5.3 +Patch-ID: bash53-006 + +Bug-Reported-by: Duncan Roe +Bug-Reference-ID: +Bug-Reference-URL: https://lists.gnu.org/archive/html/bug-bash/2025-09/msg00053.html + +Bug-Description: + +When `globasciiranges' is enabled, glob patterns with ranges in bracket +expressions can produce incorrect matches for character ranges whose +start and end are non-ascii characters. + +Patch (apply with `patch -p0'): + +*** ../bash-5.3-patched/lib/glob/smatch.c Mon May 29 14:15:17 2023 +--- lib/glob/smatch.c Mon Sep 8 12:54:59 2025 +*************** +*** 391,395 **** + return 0; + +! if (forcecoll == 0 && glob_asciirange && c1 <= UCHAR_MAX && c2 <= UCHAR_MAX) + return ((int)(c1 - c2)); + +--- 391,395 ---- + return 0; + +! if (forcecoll == 0 && glob_asciirange) + return ((int)(c1 - c2)); + +*** ../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 5 + + #endif /* _PATCHLEVEL_H_ */ +--- 26,30 ---- + looks for to find the patch level (for the sccs version string). */ + +! #define PATCHLEVEL 6 + + #endif /* _PATCHLEVEL_H_ */ diff --git a/system/base/bash/files/official/bash53-007.patch b/system/base/bash/files/official/bash53-007.patch new file mode 100644 index 00000000..58bc0d71 --- /dev/null +++ b/system/base/bash/files/official/bash53-007.patch @@ -0,0 +1,56 @@ + BASH PATCH REPORT + ================= + +Bash-Release: 5.3 +Patch-ID: bash53-007 + +Bug-Reported-by: jdhedden@gmail.com +Bug-Reference-ID: <689ac876.050a0220.334a3f.30fb@mx.google.com> +Bug-Reference-URL: + +Bug-Description: + +No-fork command substitutions can perform redirections that act on the +enclosing command as well. + +Patch (apply with `patch -p0'): + +*** ../bash-5.3-patched/subst.c Fri Jul 25 08:53:25 2025 +--- subst.c Tue Aug 12 15:41:01 2025 +*************** +*** 207,210 **** +--- 207,212 ---- + extern int extended_quote; + ++ extern REDIRECT *exec_redirection_undo_list, *redirection_undo_list; ++ + #if !defined (HAVE_WCSDUP) && defined (HANDLE_MULTIBYTE) + extern wchar_t *wcsdup (const wchar_t *); +*************** +*** 7001,7004 **** +--- 7003,7011 ---- + } + #endif ++ ++ unwind_protect_pointer (redirection_undo_list); ++ redirection_undo_list = NULL; ++ unwind_protect_pointer (exec_redirection_undo_list); ++ exec_redirection_undo_list = NULL; + + subst_assign_varlist = 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 6 + + #endif /* _PATCHLEVEL_H_ */ +--- 26,30 ---- + looks for to find the patch level (for the sccs version string). */ + +! #define PATCHLEVEL 7 + + #endif /* _PATCHLEVEL_H_ */ diff --git a/system/base/bash/files/official/bash53-008.patch b/system/base/bash/files/official/bash53-008.patch new file mode 100644 index 00000000..4ab99351 --- /dev/null +++ b/system/base/bash/files/official/bash53-008.patch @@ -0,0 +1,231 @@ + BASH PATCH REPORT + ================= + +Bash-Release: 5.3 +Patch-ID: bash53-008 + +Bug-Reported-by: Grisha Levit +Bug-Reference-ID: <20251022174207.10518-1-grishalevit@gmail.com> +Bug-Reference-URL: https://lists.gnu.org/archive/html/bug-bash/2025-10/msg00145.html + +Bug-Description: + +Bash tries to consume entire multibyte characters when looking for backslash +escapes in $'...' strings, and treats too many characters as potentially +beginning a multibyte character in UTF-8 locales. Being more selective about +when to call mbrtowc() can lead to optimized string processing and script +speedups. This patch also handles the unlikely situation of a locale +encoding null wide characters with non-null bytes. + +Patch (apply with `patch -p0'): + +*** ../bash-5.3-patched/lib/sh/strtrans.c Fri Oct 13 11:57:46 2023 +--- lib/sh/strtrans.c Mon Oct 27 14:30:35 2025 +*************** +*** 56,60 **** + unsigned long v; + size_t clen; +! int mb_cur_max; + #if defined (HANDLE_MULTIBYTE) + wchar_t wc; +--- 56,60 ---- + unsigned long v; + size_t clen; +! size_t mb_cur_max; + #if defined (HANDLE_MULTIBYTE) + wchar_t wc; +*************** +*** 64,68 **** + return ((char *)0); + +! mb_cur_max = MB_CUR_MAX; + #if defined (HANDLE_MULTIBYTE) + temp = 4*len + 4; +--- 64,68 ---- + return ((char *)0); + +! mb_cur_max = locale_mb_cur_max; + #if defined (HANDLE_MULTIBYTE) + temp = 4*len + 4; +*************** +*** 80,87 **** + clen = 1; + #if defined (HANDLE_MULTIBYTE) +! if ((locale_utf8locale && (c & 0x80)) || +! (locale_utf8locale == 0 && mb_cur_max > 0 && is_basic (c) == 0)) + { + clen = mbrtowc (&wc, s - 1, mb_cur_max, 0); + if (MB_INVALIDCH (clen)) + clen = 1; +--- 80,91 ---- + clen = 1; + #if defined (HANDLE_MULTIBYTE) +! /* We read an entire multibyte character at a time if we are in a +! locale where a backslash can possibly appear as part of a +! multibyte character. UTF-8 encodings prohibit this. */ +! if (locale_utf8locale == 0 && mb_cur_max > 1 && is_basic (c) == 0) + { + clen = mbrtowc (&wc, s - 1, mb_cur_max, 0); ++ if (MB_NULLWCH (clen)) ++ break; /* it apparently can happen */ + if (MB_INVALIDCH (clen)) + clen = 1; +*************** +*** 228,237 **** + char *r, *ret; + const char *s; +- size_t l, rsize; + unsigned char c; + size_t clen; + int b; +- #if defined (HANDLE_MULTIBYTE) + wchar_t wc; + #endif + +--- 232,241 ---- + char *r, *ret; + const char *s; + unsigned char c; ++ #if defined (HANDLE_MULTIBYTE) + size_t clen; + int b; + wchar_t wc; ++ DECLARE_MBSTATE; + #endif + +*************** +*** 239,245 **** + return ((char *)0); + +! l = strlen (str); +! rsize = 4 * l + 4; +! r = ret = (char *)xmalloc (rsize); + + *r++ = '$'; +--- 243,247 ---- + return ((char *)0); + +! r = ret = (char *)xmalloc (4 * strlen (str) + 4); + + *r++ = '$'; +*************** +*** 248,255 **** + for (s = str; c = *s; s++) + { +- b = 1; /* 1 == add backslash; 0 == no backslash */ +- l = 1; +- clen = 1; +- + switch (c) + { +--- 250,253 ---- +*************** +*** 267,303 **** + default: + #if defined (HANDLE_MULTIBYTE) +! b = is_basic (c); +! /* XXX - clen comparison to 0 is dicey */ +! if ((b == 0 && ((clen = mbrtowc (&wc, s, MB_CUR_MAX, 0)) < 0 || MB_INVALIDCH (clen) || iswprint (wc) == 0)) || +! (b == 1 && ISPRINT (c) == 0)) +! #else +! if (ISPRINT (c) == 0) +! #endif + { +! *r++ = '\\'; +! *r++ = TOCHAR ((c >> 6) & 07); +! *r++ = TOCHAR ((c >> 3) & 07); +! *r++ = TOCHAR (c & 07); +! continue; + } +! l = 0; +! break; +! } +! if (b == 0 && clen == 0) +! break; + +! if (l) +! *r++ = '\\'; +! +! if (clen == 1) +! *r++ = c; +! else +! { +! for (b = 0; b < (int)clen; b++) +! *r++ = (unsigned char)s[b]; +! s += clen - 1; /* -1 because of the increment above */ + } + } + + *r++ = '\''; + *r = '\0'; +--- 265,304 ---- + default: + #if defined (HANDLE_MULTIBYTE) +! if ((locale_utf8locale && (c & 0x80)) || +! (locale_utf8locale == 0 && locale_mb_cur_max > 1 && is_basic (c) == 0)) + { +! clen = mbrtowc (&wc, s, locale_mb_cur_max, &state); +! if (MB_NULLWCH (clen)) +! goto quote_end; +! if (MB_INVALIDCH (clen)) +! INITIALIZE_MBSTATE; +! else if (iswprint (wc)) +! { +! for (b = 0; b < (int)clen; b++) +! *r++ = (unsigned char)s[b]; +! s += clen - 1; /* -1 because of the increment above */ +! continue; +! } + } +! else +! #endif +! if (ISPRINT (c)) +! { +! *r++ = c; +! continue; +! } + +! *r++ = '\\'; +! *r++ = TOCHAR ((c >> 6) & 07); +! *r++ = TOCHAR ((c >> 3) & 07); +! *r++ = TOCHAR (c & 07); +! continue; + } ++ ++ *r++ = '\\'; ++ *r++ = c; + } + ++ quote_end: + *r++ = '\''; + *r = '\0'; +*************** +*** 349,353 **** + { + #if defined (HANDLE_MULTIBYTE) +! if (is_basic (c) == 0) + return (ansic_wshouldquote (s)); + #endif +--- 350,355 ---- + { + #if defined (HANDLE_MULTIBYTE) +! if ((locale_utf8locale && (c & 0x80)) || +! (locale_utf8locale == 0 && locale_mb_cur_max > 1 && is_basic (c) == 0)) + return (ansic_wshouldquote (s)); + #endif + +*** ../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 7 + + #endif /* _PATCHLEVEL_H_ */ +--- 26,30 ---- + looks for to find the patch level (for the sccs version string). */ + +! #define PATCHLEVEL 8 + + #endif /* _PATCHLEVEL_H_ */ diff --git a/system/base/bash/pspec.xml b/system/base/bash/pspec.xml index 2f7b9b52..4463be69 100755 --- a/system/base/bash/pspec.xml +++ b/system/base/bash/pspec.xml @@ -22,6 +22,11 @@ official/bash53-001.patch official/bash53-002.patch official/bash53-003.patch + official/bash53-004.patch + official/bash53-005.patch + official/bash53-006.patch + official/bash53-007.patch + official/bash53-008.patch @@ -71,6 +76,13 @@ + + 2025-12-01 + 5.3.3 + Version bump. + Pisi Linux Community + admin@pisilinux.org + 2025-11-16 5.3.3