From patchwork Sun Feb 6 12:38:13 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Adolf Belka X-Patchwork-Id: 5090 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 (P-384) server-digest SHA384 client-signature ECDSA (P-384) client-digest SHA384) (Client CN "mail01.haj.ipfire.org", Issuer "R3" (verified OK)) by web04.haj.ipfire.org (Postfix) with ESMTPS id 4Js82P3KVsz3wgk for ; Sun, 6 Feb 2022 12:38:21 +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 (P-384) client-signature ECDSA (P-384)) (Client CN "mail02.haj.ipfire.org", Issuer "R3" (verified OK)) by mail01.ipfire.org (Postfix) with ESMTPS id 4Js82M4Jztznw; Sun, 6 Feb 2022 12:38:19 +0000 (UTC) Received: from mail02.haj.ipfire.org (localhost [127.0.0.1]) by mail02.haj.ipfire.org (Postfix) with ESMTP id 4Js82M3K8sz2yvq; Sun, 6 Feb 2022 12:38:19 +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 (P-384) server-digest SHA384 client-signature ECDSA (P-384) client-digest SHA384) (Client CN "mail01.haj.ipfire.org", Issuer "R3" (verified OK)) by mail02.haj.ipfire.org (Postfix) with ESMTPS id 4Js82K3T1Rz2xd1 for ; Sun, 6 Feb 2022 12:38:17 +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 (P-384) server-digest SHA384) (No client certificate requested) by mail01.ipfire.org (Postfix) with ESMTPSA id 4Js82J6kpYzYR; Sun, 6 Feb 2022 12:38:16 +0000 (UTC) DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=ipfire.org; s=202003ed25519; t=1644151097; 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=gcGL2z+6rh/zg7a9b+p5z/LYgoiBMXntDbnM0FruAPQ=; b=g0yjVeheJQMVdXcB3fyzhPzdJQj+CatuKiIXtwy20SaIcwgSeDKQfGkUMhpl1O9o4SEywk RA4N8pLI4uHwzXBQ== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ipfire.org; s=202003rsa; t=1644151097; 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=gcGL2z+6rh/zg7a9b+p5z/LYgoiBMXntDbnM0FruAPQ=; b=cWcTBFn0oD76/1kZL70yTVg+J9M52ZyWm7PVj+CBJH4PPZ39MQUgpSdRG4gJ18IN9851yG 7my1GjrGuyp6eMmWGxU6SgZihgn/qnTBDksawx+3t5aByi0rGskFZnHWfZUdV2lzIoCDUQ cnfjI9z3dHWOp3ykB1Cp0gxDz6agIMPB5Og6Ju6beIFAmz2KcMC/k71eoWua5WCr4Oc07B MKWxnPvBFrFmGVOWHhVABzkPtg9Jylk12LSQFVggDaFx9JOsZ7xR0Gf02gav+g0WJY/AwA /OdgGx5nF/4Iwx43sq99btbN2HPIhtX8uOmK0vjcV2wqGeui6UPNxsBH5xAWqA== From: Adolf Belka To: development@lists.ipfire.org Subject: [PATCH] bash: Update to version 5.1.016 Date: Sun, 6 Feb 2022 13:38:13 +0100 Message-Id: <20220206123813.3456391-1-adolf.belka@ipfire.org> MIME-Version: 1.0 X-BeenThere: development@lists.ipfire.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: IPFire development talk List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: development-bounces@lists.ipfire.org Sender: "Development" - Update from 5.1.012 to 5.1.016 - Update of rootfile not required - Changelog Patch 013 - Bash did not always perform tilde expansion following an unquoted colon on the rhs of an assignment statement in posix mode. Patch 014 - Bash may produce corrupted input if a multibyte character spans a 512-byte boundary while reading the output of a command substitution. Patch 015 - There are some characters (e.g., cyrillic) that can't be displayed using certain single-byte encodings (e.g., cp1251) because the negative signed int is interpreted as EOF and not displayed. Patch 016 - Multiple `!' tokens should toggle negation of an expression in a [[ conditional command, instead of simply negating the expression. Signed-off-by: Adolf Belka Reviewed-by: Peter Müller --- lfs/bash | 2 +- src/patches/bash/bash51-013 | 43 +++++++++++++++++++++++++ src/patches/bash/bash51-014 | 48 ++++++++++++++++++++++++++++ src/patches/bash/bash51-015 | 49 ++++++++++++++++++++++++++++ src/patches/bash/bash51-016 | 64 +++++++++++++++++++++++++++++++++++++ 5 files changed, 205 insertions(+), 1 deletion(-) create mode 100644 src/patches/bash/bash51-013 create mode 100644 src/patches/bash/bash51-014 create mode 100644 src/patches/bash/bash51-015 create mode 100644 src/patches/bash/bash51-016 diff --git a/lfs/bash b/lfs/bash index 1bf3eb2ec..4ec4be02a 100644 --- a/lfs/bash +++ b/lfs/bash @@ -87,7 +87,7 @@ $(TARGET) : $(patsubst %,$(DIR_DL)/%,$(objects)) sed -e "s/filename, RTLD_LAZY/filename, RTLD_NOW/" \ -i $(DIR_APP)/builtins/enable.def - for i in $$(seq 9 12); do \ + for i in $$(seq 9 16); do \ cd $(DIR_APP) && patch -Np0 < $(DIR_SRC)/src/patches/bash/bash51-$$(printf "%03d" "$${i}") || exit 1; \ done diff --git a/src/patches/bash/bash51-013 b/src/patches/bash/bash51-013 new file mode 100644 index 000000000..f2413a58d --- /dev/null +++ b/src/patches/bash/bash51-013 @@ -0,0 +1,43 @@ + BASH PATCH REPORT + ================= + +Bash-Release: 5.1 +Patch-ID: bash51-013 + +Bug-Reported-by: Anders Kaseorg +Bug-Reference-ID: +Bug-Reference-URL: https://lists.gnu.org/archive/html/bug-bash/2021-11/msg00025.html + +Bug-Description: + +Bash did not always perform tilde expansion following an unquoted colon on +the rhs of an assignment statement in posix mode. + +Patch (apply with `patch -p0'): + +*** ../bash-20211028/subst.c 2021-10-18 16:09:58.000000000 -0400 +--- subst.c 2021-11-30 11:19:47.000000000 -0500 +*************** +*** 3826,3829 **** +--- 3826,3830 ---- + td.flags = W_ASSIGNRHS; + #endif ++ td.flags |= (W_NOGLOB|W_TILDEEXP); + td.word = savestring (string); + value = call_expand_word_internal (&td, quoted, 0, (int *)NULL, (int *)NULL); + +*** ../bash-5.1/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/src/patches/bash/bash51-014 b/src/patches/bash/bash51-014 new file mode 100644 index 000000000..cd8df23ab --- /dev/null +++ b/src/patches/bash/bash51-014 @@ -0,0 +1,48 @@ + BASH PATCH REPORT + ================= + +Bash-Release: 5.1 +Patch-ID: bash51-014 + +Bug-Reported-by: platon7pronko@gmail.com +Bug-Reference-ID: +Bug-Reference-URL: https://savannah.gnu.org/patch/?10035 + +Bug-Description: + +Bash may produce corrupted input if a multibyte character spans a 512-byte +boundary while reading the output of a command substitution. + +Patch (apply with `patch -p0'): + +*** ../bash-20210217/subst.c 2021-02-03 10:32:08.000000000 -0500 +--- subst.c 2021-03-01 16:47:52.000000000 -0500 +*************** +*** 6243,6247 **** + /* punt on the hard case for now */ + memset (&ps, '\0', sizeof (mbstate_t)); +! mblen = mbrtowc (&wc, bufp-1, bufn+1, &ps); + if (MB_INVALIDCH (mblen) || mblen == 0 || mblen == 1) + istring[istring_index++] = c; +--- 6243,6247 ---- + /* punt on the hard case for now */ + memset (&ps, '\0', sizeof (mbstate_t)); +! mblen = mbrtowc (&wc, bufp-1, bufn, &ps); + if (MB_INVALIDCH (mblen) || mblen == 0 || mblen == 1) + istring[istring_index++] = c; + +*** ../bash-5.1/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/src/patches/bash/bash51-015 b/src/patches/bash/bash51-015 new file mode 100644 index 000000000..5ae65811a --- /dev/null +++ b/src/patches/bash/bash51-015 @@ -0,0 +1,49 @@ + BASH PATCH REPORT + ================= + +Bash-Release: 5.1 +Patch-ID: bash51-015 + +Bug-Reported-by: Volodymyr Prodan +Bug-Reference-ID: +Bug-Reference-URL: https://savannah.gnu.org/patch/?10076 + +Bug-Description: + +Patch (apply with `patch -p0'): + +There are some characters (e.g., cyrillic) that can't be displayed using +certain single-byte encodings (e.g., cp1251) because the negative signed +int is interpreted as EOF and not displayed. + +*** ../bash-20210524/lib/readline/display.c 2021-03-16 18:12:20.000000000 -0400 +--- lib/readline/display.c 2021-06-07 16:53:08.000000000 -0400 +*************** +*** 1599,1603 **** + + for (cur_face = FACE_NORMAL, i = 0; i < n; i++) +! putc_face (str[i], face[i], &cur_face); + putc_face (EOF, FACE_NORMAL, &cur_face); + } +--- 1599,1603 ---- + + for (cur_face = FACE_NORMAL, i = 0; i < n; i++) +! putc_face ((unsigned char) str[i], face[i], &cur_face); + putc_face (EOF, FACE_NORMAL, &cur_face); + } + +*** ../bash-5.1/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/src/patches/bash/bash51-016 b/src/patches/bash/bash51-016 new file mode 100644 index 000000000..4694498b2 --- /dev/null +++ b/src/patches/bash/bash51-016 @@ -0,0 +1,64 @@ + BASH PATCH REPORT + ================= + +Bash-Release: 5.1 +Patch-ID: bash51-016 + +Bug-Reported-by: Vincent Menegaux +Bug-Reference-ID: +Bug-Reference-URL: https://savannah.gnu.org/patch/?10070 + +Bug-Description: + +Multiple `!' tokens should toggle negation of an expression in a [[ +conditional command, instead of simply negating the expression. + +Patch (apply with `patch -p0'): + +*** ../bash-20210515/parse.y 2021-04-21 15:32:50.000000000 -0400 +--- parse.y 2021-05-24 11:53:30.000000000 -0400 +*************** +*** 4797,4801 **** + term = cond_term (); + if (term) +! term->flags |= CMD_INVERT_RETURN; + } + else if (tok == WORD && yylval.word->word[0] == '-' && yylval.word->word[1] && yylval.word->word[2] == 0 && test_unop (yylval.word->word)) +--- 4797,4801 ---- + term = cond_term (); + if (term) +! term->flags ^= CMD_INVERT_RETURN; + } + else if (tok == WORD && yylval.word->word[0] == '-' && yylval.word->word[1] && yylval.word->word[2] == 0 && test_unop (yylval.word->word)) + +*** ../bash-20210515/y.tab.c 2021-05-14 15:50:41.000000000 -0400 +--- y.tab.c 2021-05-24 16:35:55.000000000 -0400 +*************** +*** 7091,7095 **** + term = cond_term (); + if (term) +! term->flags |= CMD_INVERT_RETURN; + } + else if (tok == WORD && yylval.word->word[0] == '-' && yylval.word->word[1] && yylval.word->word[2] == 0 && test_unop (yylval.word->word)) +--- 7091,7095 ---- + term = cond_term (); + if (term) +! term->flags ^= CMD_INVERT_RETURN; + } + else if (tok == WORD && yylval.word->word[0] == '-' && yylval.word->word[1] && yylval.word->word[2] == 0 && test_unop (yylval.word->word)) + +*** ../bash-5.1/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_ */