From patchwork Tue Jan 30 22:13:40 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Adolf Belka X-Patchwork-Id: 7518 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 server-signature ECDSA (secp384r1) client-signature ECDSA (secp384r1)) (Client CN "mail01.haj.ipfire.org", Issuer "R3" (verified OK)) by web04.haj.ipfire.org (Postfix) with ESMTPS id 4TPfZv5kz0z3xHD for ; Tue, 30 Jan 2024 22:13: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 ECDSA (secp384r1) client-signature ECDSA (secp384r1)) (Client CN "mail02.haj.ipfire.org", Issuer "R3" (verified OK)) by mail01.ipfire.org (Postfix) with ESMTPS id 4TPfZq1Rv9z2P2; Tue, 30 Jan 2024 22:13:55 +0000 (UTC) Received: from mail02.haj.ipfire.org (localhost [127.0.0.1]) by mail02.haj.ipfire.org (Postfix) with ESMTP id 4TPfZp5jc4z32j1; Tue, 30 Jan 2024 22:13:54 +0000 (UTC) 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 ECDSA (secp384r1)) (Client CN "mail01.haj.ipfire.org", Issuer "R3" (verified OK)) by mail02.haj.ipfire.org (Postfix) with ESMTPS id 4TPfZm6Gv6z2yPl for ; Tue, 30 Jan 2024 22:13:52 +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 ECDSA (secp384r1) server-digest SHA384) (No client certificate requested) by mail01.ipfire.org (Postfix) with ESMTPSA id 4TPfZm0MRPzkc; Tue, 30 Jan 2024 22:13:52 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ipfire.org; s=202003rsa; t=1706652832; 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: in-reply-to:in-reply-to:references:references; bh=VYhcB9RhgTnKc27kmC7FV3ua7HyQDBKr5Pm0T7RM4+c=; b=DzY8wKZU/JXIB+pP7nQUSUcJTURshNZGV87w2SmuBXQvQVAwbrmWhoEO201oMj/oCZcqSW yhGNGxilNHycnG6MrCjzCV5t7ic59gVBSJtomJDMJuhnuEvjXv0BvS21P51TgEUaPcBQg9 AvB+aN27Z4oN6+EbkS2keGTGqI1M1v08S8yrLNVjRheyHbDkJU0Tj92gyG99zr87ZWY8Jc fB7H2aWNVo/pwOyHuKgIwsB3Fx1MsTZ1cT+zY2DO3f8mJLAYBJ+zlX3ZJ2xMq9Img+cv0/ vTj3D96gxFFsJm2y8nGfaCh8UREWe32jsoV71xHoBILQVOLaSgksDkAcFCLh1Q== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=ipfire.org; s=202003ed25519; t=1706652832; 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: in-reply-to:in-reply-to:references:references; bh=VYhcB9RhgTnKc27kmC7FV3ua7HyQDBKr5Pm0T7RM4+c=; b=3jy6BbyWvohxnOaHntQBtV0qgt8H6lXR+lYHP3y12QxhN7s6RSxn9OS3djunDCl35UmuWy Bqwg1GfSlVC4f8Cg== From: Adolf Belka To: development@lists.ipfire.org Subject: [PATCH] bash: Update to include patches 22 to 26 Date: Tue, 30 Jan 2024 23:13:40 +0100 Message-ID: <20240130221345.1710154-2-adolf.belka@ipfire.org> In-Reply-To: <20240130221345.1710154-1-adolf.belka@ipfire.org> References: <20240130221345.1710154-1-adolf.belka@ipfire.org> MIME-Version: 1.0 Message-ID-Hash: S5DLHIKQCR6JSK5O5RROIDFWMEYJZ4KX X-Message-ID-Hash: S5DLHIKQCR6JSK5O5RROIDFWMEYJZ4KX X-MailFrom: adolf.belka@ipfire.org X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; emergency; loop; banned-address; member-moderation; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header X-Mailman-Version: 3.3.8 Precedence: list List-Id: IPFire development talk Archived-At: List-Archive: List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: - Update from version 5.2 with patches 1 to 21 to 5.2 with patches 1 to 26 - Update of rootfile not required - Changelog Patch 26 The custom color prefix that readline uses to color possible completions must have a leading `.'. Patch 25 Make sure a subshell checks for and handles any terminating signals before exiting (which might have arrived after the command completed) so the parent and any EXIT trap will see the correct value for $?. Patch 24 Fix bug where associative array compound assignment would not expand tildes in values. Patch 23 Running `local -' multiple times in a shell function would overwrite the original saved set of options. Patch 22 It's possible for readline to try to zero out a line that's not null- terminated, leading to a memory fault. Signed-off-by: Adolf Belka --- lfs/bash | 4 +- src/patches/bash/bash52-022 | 53 ++++++++++++++++++++++ src/patches/bash/bash52-023 | 64 +++++++++++++++++++++++++++ src/patches/bash/bash52-024 | 88 +++++++++++++++++++++++++++++++++++++ src/patches/bash/bash52-025 | 46 +++++++++++++++++++ src/patches/bash/bash52-026 | 48 ++++++++++++++++++++ 6 files changed, 301 insertions(+), 2 deletions(-) create mode 100644 src/patches/bash/bash52-022 create mode 100644 src/patches/bash/bash52-023 create mode 100644 src/patches/bash/bash52-024 create mode 100644 src/patches/bash/bash52-025 create mode 100644 src/patches/bash/bash52-026 diff --git a/lfs/bash b/lfs/bash index 80d4f244b..c66f6a8e1 100644 --- a/lfs/bash +++ b/lfs/bash @@ -1,7 +1,7 @@ ############################################################################### # # # IPFire.org - A linux based firewall # -# Copyright (C) 2007-2023 IPFire Team # +# Copyright (C) 2007-2024 IPFire Team # # # # This program is free software: you can redistribute it and/or modify # # it under the terms of the GNU General Public License as published by # @@ -91,7 +91,7 @@ $(TARGET) : $(patsubst %,$(DIR_DL)/%,$(objects)) cd $(DIR_APP) && patch -Np1 < $(DIR_SRC)/src/patches/bash/bash-4.0-profile-1.patch cd $(DIR_APP) && patch -Np1 < $(DIR_SRC)/src/patches/bash/bash-3.2-ssh_source_bash.patch - for i in $$(seq 1 21); do \ + for i in $$(seq 1 26); do \ cd $(DIR_APP) && patch -Np0 < $(DIR_SRC)/src/patches/bash/bash52-$$(printf "%03d" "$${i}") || exit 1; \ done diff --git a/src/patches/bash/bash52-022 b/src/patches/bash/bash52-022 new file mode 100644 index 000000000..557d38706 --- /dev/null +++ b/src/patches/bash/bash52-022 @@ -0,0 +1,53 @@ + BASH PATCH REPORT + ================= + +Bash-Release: 5.2 +Patch-ID: bash52-022 + +Bug-Reported-by: srobertson@peratonlabs.com +Bug-Reference-ID: +Bug-Reference-URL: https://lists.gnu.org/archive/html/bug-bash/2022-09/msg00049.html + +Bug-Description: + +It's possible for readline to try to zero out a line that's not null- +terminated, leading to a memory fault. + +Patch (apply with `patch -p0'): + +*** ../bash-5.2-patched/lib/readline/display.c 2022-04-05 10:47:31.000000000 -0400 +--- lib/readline/display.c 2022-12-13 13:11:22.000000000 -0500 +*************** +*** 2684,2692 **** + + if (visible_line) +! { +! temp = visible_line; +! while (*temp) +! *temp++ = '\0'; +! } + rl_on_new_line (); + forced_display++; +--- 2735,2740 ---- + + if (visible_line) +! memset (visible_line, 0, line_size); +! + rl_on_new_line (); + forced_display++; + +*** ../bash-5.2/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 21 + + #endif /* _PATCHLEVEL_H_ */ +--- 26,30 ---- + looks for to find the patch level (for the sccs version string). */ + +! #define PATCHLEVEL 22 + + #endif /* _PATCHLEVEL_H_ */ diff --git a/src/patches/bash/bash52-023 b/src/patches/bash/bash52-023 new file mode 100644 index 000000000..07ba4ae43 --- /dev/null +++ b/src/patches/bash/bash52-023 @@ -0,0 +1,64 @@ + BASH PATCH REPORT + ================= + +Bash-Release: 5.2 +Patch-ID: bash52-023 + +Bug-Reported-by: Emanuele Torre +Bug-Reference-ID: <20230206140824.1710288-1-torreemanuele6@gmail.com> +Bug-Reference-URL: https://lists.gnu.org/archive/html/bug-bash/2023-02/msg00045.html + +Bug-Description: + +Running `local -' multiple times in a shell function would overwrite the +original saved set of options. + +Patch (apply with `patch -p0'): + +*** ../bash-5.2-patched/builtins/declare.def 2023-01-04 20:40:28.000000000 -0500 +--- builtins/declare.def 2023-02-08 15:36:49.000000000 -0500 +*************** +*** 421,429 **** + if (local_var && variable_context && STREQ (name, "-")) + { + var = make_local_variable ("-", 0); +! FREE (value_cell (var)); /* just in case */ +! value = get_current_options (); +! var_setvalue (var, value); +! VSETATTR (var, att_invisible); + NEXT_VARIABLE (); + } +--- 421,437 ---- + if (local_var && variable_context && STREQ (name, "-")) + { ++ int o; ++ ++ o = localvar_inherit; ++ localvar_inherit = 0; + var = make_local_variable ("-", 0); +! localvar_inherit = o; +! +! if (value_cell (var) == NULL) /* no duplicate instances */ +! { +! value = get_current_options (); +! var_setvalue (var, value); +! VSETATTR (var, att_invisible); +! } + NEXT_VARIABLE (); + } + +*** ../bash-5.2/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 22 + + #endif /* _PATCHLEVEL_H_ */ +--- 26,30 ---- + looks for to find the patch level (for the sccs version string). */ + +! #define PATCHLEVEL 23 + + #endif /* _PATCHLEVEL_H_ */ diff --git a/src/patches/bash/bash52-024 b/src/patches/bash/bash52-024 new file mode 100644 index 000000000..8cc49e878 --- /dev/null +++ b/src/patches/bash/bash52-024 @@ -0,0 +1,88 @@ + BASH PATCH REPORT + ================= + +Bash-Release: 5.2 +Patch-ID: bash52-024 + +Bug-Reported-by: Marco +Bug-Reference-ID: +Bug-Reference-URL: https://lists.gnu.org/archive/html/bug-bash/2023-02/msg00044.html + +Bug-Description: + +Fix bug where associative array compound assignment would not expand tildes +in values. + +Patch (apply with `patch -p0'): + +*** ../bash-20230105/arrayfunc.c Thu Jan 5 14:23:28 2023 +--- arrayfunc.c Wed Feb 8 16:27:48 2023 +*************** +*** 651,655 **** + } + +! aval = expand_subscript_string (v, 0); + if (aval == 0) + { +--- 651,655 ---- + } + +! aval = expand_assignment_string_to_string (v, 0); + if (aval == 0) + { +*************** +*** 843,847 **** + if (assoc_p (var)) + { +! val = expand_subscript_string (val, 0); + if (val == 0) + { +--- 843,847 ---- + if (assoc_p (var)) + { +! val = expand_assignment_string_to_string (val, 0); + if (val == 0) + { +*************** +*** 1031,1035 **** + nword[i++] = w[ind++]; + +! t = expand_subscript_string (w+ind, 0); + s = (t && strchr (t, CTLESC)) ? quote_escapes (t) : t; + value = sh_single_quote (s ? s : ""); +--- 1031,1035 ---- + nword[i++] = w[ind++]; + +! t = expand_assignment_string_to_string (w+ind, 0); + s = (t && strchr (t, CTLESC)) ? quote_escapes (t) : t; + value = sh_single_quote (s ? s : ""); +*** ../bash-20230201/subst.c Mon Jan 30 16:19:46 2023 +--- subst.c Mon Feb 6 16:25:22 2023 +*************** +*** 10803,10807 **** +--- 10803,10811 ---- + ret = (char *)NULL; + ++ #if 0 + td.flags = W_NOPROCSUB|W_NOTILDE|W_NOSPLIT2; /* XXX - W_NOCOMSUB? */ ++ #else ++ td.flags = W_NOPROCSUB|W_NOSPLIT2; /* XXX - W_NOCOMSUB? */ ++ #endif + td.word = savestring (string); /* in case it's freed on error */ + + +*** ../bash-5.2/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 23 + + #endif /* _PATCHLEVEL_H_ */ +--- 26,30 ---- + looks for to find the patch level (for the sccs version string). */ + +! #define PATCHLEVEL 24 + + #endif /* _PATCHLEVEL_H_ */ diff --git a/src/patches/bash/bash52-025 b/src/patches/bash/bash52-025 new file mode 100644 index 000000000..4e293f9d3 --- /dev/null +++ b/src/patches/bash/bash52-025 @@ -0,0 +1,46 @@ + BASH PATCH REPORT + ================= + +Bash-Release: 5.2 +Patch-ID: bash52-025 + +Bug-Reported-by: Andrew Neff +Bug-Reference-ID: +Bug-Reference-URL: https://lists.gnu.org/archive/html/bug-bash/2022-10/msg00100.html + +Bug-Description: + +Make sure a subshell checks for and handles any terminating signals before +exiting (which might have arrived after the command completed) so the parent +and any EXIT trap will see the correct value for $?. + +Patch (apply with `patch -p0'): + +*** ../bash-5.2.9/execute_cmd.c 2022-11-02 10:36:54.000000000 -0400 +--- execute_cmd.c 2022-10-27 16:52:55.000000000 -0400 +*************** +*** 1726,1729 **** +--- 1726,1732 ---- + : EXECUTION_SUCCESS; + ++ /* Check for terminating signals before we return to our caller, which we ++ expect to exit immediately anyway. */ ++ CHECK_TERMSIG; + + /* If we were explicitly placed in a subshell with (), we need + +*** ../bash-5.2/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 24 + + #endif /* _PATCHLEVEL_H_ */ +--- 26,30 ---- + looks for to find the patch level (for the sccs version string). */ + +! #define PATCHLEVEL 25 + + #endif /* _PATCHLEVEL_H_ */ diff --git a/src/patches/bash/bash52-026 b/src/patches/bash/bash52-026 new file mode 100644 index 000000000..bd0f5d0d2 --- /dev/null +++ b/src/patches/bash/bash52-026 @@ -0,0 +1,48 @@ + BASH PATCH REPORT + ================= + +Bash-Release: 5.2 +Patch-ID: bash52-026 + +Bug-Reported-by: Stefan Klinger +Bug-Reference-ID: +Bug-Reference-URL: https://lists.gnu.org/archive/html/bug-readline/2023-08/msg00018.html + +Bug-Description: + +The custom color prefix that readline uses to color possible completions +must have a leading `.'. + +Patch (apply with `patch -p0'): + +*** ../bash-5.2-patched/lib/readline/colors.c 2021-12-08 11:38:25.000000000 -0500 +--- lib/readline/colors.c 2023-08-28 16:40:04.000000000 -0400 +*************** +*** 74,78 **** + static void restore_default_color (void); + +! #define RL_COLOR_PREFIX_EXTENSION "readline-colored-completion-prefix" + + COLOR_EXT_TYPE *_rl_color_ext_list = 0; +--- 74,78 ---- + static void restore_default_color (void); + +! #define RL_COLOR_PREFIX_EXTENSION ".readline-colored-completion-prefix" + + COLOR_EXT_TYPE *_rl_color_ext_list = 0; + +*** ../bash-5.2/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 25 + + #endif /* _PATCHLEVEL_H_ */ +--- 26,30 ---- + looks for to find the patch level (for the sccs version string). */ + +! #define PATCHLEVEL 26 + + #endif /* _PATCHLEVEL_H_ */