From patchwork Thu Aug 7 15:22:45 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Adolf Belka X-Patchwork-Id: 8968 Return-Path: Received: from mail01.ipfire.org (mail01.haj.ipfire.org [172.28.1.202]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange x25519) (Client CN "mail01.haj.ipfire.org", Issuer "R11" (verified OK)) by web04.haj.ipfire.org (Postfix) with ESMTPS id 4byWBW4QRRz3x3G for ; Thu, 07 Aug 2025 15:22:59 +0000 (UTC) Received: from mail02.haj.ipfire.org (mail02.haj.ipfire.org [172.28.1.201]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) client-signature ECDSA (secp384r1)) (Client CN "mail02.haj.ipfire.org", Issuer "E6" (verified OK)) by mail01.ipfire.org (Postfix) with ESMTPS id 4byWBS6RXyz6lQ for ; Thu, 7 Aug 2025 15:22:56 +0000 (UTC) Received: from mail02.haj.ipfire.org (localhost [127.0.0.1]) by mail02.haj.ipfire.org (Postfix) with ESMTP id 4byWBS4Qjcz33fg for ; Thu, 7 Aug 2025 15:22:56 +0000 (UTC) X-Original-To: development@lists.ipfire.org Received: from mail01.ipfire.org (mail01.haj.ipfire.org [172.28.1.202]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (secp384r1) client-signature RSA-PSS (4096 bits)) (Client CN "mail01.haj.ipfire.org", Issuer "R11" (verified OK)) by mail02.haj.ipfire.org (Postfix) with ESMTPS id 4byWBP4mxtz3320 for ; Thu, 7 Aug 2025 15:22:53 +0000 (UTC) Received: from [127.0.0.1] (localhost [127.0.0.1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by mail01.ipfire.org (Postfix) with ESMTPSA id 4byWBN4MLWz1VG; Thu, 7 Aug 2025 15:22:52 +0000 (UTC) DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=ipfire.org; s=202003ed25519; t=1754580172; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding; bh=KVql77Cf9znzcoUFN0TbwBSez+aozKhK/zeqmgW3qxE=; b=KYyB7+VcKAA39xjYOxk8D6jghLTSnElRIcW+yc7xXJE8vxUzhkPKZ5/qew1PCT+5lyWWHQ UNrGk4S0sXj5PADw== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ipfire.org; s=202003rsa; t=1754580172; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding; bh=KVql77Cf9znzcoUFN0TbwBSez+aozKhK/zeqmgW3qxE=; b=qhTbbeLKOvEPaJVlvG+Ln/TEpk6ArkJealhYeOJDz48srRcNLNQxScKWURyIuR57DxE4VP dxfNJ1BRjxP0D4LW5WNoWSuzjGDxGBRoODTtDfLzOBiFle1Y+4LliF13MaXIqPMh8ccb9B kx4vc66cTVf9CeWupAjrAYYaH0yayk1fXLuLRpZGhCNvoP/ZFDsE/Z/qvvJ/bcenC7oMo9 KXrRLHBA10bPqI5a/W8hfNDNtgF5ZnSuyuOgWVCSi7pImZ/47XFkoyEnngksPffoq8d6Ea n5ZEUCBevyMZDdqdk/JDIiSvI6VwuVYJKhTzDTdq76pxz6L8yFsqcPRAkvPaNA== From: Adolf Belka To: development@lists.ipfire.org Cc: Adolf Belka Subject: [PATCH] bash: Update to patch level 3 Date: Thu, 7 Aug 2025 17:22:45 +0200 Message-ID: <20250807152247.1954170-1-adolf.belka@ipfire.org> Precedence: list List-Id: List-Subscribe: , List-Unsubscribe: , List-Post: List-Help: Sender: Mail-Followup-To: MIME-Version: 1.0 - Update from patch level 0 to 3 - Update of rootfile not required - Changelog Patch 3 Bash leaves internal quoting in place when expanding array subscripts that appear inside array subscripts in an arithmetic context, causing expansion failures. Patch 2 There are too many differences in the various implementations of shm_open(2) to rely on it for bash's use. Patch 1 In posix mode, `wait -n' with pid arguments does not restrict the set of processes it considers to those arguments. Signed-off-by: Adolf Belka --- lfs/bash | 2 +- src/patches/bash/bash53-001 | 48 ++++++++++++++ src/patches/bash/bash53-002 | 122 ++++++++++++++++++++++++++++++++++++ src/patches/bash/bash53-003 | 82 ++++++++++++++++++++++++ 4 files changed, 253 insertions(+), 1 deletion(-) create mode 100644 src/patches/bash/bash53-001 create mode 100644 src/patches/bash/bash53-002 create mode 100644 src/patches/bash/bash53-003 diff --git a/lfs/bash b/lfs/bash index a09326198..1bc7b52f6 100644 --- a/lfs/bash +++ b/lfs/bash @@ -25,7 +25,7 @@ include Config VER = 5.3 -PATCHVER = 0 +PATCHVER = 3 THISAPP = bash-$(VER) DL_FILE = $(THISAPP).tar.gz diff --git a/src/patches/bash/bash53-001 b/src/patches/bash/bash53-001 new file mode 100644 index 000000000..17c1d89db --- /dev/null +++ b/src/patches/bash/bash53-001 @@ -0,0 +1,48 @@ + BASH PATCH REPORT + ================= + +Bash-Release: 5.3 +Patch-ID: bash53-001 + +Bug-Reported-by: John Sidles +Bug-Reference-ID: +Bug-Reference-URL: https://lists.gnu.org/archive/html/bug-bash/2025-07/msg00035.html + +Bug-Description: + +In posix mode, `wait -n' with pid arguments does not restrict the set of +processes it considers to those arguments. + +Patch (apply with `patch -p0'): + +*** ../bash-5.3/jobs.c Fri Mar 7 18:48:44 2025 +--- jobs.c Mon Jul 14 10:25:13 2025 +*************** +*** 3539,3543 **** + one in bgpids. We can do this in posix mode because we'll remove any + one we find from the table, preserving existing semantics. */ +! if (posixly_correct && (t = bgp_findone ())) + { + pid = t->pid; +--- 3539,3543 ---- + one in bgpids. We can do this in posix mode because we'll remove any + one we find from the table, preserving existing semantics. */ +! if (posixly_correct && (flags & JWAIT_WAITING) == 0 && (t = bgp_findone ())) + { + pid = t->pid; + +*** ../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 0 + + #endif /* _PATCHLEVEL_H_ */ +--- 26,30 ---- + looks for to find the patch level (for the sccs version string). */ + +! #define PATCHLEVEL 1 + + #endif /* _PATCHLEVEL_H_ */ diff --git a/src/patches/bash/bash53-002 b/src/patches/bash/bash53-002 new file mode 100644 index 000000000..cddc90e87 --- /dev/null +++ b/src/patches/bash/bash53-002 @@ -0,0 +1,122 @@ + BASH PATCH REPORT + ================= + +Bash-Release: 5.3 +Patch-ID: bash53-002 + +Bug-Reported-by: +Bug-Reference-ID: +Bug-Reference-URL: https://savannah.gnu.org/bugs/?67326 + +Bug-Description: + +There are too many differences in the various implementations of shm_open(2) +to rely on it for bash's use. + +Patch (apply with `patch -p0'): + +*** ../bash-5.3-patched/lib/sh/anonfile.c Tue Jul 9 11:41:57 2024 +--- lib/sh/anonfile.c Thu Jul 17 11:03:23 2025 +*************** +*** 26,30 **** + #include + +! #if defined (HAVE_MEMFD_CREATE) || defined (HAVE_SHM_OPEN) || defined (HAVE_SHM_MKSTEMP) + # include + #endif +--- 26,30 ---- + #include + +! #if defined (HAVE_MEMFD_CREATE) || defined (HAVE_SHM_MKSTEMP) + # include + #endif +*************** +*** 42,57 **** + #endif + +! #if defined (HAVE_SHM_OPEN) +! #ifndef O_NOFOLLOW +! # define O_NOFOLLOW 0 +! #endif +! + static int +- anonshmunlink (const char *fn) +- { +- return (shm_unlink (fn)); +- } +- +- static int + anonshmopen (const char *name, int flags, char **fn) + { +--- 42,47 ---- + #endif + +! #if defined (HAVE_SHM_MKSTEMP) + static int + anonshmopen (const char *name, int flags, char **fn) + { +*************** +*** 63,95 **** + *fn = 0; + +- #if defined (HAVE_SHM_MKSTEMP) + fname = savestring ("/shm-XXXXXXXXXX"); + fd = shm_mkstemp (fname); + if (fd < 0) +- free (fname); +- #endif +- +- if (fd < 0) + { +- fname = sh_mktmpname (name, flags); +- fd = shm_open (fname, O_RDWR|O_CREAT|O_EXCL|O_NOFOLLOW, 0600); +- } +- +- if (fd < 0) +- { + free (fname); + return fd; + } + +- if (shm_unlink (fname) < 0) +- { +- int o; +- o = errno; +- free (fname); +- close (fd); +- errno = o; +- return -1; +- } +- + if (fn) + *fn = fname; +--- 53,64 ---- +*************** +*** 123,127 **** + flag = (name && *name == '/') ? MT_TEMPLATE : MT_USETMPDIR; + +! #if defined (HAVE_SHM_OPEN) + fd = anonshmopen (name, flag, fn); + if (fd >= 0) +--- 92,96 ---- + flag = (name && *name == '/') ? MT_TEMPLATE : MT_USETMPDIR; + +! #if defined (HAVE_SHM_MKSTEMP) + fd = anonshmopen (name, flag, fn); + if (fd >= 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 1 + + #endif /* _PATCHLEVEL_H_ */ +--- 26,30 ---- + looks for to find the patch level (for the sccs version string). */ + +! #define PATCHLEVEL 2 + + #endif /* _PATCHLEVEL_H_ */ diff --git a/src/patches/bash/bash53-003 b/src/patches/bash/bash53-003 new file mode 100644 index 000000000..0fc6b42e0 --- /dev/null +++ b/src/patches/bash/bash53-003 @@ -0,0 +1,82 @@ + BASH PATCH REPORT + ================= + +Bash-Release: 5.3 +Patch-ID: bash53-003 + +Bug-Reported-by: Isabella Bosia +Bug-Reference-ID: +Bug-Reference-URL: https://lists.gnu.org/archive/html/bug-bash/2025-06/msg00173.html + +Bug-Description: + +Bash leaves internal quoting in place when expanding array subscripts +that appear inside array subscripts in an arithmetic context, causing +expansion failures. + +Patch (apply with `patch -p0'): + +*** ../bash-5.3-patched/subst.c Sun May 18 15:00:13 2025 +--- subst.c Fri Jul 11 09:48:44 2025 +*************** +*** 3796,3802 **** + #endif + +! /* We don't perform process substitution in arithmetic expressions, so don't +! bother checking for it. */ +! #define ARITH_EXP_CHAR(s) (s == '$' || s == '`' || s == CTLESC || s == '~') + + /* If there are any characters in STRING that require full expansion, +--- 3796,3802 ---- + #endif + +! /* We don't perform process substitution or tilde expansion in arithmetic +! expressions, so don't bother checking for them. */ +! #define ARITH_EXP_CHAR(s) (s == '$' || s == '`' || s == CTLESC) + + /* If there are any characters in STRING that require full expansion, +*************** +*** 12216,12219 **** +--- 12216,12227 ---- + break; + } ++ #if defined (ARRAY_VARS) ++ /* The only special characters that matter here are []~, since those ++ are backslash-quoted in expand_array_subscript but not dequoted ++ by the statement following this one. */ ++ if ((quoted & Q_ARITH) && (c == LBRACK || c == RBRACK || c == '~')) ++ ; /* placeholder here */ ++ else ++ #endif + if (((quoted & (Q_HERE_DOCUMENT|Q_DOUBLE_QUOTES)) || dquote) && (sh_syntaxtab[c] & CBSDQUOTE) == 0) + *r++ = '\\'; +*** ../bash-5.3/tests/quotearray.right Thu Nov 10 10:39:56 2022 +--- tests/quotearray.right Thu Jul 10 15:40:27 2025 +*************** +*** 45,49 **** + 0 + 0 +! ./quotearray1.sub: line 68: 0\],b\[1: arithmetic syntax error: invalid arithmetic operator (error token is "\],b\[1") + declare -a array + 0 +--- 45,49 ---- + 0 + 0 +! ./quotearray1.sub: line 68: 0],b[1: arithmetic syntax error: invalid arithmetic operator (error token is "],b[1") + declare -a array + 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 2 + + #endif /* _PATCHLEVEL_H_ */ +--- 26,30 ---- + looks for to find the patch level (for the sccs version string). */ + +! #define PATCHLEVEL 3 + + #endif /* _PATCHLEVEL_H_ */