diff --git a/bash-5.1-patch-13.patch b/bash-5.1-patch-13.patch new file mode 100644 index 0000000..608dca7 --- /dev/null +++ b/bash-5.1-patch-13.patch @@ -0,0 +1,38 @@ +From 6b9422dbe3917a0affb4898e38156d22cbec64e8 Mon Sep 17 00:00:00 2001 +From: Chet Ramey +Date: Tue, 4 Jan 2022 16:58:20 -0500 +Subject: [PATCH] Bash-5.1 patch 13: fix tilde expansion after unquoted colons + in posix mode + +--- + patchlevel.h | 2 +- + subst.c | 1 + + 2 files changed, 2 insertions(+), 1 deletion(-) + +diff --git a/patchlevel.h b/patchlevel.h +index eb2aca52..d8a1b2a9 100644 +--- a/patchlevel.h ++++ b/patchlevel.h +@@ -25,6 +25,6 @@ + regexp `^#define[ ]*PATCHLEVEL', since that's what support/mkversion.sh + looks for to find the patch level (for the sccs version string). */ + +-#define PATCHLEVEL 12 ++#define PATCHLEVEL 13 + + #endif /* _PATCHLEVEL_H_ */ +diff --git a/subst.c b/subst.c +index 327de083..dda1d55c 100644 +--- a/subst.c ++++ b/subst.c +@@ -3825,6 +3825,7 @@ expand_string_assignment (string, quoted) + #else + 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); + FREE (td.word); +-- +2.31.1 + diff --git a/bash-5.1-patch-14.patch b/bash-5.1-patch-14.patch new file mode 100644 index 0000000..ae138dc --- /dev/null +++ b/bash-5.1-patch-14.patch @@ -0,0 +1,39 @@ +From 72912fb8209105af961c851260a173115efe60be Mon Sep 17 00:00:00 2001 +From: Chet Ramey +Date: Tue, 4 Jan 2022 16:59:40 -0500 +Subject: [PATCH] Bash-5.1 patch 14: fix off-by-one error when reading + multibyte characters from command substitution output + +--- + patchlevel.h | 2 +- + subst.c | 2 +- + 2 files changed, 2 insertions(+), 2 deletions(-) + +diff --git a/patchlevel.h b/patchlevel.h +index d8a1b2a9..f2e80d19 100644 +--- a/patchlevel.h ++++ b/patchlevel.h +@@ -25,6 +25,6 @@ + regexp `^#define[ ]*PATCHLEVEL', since that's what support/mkversion.sh + looks for to find the patch level (for the sccs version string). */ + +-#define PATCHLEVEL 13 ++#define PATCHLEVEL 14 + + #endif /* _PATCHLEVEL_H_ */ +diff --git a/subst.c b/subst.c +index dda1d55c..2b76256c 100644 +--- a/subst.c ++++ b/subst.c +@@ -6242,7 +6242,7 @@ read_comsub (fd, quoted, flags, rflag) + /* read a multibyte character from buf */ + /* punt on the hard case for now */ + memset (&ps, '\0', sizeof (mbstate_t)); +- mblen = mbrtowc (&wc, bufp-1, bufn+1, &ps); ++ mblen = mbrtowc (&wc, bufp-1, bufn, &ps); + if (MB_INVALIDCH (mblen) || mblen == 0 || mblen == 1) + istring[istring_index++] = c; + else +-- +2.31.1 + diff --git a/bash-5.1-patch-15.patch b/bash-5.1-patch-15.patch new file mode 100644 index 0000000..37291af --- /dev/null +++ b/bash-5.1-patch-15.patch @@ -0,0 +1,39 @@ +From 18ad612ea80ba978ae8271800814737e224a4baf Mon Sep 17 00:00:00 2001 +From: Chet Ramey +Date: Tue, 4 Jan 2022 17:01:33 -0500 +Subject: [PATCH] Bash-5.1 patch 15: fix readline display of some characters > + 128 in certain single-byte encodings + +--- + lib/readline/display.c | 2 +- + patchlevel.h | 2 +- + 2 files changed, 2 insertions(+), 2 deletions(-) + +diff --git a/lib/readline/display.c b/lib/readline/display.c +index 38b3d0e7..f5d32945 100644 +--- a/lib/readline/display.c ++++ b/lib/readline/display.c +@@ -1598,7 +1598,7 @@ puts_face (const char *str, const char *face, int n) + char cur_face; + + for (cur_face = FACE_NORMAL, i = 0; i < n; i++) +- putc_face (str[i], face[i], &cur_face); ++ putc_face ((unsigned char) str[i], face[i], &cur_face); + putc_face (EOF, FACE_NORMAL, &cur_face); + } + +diff --git a/patchlevel.h b/patchlevel.h +index f2e80d19..252e0819 100644 +--- a/patchlevel.h ++++ b/patchlevel.h +@@ -25,6 +25,6 @@ + regexp `^#define[ ]*PATCHLEVEL', since that's what support/mkversion.sh + looks for to find the patch level (for the sccs version string). */ + +-#define PATCHLEVEL 14 ++#define PATCHLEVEL 15 + + #endif /* _PATCHLEVEL_H_ */ +-- +2.31.1 + diff --git a/bash-5.1-patch-16.patch b/bash-5.1-patch-16.patch new file mode 100644 index 0000000..d4ec360 --- /dev/null +++ b/bash-5.1-patch-16.patch @@ -0,0 +1,53 @@ +From 9439ce094c9aa7557a9d53ac7b412a23aa66e36b Mon Sep 17 00:00:00 2001 +From: Chet Ramey +Date: Tue, 4 Jan 2022 17:03:45 -0500 +Subject: [PATCH] Bash-5.1 patch 16: fix interpretation of multiple instances + of ! in [[ conditional commands + +--- + parse.y | 2 +- + patchlevel.h | 2 +- + y.tab.c | 2 +- + 3 files changed, 3 insertions(+), 3 deletions(-) + +diff --git a/parse.y b/parse.y +index f25575b5..f4168c7c 100644 +--- a/parse.y ++++ b/parse.y +@@ -4796,7 +4796,7 @@ cond_term () + dispose_word (yylval.word); /* not needed */ + term = cond_term (); + if (term) +- term->flags |= CMD_INVERT_RETURN; ++ 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)) + { +diff --git a/patchlevel.h b/patchlevel.h +index 252e0819..3c226949 100644 +--- a/patchlevel.h ++++ b/patchlevel.h +@@ -25,6 +25,6 @@ + regexp `^#define[ ]*PATCHLEVEL', since that's what support/mkversion.sh + looks for to find the patch level (for the sccs version string). */ + +-#define PATCHLEVEL 15 ++#define PATCHLEVEL 16 + + #endif /* _PATCHLEVEL_H_ */ +diff --git a/y.tab.c b/y.tab.c +index c11d7aaa..78b38250 100644 +--- a/y.tab.c ++++ b/y.tab.c +@@ -7090,7 +7090,7 @@ cond_term () + dispose_word (yylval.word); /* not needed */ + term = cond_term (); + if (term) +- term->flags |= CMD_INVERT_RETURN; ++ 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)) + { +-- +2.31.1 + diff --git a/bash.spec b/bash.spec index b60147d..2de0852 100644 --- a/bash.spec +++ b/bash.spec @@ -1,5 +1,5 @@ #% define beta_tag rc2 -%define patchleveltag .12 +%define patchleveltag .16 %define baseversion 5.1 %bcond_without tests @@ -20,7 +20,7 @@ Source3: dot-bash_logout # Official upstream patches # Patches are converted to apply with '-p1' -%{lua:for i=1,12 do print(string.format("Patch%u: bash-5.1-patch-%u.patch\n", i, i)) end} +%{lua:for i=1,16 do print(string.format("Patch%u: bash-5.1-patch-%u.patch\n", i, i)) end} # Other patches # We don't want to add '/etc:/usr/etc' in standard utils path. @@ -318,6 +318,10 @@ end %{_libdir}/pkgconfig/%{name}.pc %changelog +* Mon Jan 17 2022 Siteshwar Vashisht - 5.1.16-1 +- Update to bash-5.1 patchlevel 16 + Resolves: #2037042 + * Fri Nov 26 2021 Siteshwar Vashisht - 5.1.12-1 - Update to bash-5.1 patchlevel 12