From 7269640a278c9f97cd61a9b0b7a0e5fd1118a2a2 Mon Sep 17 00:00:00 2001 From: Pete Graner Date: Fri, 31 Aug 2007 14:14:13 +0000 Subject: [PATCH] - Added bash32-021 upstream official patch - Added bash32-025 upstream official patch - Added bash32-024 upstream official patch - Added bash32-023 upstream official patch - Added bash32-022 upstream official patch --- bash.spec | 19 +++++++- bash32-021 | 72 ++++++++++++++++++++++++++++++ bash32-022 | 126 +++++++++++++++++++++++++++++++++++++++++++++++++++++ bash32-023 | 51 ++++++++++++++++++++++ bash32-024 | 77 ++++++++++++++++++++++++++++++++ bash32-025 | 79 +++++++++++++++++++++++++++++++++ 6 files changed, 423 insertions(+), 1 deletion(-) create mode 100644 bash32-021 create mode 100644 bash32-022 create mode 100644 bash32-023 create mode 100644 bash32-024 create mode 100644 bash32-025 diff --git a/bash.spec b/bash.spec index 3cae001..07b4ff5 100644 --- a/bash.spec +++ b/bash.spec @@ -1,7 +1,7 @@ Version: 3.2 Name: bash Summary: The GNU Bourne Again shell (bash) version %{version} -Release: 17%{?dist} +Release: 18%{?dist} Group: System Environment/Shells License: GPLv2+ Url: http://www.gnu.org/software/bash @@ -31,6 +31,11 @@ Patch17: ftp://ftp.gnu.org/gnu/bash/bash-3.2-patches/bash32-017 Patch18: ftp://ftp.gnu.org/gnu/bash/bash-3.2-patches/bash32-018 Patch19: ftp://ftp.gnu.org/gnu/bash/bash-3.2-patches/bash32-019 Patch20: ftp://ftp.gnu.org/gnu/bash/bash-3.2-patches/bash32-020 +Patch21: ftp://ftp.gnu.org/gnu/bash/bash-3.2-patches/bash32-021 +Patch22: ftp://ftp.gnu.org/gnu/bash/bash-3.2-patches/bash32-022 +Patch23: ftp://ftp.gnu.org/gnu/bash/bash-3.2-patches/bash32-023 +Patch24: ftp://ftp.gnu.org/gnu/bash/bash-3.2-patches/bash32-024 +Patch25: ftp://ftp.gnu.org/gnu/bash/bash-3.2-patches/bash32-025 # Other patches Patch100: bash-2.03-paths.patch Patch101: bash-2.02-security.patch @@ -87,6 +92,11 @@ compliance over previous versions. %patch18 -p0 -b .018 %patch19 -p0 -b .019 %patch20 -p0 -b .020 +%patch21 -p0 -b .021 +%patch22 -p0 -b .022 +%patch23 -p0 -b .023 +%patch24 -p0 -b .024 +%patch25 -p0 -b .025 # Other patches %patch100 -p1 -b .paths @@ -246,6 +256,13 @@ fi %doc doc/*.ps doc/*.0 doc/*.html doc/article.txt %changelog +* Fri Aug 31 2007 Pete Graner - 3.2-18 +- Added bash32-021 upstream official patch +- Added bash32-025 upstream official patch +- Added bash32-024 upstream official patch +- Added bash32-023 upstream official patch +- Added bash32-022 upstream official patch + * Wed Aug 29 2007 Pete Graner - 3.2-17 - Added bash32-018 upstream official patch - Added bash32-020 upstream official patch diff --git a/bash32-021 b/bash32-021 new file mode 100644 index 0000000..003489c --- /dev/null +++ b/bash32-021 @@ -0,0 +1,72 @@ + BASH PATCH REPORT + ================= + +Bash-Release: 3.2 +Patch-ID: bash32-021 + +Bug-Reported-by: BAGSHAW Paul RD-TECH-REN +Bug-Reference-ID: <941BA0BF46DB8F4983FF7C8AFE800BC205EA7D4B@ftrdmel3.rd.francetelecom.fr> +Bug-Reference-URL: http://lists.gnu.org/archive/html/bug-bash/2007-03/msg00065.html + +Bug-Description: + +When the parser read a backslash-escaped character that would be treated +internally as an escape, it would double the number of escape characters. + +Patch: + +*** ../bash-3.2-patched/parse.y Mon Oct 30 17:22:00 2006 +--- parse.y Sat Mar 24 17:13:20 2007 +*************** +*** 3377,3381 **** + { + pass_next_character = 0; +! goto got_character; + } + +--- 3377,3381 ---- + { + pass_next_character = 0; +! goto got_escaped_character; + } + +*************** +*** 3651,3660 **** + got_character: + +- all_digit_token &= DIGIT (character); +- dollar_present |= character == '$'; +- + if (character == CTLESC || character == CTLNUL) + token[token_index++] = CTLESC; + + token[token_index++] = character; + +--- 3651,3662 ---- + got_character: + + if (character == CTLESC || character == CTLNUL) + token[token_index++] = CTLESC; + ++ got_escaped_character: ++ ++ all_digit_token &= DIGIT (character); ++ dollar_present |= character == '$'; ++ + token[token_index++] = character; + +*** ../bash-3.2/patchlevel.h Thu Apr 13 08:31:04 2006 +--- patchlevel.h Mon Oct 16 14:22:54 2006 +*************** +*** 26,30 **** + looks for to find the patch level (for the sccs version string). */ + +! #define PATCHLEVEL 20 + + #endif /* _PATCHLEVEL_H_ */ +--- 26,30 ---- + looks for to find the patch level (for the sccs version string). */ + +! #define PATCHLEVEL 21 + + #endif /* _PATCHLEVEL_H_ */ diff --git a/bash32-022 b/bash32-022 new file mode 100644 index 0000000..d3679e6 --- /dev/null +++ b/bash32-022 @@ -0,0 +1,126 @@ + BASH PATCH REPORT + ================= + +Bash-Release: 3.2 +Patch-ID: bash32-022 + +Bug-Reported-by: Chet Ramey +Bug-Reference-ID: +Bug-Reference-URL: + +Bug-Description: + +POSIX specifies that the `read' builtin invoked from an interative shell +must prompt with $PS2 when a line is continued using a backslash while +reading from a terminal. + +Patch: + +*** ../bash-3.2-patched/builtins/read.def Tue Sep 19 08:45:48 2006 +--- builtins/read.def Thu May 24 16:03:30 2007 +*************** +*** 128,133 **** + { + register char *varname; +! int size, i, nr, pass_next, saw_escape, eof, opt, retval, code; +! int input_is_tty, input_is_pipe, unbuffered_read; + int raw, edit, nchars, silent, have_timeout, fd; + unsigned int tmout; +--- 131,136 ---- + { + register char *varname; +! int size, i, nr, pass_next, saw_escape, eof, opt, retval, code, print_ps2; +! int input_is_tty, input_is_pipe, unbuffered_read, skip_ctlesc, skip_ctlnul; + int raw, edit, nchars, silent, have_timeout, fd; + unsigned int tmout; +*************** +*** 135,139 **** + char c; + char *input_string, *orig_input_string, *ifs_chars, *prompt, *arrayname; +! char *e, *t, *t1; + struct stat tsb; + SHELL_VAR *var; +--- 138,142 ---- + char c; + char *input_string, *orig_input_string, *ifs_chars, *prompt, *arrayname; +! char *e, *t, *t1, *ps2; + struct stat tsb; + SHELL_VAR *var; +*************** +*** 149,152 **** +--- 152,156 ---- + USE_VAR(i); + USE_VAR(pass_next); ++ USE_VAR(print_ps2); + USE_VAR(saw_escape); + USE_VAR(input_is_pipe); +*************** +*** 164,167 **** +--- 168,172 ---- + #endif + USE_VAR(list); ++ USE_VAR(ps2); + + i = 0; /* Index into the string that we are reading. */ +*************** +*** 387,391 **** + #endif + +! for (eof = retval = 0;;) + { + #if defined (READLINE) +--- 394,399 ---- + #endif + +! ps2 = 0; +! for (print_ps2 = eof = retval = 0;;) + { + #if defined (READLINE) +*************** +*** 413,416 **** +--- 421,433 ---- + #endif + ++ if (print_ps2) ++ { ++ if (ps2 == 0) ++ ps2 = get_string_value ("PS2"); ++ fprintf (stderr, "%s", ps2 ? ps2 : ""); ++ fflush (stderr); ++ print_ps2 = 0; ++ } ++ + if (unbuffered_read) + retval = zread (fd, &c, 1); +*************** +*** 441,445 **** + pass_next = 0; + if (c == '\n') +! i--; /* back up over the CTLESC */ + else + goto add_char; +--- 458,466 ---- + pass_next = 0; + if (c == '\n') +! { +! i--; /* back up over the CTLESC */ +! if (interactive && input_is_tty && raw == 0) +! print_ps2 = 1; +! } + else + goto add_char; +*** ../bash-3.2/patchlevel.h Thu Apr 13 08:31:04 2006 +--- patchlevel.h Mon Oct 16 14:22:54 2006 +*************** +*** 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/bash32-023 b/bash32-023 new file mode 100644 index 0000000..34a6394 --- /dev/null +++ b/bash32-023 @@ -0,0 +1,51 @@ + BASH PATCH REPORT + ================= + +Bash-Release: 3.2 +Patch-ID: bash32-023 + +Bug-Reported-by: Chet Ramey +Bug-Reference-ID: +Bug-Reference-URL: + +Bug-Description: + +When an error occurs during the pattern removal word expansion, the shell +can free unallocated memory or free memory multiple times. + +Patch: + +*** ../bash-3.2-patched/subst.c Tue Apr 3 16:47:19 2007 +--- subst.c Tue Jul 17 09:45:11 2007 +*************** +*** 3975,3979 **** + patstr++; + +! pattern = getpattern (patstr, quoted, 1); + + temp1 = (char *)NULL; /* shut up gcc */ +--- 4008,4016 ---- + patstr++; + +! /* Need to pass getpattern newly-allocated memory in case of expansion -- +! the expansion code will free the passed string on an error. */ +! temp1 = savestring (patstr); +! pattern = getpattern (temp1, quoted, 1); +! free (temp1); + + temp1 = (char *)NULL; /* shut up gcc */ +*** ../bash-3.2/patchlevel.h Thu Apr 13 08:31:04 2006 +--- patchlevel.h Mon Oct 16 14:22:54 2006 +*************** +*** 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/bash32-024 b/bash32-024 new file mode 100644 index 0000000..1575f37 --- /dev/null +++ b/bash32-024 @@ -0,0 +1,77 @@ + BASH PATCH REPORT + ================= + +Bash-Release: 3.2 +Patch-ID: bash32-024 + +Bug-Reported-by: Peter Volkov +Bug-Reference-ID: <1178376645.9063.25.camel@localhost> +Bug-Reference-URL: http://bugs.gentoo.org/177095 + +Bug-Description: + +The readline display code miscalculated the screen position when performing +a redisplay in which the new text occupies more screen space that the old, +but takes fewer bytes to do so (e.g., when replacing a shorter string +containing multibyte characters with a longer one containing only ASCII). + +Patch: + +*** ../bash-3.2-patched/lib/readline/display.c Thu Apr 26 11:38:22 2007 +--- lib/readline/display.c Thu Jul 12 23:10:10 2007 +*************** +*** 1519,1527 **** + /* Non-zero if we're increasing the number of lines. */ + int gl = current_line >= _rl_vis_botlin && inv_botlin > _rl_vis_botlin; + /* Sometimes it is cheaper to print the characters rather than + use the terminal's capabilities. If we're growing the number + of lines, make sure we actually cause the new line to wrap + around on auto-wrapping terminals. */ +! if (_rl_terminal_can_insert && ((2 * col_temp) >= col_lendiff || _rl_term_IC) && (!_rl_term_autowrap || !gl)) + { + /* If lendiff > prompt_visible_length and _rl_last_c_pos == 0 and +--- 1568,1596 ---- + /* Non-zero if we're increasing the number of lines. */ + int gl = current_line >= _rl_vis_botlin && inv_botlin > _rl_vis_botlin; ++ /* If col_lendiff is > 0, implying that the new string takes up more ++ screen real estate than the old, but lendiff is < 0, meaning that it ++ takes fewer bytes, we need to just output the characters starting ++ from the first difference. These will overwrite what is on the ++ display, so there's no reason to do a smart update. This can really ++ only happen in a multibyte environment. */ ++ if (lendiff < 0) ++ { ++ _rl_output_some_chars (nfd, temp); ++ _rl_last_c_pos += _rl_col_width (nfd, 0, temp); ++ /* If nfd begins before any invisible characters in the prompt, ++ adjust _rl_last_c_pos to account for wrap_offset and set ++ cpos_adjusted to let the caller know. */ ++ if (current_line == 0 && wrap_offset && ((nfd - new) <= prompt_last_invisible)) ++ { ++ _rl_last_c_pos -= wrap_offset; ++ cpos_adjusted = 1; ++ } ++ return; ++ } + /* Sometimes it is cheaper to print the characters rather than + use the terminal's capabilities. If we're growing the number + of lines, make sure we actually cause the new line to wrap + around on auto-wrapping terminals. */ +! else if (_rl_terminal_can_insert && ((2 * col_temp) >= col_lendiff || _rl_term_IC) && (!_rl_term_autowrap || !gl)) + { + /* If lendiff > prompt_visible_length and _rl_last_c_pos == 0 and +*** ../bash-3.2/patchlevel.h Thu Apr 13 08:31:04 2006 +--- patchlevel.h Mon Oct 16 14:22:54 2006 +*************** +*** 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/bash32-025 b/bash32-025 new file mode 100644 index 0000000..4d53d89 --- /dev/null +++ b/bash32-025 @@ -0,0 +1,79 @@ + BASH PATCH REPORT + ================= + +Bash-Release: 3.2 +Patch-ID: bash32-025 + +Bug-Reported-by: Tom Bjorkholm +Bug-Reference-ID: +Bug-Reference-URL: http://lists.gnu.org/archive/html/bug-readline/2007-04/msg00004.html + +Bug-Description: + +An off-by-one error in readline's input buffering caused readline to drop +each 511th character of buffered input (e.g., when pasting a large amount +of data into a terminal window). + +Patch: + +*** ../bash-3.2-patched/lib/readline/input.c Wed Aug 16 15:15:16 2006 +--- lib/readline/input.c Tue Jul 17 09:24:21 2007 +*************** +*** 134,139 **** + + *key = ibuffer[pop_index++]; +! + if (pop_index >= ibuffer_len) + pop_index = 0; + +--- 134,142 ---- + + *key = ibuffer[pop_index++]; +! #if 0 + if (pop_index >= ibuffer_len) ++ #else ++ if (pop_index > ibuffer_len) ++ #endif + pop_index = 0; + +*************** +*** 251,255 **** + { + k = (*rl_getc_function) (rl_instream); +! rl_stuff_char (k); + if (k == NEWLINE || k == RETURN) + break; +--- 254,259 ---- + { + k = (*rl_getc_function) (rl_instream); +! if (rl_stuff_char (k) == 0) +! break; /* some problem; no more room */ + if (k == NEWLINE || k == RETURN) + break; +*************** +*** 374,378 **** +--- 378,386 ---- + } + ibuffer[push_index++] = key; ++ #if 0 + if (push_index >= ibuffer_len) ++ #else ++ if (push_index > ibuffer_len) ++ #endif + push_index = 0; + +*** ../bash-3.2/patchlevel.h Thu Apr 13 08:31:04 2006 +--- patchlevel.h Mon Oct 16 14:22:54 2006 +*************** +*** 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_ */