From f6d304b06a6b327c9333925d43950529606620d9 Mon Sep 17 00:00:00 2001 From: Ondrej Oprala Date: Dec 30 2014 19:19:18 +0000 Subject: Patchlevel 33 --- diff --git a/bash.spec b/bash.spec index 4eee738..b3939e5 100644 --- a/bash.spec +++ b/bash.spec @@ -1,5 +1,5 @@ #% define beta_tag rc2 -%define patchleveltag .30 +%define patchleveltag .33 %define baseversion 4.3 %bcond_without tests %{!?_pkgdocdir: %global _pkgdocdir %{_docdir}/%{name}-%{version}} @@ -7,7 +7,7 @@ Version: %{baseversion}%{patchleveltag} Name: bash Summary: The GNU Bourne Again shell -Release: 2%{?dist} +Release: 1%{?dist} Group: System Environment/Shells License: GPLv3+ Url: http://www.gnu.org/software/bash @@ -60,6 +60,9 @@ Patch028: bash-4.2-cve-2014-7169-2.patch Patch029: ftp://ftp.gnu.org/gnu/bash/bash-4.3-patches/bash43-029 Patch030: ftp://ftp.gnu.org/gnu/bash/bash-4.3-patches/bash43-030 +Patch031: ftp://ftp.gnu.org/gnu/bash/bash-4.3-patches/bash43-031 +Patch032: ftp://ftp.gnu.org/gnu/bash/bash-4.3-patches/bash43-032 +Patch033: ftp://ftp.gnu.org/gnu/bash/bash-4.3-patches/bash43-033 # Other patches @@ -174,6 +177,9 @@ This package contains documentation files for %{name}. %patch028 -p0 -b .7169-2 %patch029 -p0 -b .029 %patch030 -p0 -b .030 +%patch031 -p0 -b .031 +%patch032 -p0 -b .032 +%patch033 -p0 -b .033 # Other patches %patch101 -p1 -b .security @@ -402,6 +408,9 @@ end %doc doc/*.ps doc/*.0 doc/*.html doc/article.txt %changelog +* Tue Dec 30 2014 Ondrej Oprala - 4.3.33-1 +- Patchlevel 33 + * Wed Oct 08 2014 Dan HorĂ¡k - 4.3.30-2 - force refreshing generated files, fixes build on s390 diff --git a/bash43-031 b/bash43-031 new file mode 100644 index 0000000..a651956 --- /dev/null +++ b/bash43-031 @@ -0,0 +1,112 @@ + BASH PATCH REPORT + ================= + +Bash-Release: 4.3 +Patch-ID: bash43-031 + +Bug-Reported-by: lolilolicon +Bug-Reference-ID: +Bug-Reference-URL: http://lists.gnu.org/archive/html/bug-bash/2014-08/msg00139.html + +Bug-Description: + +The new nameref assignment functionality introduced in bash-4.3 did not perform +enough validation on the variable value and would create variables with +invalid names. + +Patch (apply with `patch -p0'): + +*** ../bash-4.3-patched/subst.h 2014-01-11 21:02:27.000000000 -0500 +--- subst.h 2014-09-01 12:16:56.000000000 -0400 +*************** +*** 48,51 **** +--- 48,52 ---- + #define ASS_MKGLOBAL 0x0008 /* force global assignment */ + #define ASS_NAMEREF 0x0010 /* assigning to nameref variable */ ++ #define ASS_FROMREF 0x0020 /* assigning from value of nameref variable */ + + /* Flags for the string extraction functions. */ +*** ../bash-4.3-patched/variables.c 2014-05-15 08:26:50.000000000 -0400 +--- variables.c 2014-09-01 14:37:44.000000000 -0400 +*************** +*** 2504,2511 **** + int hflags, aflags; + { +! char *newval; + SHELL_VAR *entry; + + entry = (hflags & HASH_NOSRCH) ? (SHELL_VAR *)NULL : hash_lookup (name, table); + /* Follow the nameref chain here if this is the global variables table */ + if (entry && nameref_p (entry) && (invisible_p (entry) == 0) && table == global_variables->table) +--- 2566,2590 ---- + int hflags, aflags; + { +! char *newname, *newval; + SHELL_VAR *entry; ++ #if defined (ARRAY_VARS) ++ arrayind_t ind; ++ char *subp; ++ int sublen; ++ #endif + ++ newname = 0; ++ #if defined (ARRAY_VARS) ++ if ((aflags & ASS_FROMREF) && (hflags & HASH_NOSRCH) == 0 && valid_array_reference (name)) ++ { ++ newname = array_variable_name (name, &subp, &sublen); ++ if (newname == 0) ++ return (SHELL_VAR *)NULL; /* XXX */ ++ entry = hash_lookup (newname, table); ++ } ++ else ++ #endif + entry = (hflags & HASH_NOSRCH) ? (SHELL_VAR *)NULL : hash_lookup (name, table); ++ + /* Follow the nameref chain here if this is the global variables table */ + if (entry && nameref_p (entry) && (invisible_p (entry) == 0) && table == global_variables->table) +*************** +*** 2538,2541 **** +--- 2617,2630 ---- + } + } ++ #if defined (ARRAY_VARS) ++ else if (entry == 0 && newname) ++ { ++ entry = make_new_array_variable (newname); /* indexed array by default */ ++ if (entry == 0) ++ return entry; ++ ind = array_expand_index (name, subp, sublen); ++ bind_array_element (entry, ind, value, aflags); ++ } ++ #endif + else if (entry == 0) + { +*************** +*** 2658,2662 **** + if (nameref_cell (nv) == 0) + return (bind_variable_internal (nv->name, value, nvc->table, 0, flags)); +! return (bind_variable_internal (nameref_cell (nv), value, nvc->table, 0, flags)); + } + else +--- 2747,2752 ---- + if (nameref_cell (nv) == 0) + return (bind_variable_internal (nv->name, value, nvc->table, 0, flags)); +! /* XXX - bug here with ref=array[index] */ +! return (bind_variable_internal (nameref_cell (nv), value, nvc->table, 0, flags|ASS_FROMREF)); + } + else +*** ../bash-4.3/patchlevel.h 2012-12-29 10:47:57.000000000 -0500 +--- patchlevel.h 2014-03-20 20:01:28.000000000 -0400 +*************** +*** 26,30 **** + looks for to find the patch level (for the sccs version string). */ + +! #define PATCHLEVEL 30 + + #endif /* _PATCHLEVEL_H_ */ +--- 26,30 ---- + looks for to find the patch level (for the sccs version string). */ + +! #define PATCHLEVEL 31 + + #endif /* _PATCHLEVEL_H_ */ diff --git a/bash43-032 b/bash43-032 new file mode 100644 index 0000000..0843719 --- /dev/null +++ b/bash43-032 @@ -0,0 +1,51 @@ + BASH PATCH REPORT + ================= + +Bash-Release: 4.3 +Patch-ID: bash43-032 + +Bug-Reported-by: crispusfairbairn@gmail.com +Bug-Reference-ID: +Bug-Reference-URL: http://lists.gnu.org/archive/html/bug-bash/2014-09/msg00013.html + +Bug-Description: + +When bash is running in Posix mode, it allows signals -- including SIGCHLD -- +to interrupt the `wait' builtin, as Posix requires. However, the interrupt +causes bash to not run a SIGCHLD trap for all exited children. This patch +fixes the issue and restores the documented behavior in Posix mode. + +Patch (apply with `patch -p0'): + +*** ../bash-4.3-patched/jobs.c 2014-05-14 09:20:15.000000000 -0400 +--- jobs.c 2014-09-09 11:50:38.000000000 -0400 +*************** +*** 3340,3344 **** + { + interrupt_immediately = 0; +! trap_handler (SIGCHLD); /* set pending_traps[SIGCHLD] */ + wait_signal_received = SIGCHLD; + /* If we're in a signal handler, let CHECK_WAIT_INTR pick it up; +--- 3346,3352 ---- + { + interrupt_immediately = 0; +! /* This was trap_handler (SIGCHLD) but that can lose traps if +! children_exited > 1 */ +! queue_sigchld_trap (children_exited); + wait_signal_received = SIGCHLD; + /* If we're in a signal handler, let CHECK_WAIT_INTR pick it up; +*** ../bash-4.3/patchlevel.h 2012-12-29 10:47:57.000000000 -0500 +--- patchlevel.h 2014-03-20 20:01:28.000000000 -0400 +*************** +*** 26,30 **** + looks for to find the patch level (for the sccs version string). */ + +! #define PATCHLEVEL 31 + + #endif /* _PATCHLEVEL_H_ */ +--- 26,30 ---- + looks for to find the patch level (for the sccs version string). */ + +! #define PATCHLEVEL 32 + + #endif /* _PATCHLEVEL_H_ */ diff --git a/bash43-033 b/bash43-033 new file mode 100644 index 0000000..5f5147f --- /dev/null +++ b/bash43-033 @@ -0,0 +1,225 @@ + BASH PATCH REPORT + ================= + +Bash-Release: 4.3 +Patch-ID: bash43-033 + +Bug-Reported-by: mickael9@gmail.com, Jan Rome +Bug-Reference-ID: <20140907224046.382ED3610CC@mickael-laptop.localdomain>, + <540D661D.50908@gmail.com> +Bug-Reference-URL: http://lists.gnu.org/archive/html/bug-bash/2014-09/msg00029.html + http://lists.gnu.org/archive/html/bug-bash/2014-09/msg00030.html + +Bug-Description: + +Bash does not clean up the terminal state in all cases where bash or +readline modifies it and bash is subsequently terminated by a fatal signal. +This happens when the `read' builtin modifies the terminal settings, both +when readline is active and when it is not. It occurs most often when a script +installs a trap that exits on a signal without re-sending the signal to itself. + +Patch (apply with `patch -p0'): + +*** ../bash-4.3-patched/shell.c 2014-01-14 08:04:32.000000000 -0500 +--- shell.c 2014-12-22 10:27:50.000000000 -0500 +*************** +*** 74,77 **** +--- 74,78 ---- + + #if defined (READLINE) ++ # include + # include "bashline.h" + #endif +*************** +*** 910,913 **** +--- 912,923 ---- + fflush (stderr); + ++ /* Clean up the terminal if we are in a state where it's been modified. */ ++ #if defined (READLINE) ++ if (RL_ISSTATE (RL_STATE_TERMPREPPED) && rl_deprep_term_function) ++ (*rl_deprep_term_function) (); ++ #endif ++ if (read_tty_modified ()) ++ read_tty_cleanup (); ++ + /* Do trap[0] if defined. Allow it to override the exit status + passed to us. */ +*** ../bash-4.3-patched/builtins/read.def 2014-10-01 12:57:38.000000000 -0400 +--- builtins/read.def 2014-12-22 10:48:54.000000000 -0500 +*************** +*** 141,148 **** + int sigalrm_seen; + +! static int reading; + static SigHandler *old_alrm; + static unsigned char delim; + + /* In all cases, SIGALRM just sets a flag that we check periodically. This + avoids problems with the semi-tricky stuff we do with the xfree of +--- 141,150 ---- + int sigalrm_seen; + +! static int reading, tty_modified; + static SigHandler *old_alrm; + static unsigned char delim; + ++ static struct ttsave termsave; ++ + /* In all cases, SIGALRM just sets a flag that we check periodically. This + avoids problems with the semi-tricky stuff we do with the xfree of +*************** +*** 189,193 **** + SHELL_VAR *var; + TTYSTRUCT ttattrs, ttset; +- struct ttsave termsave; + #if defined (ARRAY_VARS) + WORD_LIST *alist; +--- 191,194 ---- +*************** +*** 222,226 **** + USE_VAR(lastsig); + +! sigalrm_seen = reading = 0; + + i = 0; /* Index into the string that we are reading. */ +--- 223,227 ---- + USE_VAR(lastsig); + +! sigalrm_seen = reading = tty_modified = 0; + + i = 0; /* Index into the string that we are reading. */ +*************** +*** 439,442 **** +--- 440,445 ---- + goto assign_vars; + } ++ if (interactive_shell == 0) ++ initialize_terminating_signals (); + old_alrm = set_signal_handler (SIGALRM, sigalrm); + add_unwind_protect (reset_alarm, (char *)NULL); +*************** +*** 483,487 **** +--- 486,493 ---- + if (i < 0) + sh_ttyerror (1); ++ tty_modified = 1; + add_unwind_protect ((Function *)ttyrestore, (char *)&termsave); ++ if (interactive_shell == 0) ++ initialize_terminating_signals (); + } + } +*************** +*** 498,502 **** +--- 504,511 ---- + sh_ttyerror (1); + ++ tty_modified = 1; + add_unwind_protect ((Function *)ttyrestore, (char *)&termsave); ++ if (interactive_shell == 0) ++ initialize_terminating_signals (); + } + +*************** +*** 589,592 **** +--- 598,603 ---- + else + lastsig = 0; ++ if (terminating_signal && tty_modified) ++ ttyrestore (&termsave); /* fix terminal before exiting */ + CHECK_TERMSIG; + eof = 1; +*************** +*** 979,982 **** +--- 990,1007 ---- + { + ttsetattr (ttp->fd, ttp->attrs); ++ tty_modified = 0; ++ } ++ ++ void ++ read_tty_cleanup () ++ { ++ if (tty_modified) ++ ttyrestore (&termsave); ++ } ++ ++ int ++ read_tty_modified () ++ { ++ return (tty_modified); + } + +*** ../bash-4.3-patched/builtins/common.h 2014-10-01 12:57:47.000000000 -0400 +--- builtins/common.h 2014-12-22 10:10:14.000000000 -0500 +*************** +*** 123,126 **** +--- 141,148 ---- + extern void getopts_reset __P((int)); + ++ /* Functions from read.def */ ++ extern void read_tty_cleanup __P((void)); ++ extern int read_tty_modified __P((void)); ++ + /* Functions from set.def */ + extern int minus_o_option_value __P((char *)); +*** ../bash-4.3-patched/bashline.c 2014-05-14 09:22:39.000000000 -0400 +--- bashline.c 2014-09-08 11:28:56.000000000 -0400 +*************** +*** 203,206 **** +--- 203,207 ---- + extern int array_needs_making; + extern int posixly_correct, no_symbolic_links; ++ extern int sigalrm_seen; + extern char *current_prompt_string, *ps1_prompt; + extern STRING_INT_ALIST word_token_alist[]; +*************** +*** 4209,4214 **** + /* If we're going to longjmp to top_level, make sure we clean up readline. + check_signals will call QUIT, which will eventually longjmp to top_level, +! calling run_interrupt_trap along the way. */ +! if (interrupt_state) + rl_cleanup_after_signal (); + bashline_reset_event_hook (); +--- 4262,4268 ---- + /* If we're going to longjmp to top_level, make sure we clean up readline. + check_signals will call QUIT, which will eventually longjmp to top_level, +! calling run_interrupt_trap along the way. The check for sigalrm_seen is +! to clean up the read builtin's state. */ +! if (terminating_signal || interrupt_state || sigalrm_seen) + rl_cleanup_after_signal (); + bashline_reset_event_hook (); +*** ../bash-4.3-patched/sig.c 2014-01-10 15:06:06.000000000 -0500 +--- sig.c 2014-09-08 11:26:33.000000000 -0400 +*************** +*** 533,538 **** + /* Set the event hook so readline will call it after the signal handlers + finish executing, so if this interrupted character input we can get +! quick response. */ +! if (interactive_shell && interactive && no_line_editing == 0) + bashline_set_event_hook (); + #endif +--- 533,540 ---- + /* Set the event hook so readline will call it after the signal handlers + finish executing, so if this interrupted character input we can get +! quick response. If readline is active or has modified the terminal we +! need to set this no matter what the signal is, though the check for +! RL_STATE_TERMPREPPED is possibly redundant. */ +! if (RL_ISSTATE (RL_STATE_SIGHANDLER) || RL_ISSTATE (RL_STATE_TERMPREPPED)) + bashline_set_event_hook (); + #endif +*** ../bash-4.3/patchlevel.h 2012-12-29 10:47:57.000000000 -0500 +--- patchlevel.h 2014-03-20 20:01:28.000000000 -0400 +*************** +*** 26,30 **** + looks for to find the patch level (for the sccs version string). */ + +! #define PATCHLEVEL 32 + + #endif /* _PATCHLEVEL_H_ */ +--- 26,30 ---- + looks for to find the patch level (for the sccs version string). */ + +! #define PATCHLEVEL 33 + + #endif /* _PATCHLEVEL_H_ */