diff -Nru bash-4.3/debian/changelog bash-4.3/debian/changelog --- bash-4.3/debian/changelog 2015-05-27 12:01:21.000000000 -0300 +++ bash-4.3/debian/changelog 2015-07-29 18:40:53.000000000 -0300 @@ -1,3 +1,35 @@ +bash (4.3-13ubuntu1) UNRELEASED; urgency=medium + + * Merge with Debian; remaining changes: + - skel.bashrc: + - Run lesspipe. + - Enable ls aliases. + - Set options in ll alias to -alF. + - Define an alert alias. + - Enabled colored grep aliases. + - etc.bash.bashrc: + - Add sudo hint. + + -- Tiago Stürmer Daitx Wed, 29 Jul 2015 18:37:59 -0300 + +bash (4.3-13) unstable; urgency=medium + + * Apply upstream patches 034 - 039. + * Disallow setuid scripts if not called as `sh' and not called with + the -p option. Closes: #720545, #734866. + + -- Matthias Klose Sun, 26 Jul 2015 14:53:19 +0200 + +bash (4.3-12) unstable; urgency=medium + + * Apply upstream patches 031 - 033. + * Add a Built-Using attribute for bash-static. Closes: #769342. + * Move definition of the macro "FN" out of the region of the "ig" + macro. Define macros and registers "zZ" and "zY". Closes: #774597. + * Also set color prompt for *-256color terminals. Closes: #766443. + + -- Matthias Klose Wed, 28 Jan 2015 17:05:00 +0100 + bash (4.3-11ubuntu3) wily; urgency=medium * debian/patches/privmode.diff: disabled patch to re-enable proper diff -Nru bash-4.3/debian/control bash-4.3/debian/control --- bash-4.3/debian/control 2014-09-30 15:50:05.000000000 -0300 +++ bash-4.3/debian/control 2015-07-29 18:24:53.000000000 -0300 @@ -42,6 +42,7 @@ Suggests: bash-doc Section: shells Priority: optional +Built-Using: ${glibc:Source} Description: GNU Bourne Again SHell (static version) Bash is an sh-compatible command language interpreter that executes commands read from the standard input or from a file. Bash also diff -Nru bash-4.3/debian/patches/bash43-031.diff bash-4.3/debian/patches/bash43-031.diff --- bash-4.3/debian/patches/bash43-031.diff 1969-12-31 21:00:00.000000000 -0300 +++ bash-4.3/debian/patches/bash43-031.diff 2015-07-29 18:24:53.000000000 -0300 @@ -0,0 +1,100 @@ + 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. + +Index: b/patchlevel.h +=================================================================== +--- 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 30 ++#define PATCHLEVEL 31 + + #endif /* _PATCHLEVEL_H_ */ +Index: b/subst.h +=================================================================== +--- a/subst.h ++++ b/subst.h +@@ -47,6 +47,7 @@ + #define ASS_MKASSOC 0x0004 + #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. */ + #define SX_NOALLOC 0x0001 /* just skip; don't return substring */ +Index: b/variables.c +=================================================================== +--- a/variables.c ++++ b/variables.c +@@ -2516,10 +2516,27 @@ bind_variable_internal (name, value, tab + HASH_TABLE *table; + int hflags, aflags; + { +- char *newval; ++ 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) + { +@@ -2550,6 +2567,16 @@ bind_variable_internal (name, value, tab + var_setvalue (entry, make_variable_value (entry, value, 0)); + } + } ++#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) + { + entry = make_new_variable (name, table); +@@ -2670,7 +2697,8 @@ bind_variable (name, value, flags) + normal. */ + 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)); ++ /* XXX - bug here with ref=array[index] */ ++ return (bind_variable_internal (nameref_cell (nv), value, nvc->table, 0, flags|ASS_FROMREF)); + } + else + v = nv; diff -Nru bash-4.3/debian/patches/bash43-032.diff bash-4.3/debian/patches/bash43-032.diff --- bash-4.3/debian/patches/bash43-032.diff 1969-12-31 21:00:00.000000000 -0300 +++ bash-4.3/debian/patches/bash43-032.diff 2015-07-29 18:24:53.000000000 -0300 @@ -0,0 +1,44 @@ + 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. + +Index: b/jobs.c +=================================================================== +--- a/jobs.c ++++ b/jobs.c +@@ -3339,7 +3339,9 @@ itrace("waitchld: waitpid returns %d blo + if (posixly_correct && this_shell_builtin && this_shell_builtin == wait_builtin) + { + interrupt_immediately = 0; +- trap_handler (SIGCHLD); /* set pending_traps[SIGCHLD] */ ++ /* 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; + run_pending_traps will call run_sigchld_trap later */ +Index: b/patchlevel.h +=================================================================== +--- 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 31 ++#define PATCHLEVEL 32 + + #endif /* _PATCHLEVEL_H_ */ diff -Nru bash-4.3/debian/patches/bash43-033.diff bash-4.3/debian/patches/bash43-033.diff --- bash-4.3/debian/patches/bash43-033.diff 1969-12-31 21:00:00.000000000 -0300 +++ bash-4.3/debian/patches/bash43-033.diff 2015-07-29 18:24:53.000000000 -0300 @@ -0,0 +1,211 @@ + 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. + +Index: b/bashline.c +=================================================================== +--- a/bashline.c ++++ b/bashline.c +@@ -202,6 +202,7 @@ extern int current_command_line_count, s + extern int last_command_exit_value; + 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[]; + extern sh_builtin_func_t *last_shell_builtin, *this_shell_builtin; +@@ -4208,8 +4209,9 @@ bash_event_hook () + { + /* 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) ++ 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 (); + check_signals_and_traps (); /* XXX */ +Index: b/builtins/common.h +=================================================================== +--- a/builtins/common.h ++++ b/builtins/common.h +@@ -122,6 +122,10 @@ extern void bash_logout __P((void)); + /* Functions from getopts.def */ + 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 *)); + extern void list_minus_o_opts __P((int, int)); +Index: b/builtins/read.def +=================================================================== +--- a/builtins/read.def ++++ b/builtins/read.def +@@ -140,10 +140,12 @@ static void reset_alarm __P((void)); + procenv_t alrmbuf; + int sigalrm_seen; + +-static int reading; ++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 + input_string at the top of the unwind-protect list (see below). */ +@@ -188,7 +190,6 @@ read_builtin (list) + struct stat tsb; + SHELL_VAR *var; + TTYSTRUCT ttattrs, ttset; +- struct ttsave termsave; + #if defined (ARRAY_VARS) + WORD_LIST *alist; + #endif +@@ -221,7 +222,7 @@ read_builtin (list) + USE_VAR(ps2); + USE_VAR(lastsig); + +- sigalrm_seen = reading = 0; ++ sigalrm_seen = reading = tty_modified = 0; + + i = 0; /* Index into the string that we are reading. */ + raw = edit = 0; /* Not reading raw input by default. */ +@@ -438,6 +439,8 @@ read_builtin (list) + retval = 128+SIGALRM; + goto assign_vars; + } ++ if (interactive_shell == 0) ++ initialize_terminating_signals (); + old_alrm = set_signal_handler (SIGALRM, sigalrm); + add_unwind_protect (reset_alarm, (char *)NULL); + #if defined (READLINE) +@@ -482,7 +485,10 @@ read_builtin (list) + i = silent ? ttfd_cbreak (fd, &ttset) : ttfd_onechar (fd, &ttset); + if (i < 0) + sh_ttyerror (1); ++ tty_modified = 1; + add_unwind_protect ((Function *)ttyrestore, (char *)&termsave); ++ if (interactive_shell == 0) ++ initialize_terminating_signals (); + } + } + else if (silent) /* turn off echo but leave term in canonical mode */ +@@ -497,7 +503,10 @@ read_builtin (list) + if (i < 0) + sh_ttyerror (1); + ++ tty_modified = 1; + add_unwind_protect ((Function *)ttyrestore, (char *)&termsave); ++ if (interactive_shell == 0) ++ initialize_terminating_signals (); + } + + /* This *must* be the top unwind-protect on the stack, so the manipulation +@@ -588,6 +597,8 @@ read_builtin (list) + } + else + lastsig = 0; ++ if (terminating_signal && tty_modified) ++ ttyrestore (&termsave); /* fix terminal before exiting */ + CHECK_TERMSIG; + eof = 1; + break; +@@ -978,6 +989,20 @@ ttyrestore (ttp) + struct ttsave *ttp; + { + ttsetattr (ttp->fd, ttp->attrs); ++ tty_modified = 0; ++} ++ ++void ++read_tty_cleanup () ++{ ++ if (tty_modified) ++ ttyrestore (&termsave); ++} ++ ++int ++read_tty_modified () ++{ ++ return (tty_modified); + } + + #if defined (READLINE) +Index: b/patchlevel.h +=================================================================== +--- 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 32 ++#define PATCHLEVEL 33 + + #endif /* _PATCHLEVEL_H_ */ +Index: b/shell.c +=================================================================== +--- a/shell.c ++++ b/shell.c +@@ -73,6 +73,7 @@ + #endif + + #if defined (READLINE) ++# include + # include "bashline.h" + #endif + +@@ -909,6 +910,14 @@ exit_shell (s) + fflush (stdout); /* XXX */ + 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. */ + if (signal_is_trapped (0)) +Index: b/sig.c +=================================================================== +--- a/sig.c ++++ b/sig.c +@@ -532,8 +532,10 @@ termsig_sighandler (sig) + #if defined (READLINE) + /* 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) ++ 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 + diff -Nru bash-4.3/debian/patches/bash43-034.diff bash-4.3/debian/patches/bash43-034.diff --- bash-4.3/debian/patches/bash43-034.diff 1969-12-31 21:00:00.000000000 -0300 +++ bash-4.3/debian/patches/bash43-034.diff 2015-07-29 18:24:53.000000000 -0300 @@ -0,0 +1,76 @@ + BASH PATCH REPORT + ================= + +Bash-Release: 4.3 +Patch-ID: bash43-034 + +Bug-Reported-by: Dreamcat4 +Bug-Reference-ID: +Bug-Reference-URL: http://lists.gnu.org/archive/html/bug-bash/2015-05/msg00001.html + +Bug-Description: + +If neither the -f nor -v options is supplied to unset, and a name argument is +found to be a function and unset, subsequent name arguments are not treated as +variables before attempting to unset a function by that name. + +Index: b/builtins/set.def +=================================================================== +--- a/builtins/set.def ++++ b/builtins/set.def +@@ -751,9 +751,11 @@ unset_builtin (list) + WORD_LIST *list; + { + int unset_function, unset_variable, unset_array, opt, nameref, any_failed; ++ int global_unset_func, global_unset_var; + char *name; + + unset_function = unset_variable = unset_array = nameref = any_failed = 0; ++ global_unset_func = global_unset_var = 0; + + reset_internal_getopt (); + while ((opt = internal_getopt (list, "fnv")) != -1) +@@ -761,10 +763,10 @@ unset_builtin (list) + switch (opt) + { + case 'f': +- unset_function = 1; ++ global_unset_func = 1; + break; + case 'v': +- unset_variable = 1; ++ global_unset_var = 1; + break; + case 'n': + nameref = 1; +@@ -777,7 +779,7 @@ unset_builtin (list) + + list = loptend; + +- if (unset_function && unset_variable) ++ if (global_unset_func && global_unset_var) + { + builtin_error (_("cannot simultaneously unset a function and a variable")); + return (EXECUTION_FAILURE); +@@ -795,6 +797,9 @@ unset_builtin (list) + + name = list->word->word; + ++ unset_function = global_unset_func; ++ unset_variable = global_unset_var; ++ + #if defined (ARRAY_VARS) + unset_array = 0; + if (!unset_function && valid_array_reference (name)) +Index: b/patchlevel.h +=================================================================== +--- 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 33 ++#define PATCHLEVEL 34 + + #endif /* _PATCHLEVEL_H_ */ diff -Nru bash-4.3/debian/patches/bash43-035.diff bash-4.3/debian/patches/bash43-035.diff --- bash-4.3/debian/patches/bash43-035.diff 1969-12-31 21:00:00.000000000 -0300 +++ bash-4.3/debian/patches/bash43-035.diff 2015-07-29 18:24:53.000000000 -0300 @@ -0,0 +1,50 @@ + BASH PATCH REPORT + ================= + +Bash-Release: 4.3 +Patch-ID: bash43-035 + +Bug-Reported-by: +Bug-Reference-ID: +Bug-Reference-URL: http://lists.gnu.org/archive/html/bug-bash/2014-08/msg00045.html + +Bug-Description: + +A locale with a long name can trigger a buffer overflow and core dump. This +applies on systems that do not have locale_charset in libc, are not using +GNU libiconv, and are not using the libintl that ships with bash in lib/intl. + +Index: b/lib/sh/unicode.c +=================================================================== +--- a/lib/sh/unicode.c ++++ b/lib/sh/unicode.c +@@ -78,13 +78,15 @@ stub_charset () + s = strrchr (locale, '.'); + if (s) + { +- strcpy (charsetbuf, s+1); ++ strncpy (charsetbuf, s+1, sizeof (charsetbuf) - 1); ++ charsetbuf[sizeof (charsetbuf) - 1] = '\0'; + t = strchr (charsetbuf, '@'); + if (t) + *t = 0; + return charsetbuf; + } +- strcpy (charsetbuf, locale); ++ strncpy (charsetbuf, locale, sizeof (charsetbuf) - 1); ++ charsetbuf[sizeof (charsetbuf) - 1] = '\0'; + return charsetbuf; + } + #endif +Index: b/patchlevel.h +=================================================================== +--- 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 34 ++#define PATCHLEVEL 35 + + #endif /* _PATCHLEVEL_H_ */ diff -Nru bash-4.3/debian/patches/bash43-036.diff bash-4.3/debian/patches/bash43-036.diff --- bash-4.3/debian/patches/bash43-036.diff 1969-12-31 21:00:00.000000000 -0300 +++ bash-4.3/debian/patches/bash43-036.diff 2015-07-29 18:24:53.000000000 -0300 @@ -0,0 +1,52 @@ + BASH PATCH REPORT + ================= + +Bash-Release: 4.3 +Patch-ID: bash43-036 + +Bug-Reported-by: emanuelczirai@cryptolab.net +Bug-Reference-ID: +Bug-Reference-URL: http://lists.gnu.org/archive/html/bug-bash/2015-02/msg00071.html + +Bug-Description: + +When evaluating and setting integer variables, and the assignment fails to +create a variable (for example, when performing an operation on an array +variable with an invalid subscript), bash attempts to dereference a null +pointer, causing a segmentation violation. + +Patch (apply with `patch -p0'): + +Index: b/patchlevel.h +=================================================================== +--- 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 35 ++#define PATCHLEVEL 36 + + #endif /* _PATCHLEVEL_H_ */ +Index: b/variables.c +=================================================================== +--- a/variables.c ++++ b/variables.c +@@ -2833,10 +2833,12 @@ bind_int_variable (lhs, rhs) + #endif + v = bind_variable (lhs, rhs, 0); + +- if (v && isint) +- VSETATTR (v, att_integer); +- +- VUNSETATTR (v, att_invisible); ++ if (v) ++ { ++ if (isint) ++ VSETATTR (v, att_integer); ++ VUNSETATTR (v, att_invisible); ++ } + + return (v); + } diff -Nru bash-4.3/debian/patches/bash43-037.diff bash-4.3/debian/patches/bash43-037.diff --- bash-4.3/debian/patches/bash43-037.diff 1969-12-31 21:00:00.000000000 -0300 +++ bash-4.3/debian/patches/bash43-037.diff 2015-07-29 18:24:53.000000000 -0300 @@ -0,0 +1,40 @@ + BASH PATCH REPORT + ================= + +Bash-Release: 4.3 +Patch-ID: bash43-037 + +Bug-Reported-by: Greg Wooledge +Bug-Reference-ID: <20150204144240.GN13956@eeg.ccf.org> +Bug-Reference-URL: http://lists.gnu.org/archive/html/bug-bash/2015-02/msg00007.html + +Bug-Description: + +If an associative array uses `@' or `*' as a subscript, `declare -p' produces +output that cannot be reused as input. + +Index: b/assoc.c +=================================================================== +--- a/assoc.c ++++ b/assoc.c +@@ -436,6 +436,8 @@ assoc_to_assign (hash, quoted) + #if 1 + if (sh_contains_shell_metas (tlist->key)) + istr = sh_double_quote (tlist->key); ++ else if (ALL_ELEMENT_SUB (tlist->key[0]) && tlist->key[1] == '\0') ++ istr = sh_double_quote (tlist->key); + else + istr = tlist->key; + #else +Index: b/patchlevel.h +=================================================================== +--- 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 36 ++#define PATCHLEVEL 37 + + #endif /* _PATCHLEVEL_H_ */ diff -Nru bash-4.3/debian/patches/bash43-038.diff bash-4.3/debian/patches/bash43-038.diff --- bash-4.3/debian/patches/bash43-038.diff 1969-12-31 21:00:00.000000000 -0300 +++ bash-4.3/debian/patches/bash43-038.diff 2015-07-29 18:24:53.000000000 -0300 @@ -0,0 +1,71 @@ + BASH PATCH REPORT + ================= + +Bash-Release: 4.3 +Patch-ID: bash43-038 + +Bug-Reported-by: worley@alum.mit.edu (Dale R. Worley) +Bug-Reference-ID: <201406100051.s5A0pCeB014978@hobgoblin.ariadne.com> +Bug-Reference-URL: http://lists.gnu.org/archive/html/bug-bash/2014-06/msg00028.html + +Bug-Description: + +There are a number of instances where `time' is not recognized as a reserved +word when the shell grammar says it should be. + +Index: b/parse.y +=================================================================== +--- a/parse.y ++++ b/parse.y +@@ -2818,11 +2818,16 @@ time_command_acceptable () + case AND_AND: + case OR_OR: + case '&': ++ case WHILE: + case DO: ++ case UNTIL: ++ case IF: + case THEN: ++ case ELIF: + case ELSE: + case '{': /* } */ +- case '(': /* ) */ ++ case '(': /* )( */ ++ case ')': /* only valid in case statement */ + case BANG: /* ! time pipeline */ + case TIME: /* time time pipeline */ + case TIMEOPT: /* time -p time pipeline */ +Index: b/patchlevel.h +=================================================================== +--- 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 37 ++#define PATCHLEVEL 38 + + #endif /* _PATCHLEVEL_H_ */ +Index: b/y.tab.c +=================================================================== +--- a/y.tab.c ++++ b/y.tab.c +@@ -5130,11 +5130,16 @@ time_command_acceptable () + case AND_AND: + case OR_OR: + case '&': ++ case WHILE: + case DO: ++ case UNTIL: ++ case IF: + case THEN: ++ case ELIF: + case ELSE: + case '{': /* } */ +- case '(': /* ) */ ++ case '(': /* )( */ ++ case ')': /* only valid in case statement */ + case BANG: /* ! time pipeline */ + case TIME: /* time time pipeline */ + case TIMEOPT: /* time -p time pipeline */ diff -Nru bash-4.3/debian/patches/bash43-039.diff bash-4.3/debian/patches/bash43-039.diff --- bash-4.3/debian/patches/bash43-039.diff 1969-12-31 21:00:00.000000000 -0300 +++ bash-4.3/debian/patches/bash43-039.diff 2015-07-29 18:24:53.000000000 -0300 @@ -0,0 +1,54 @@ + BASH PATCH REPORT + ================= + +Bash-Release: 4.3 +Patch-ID: bash43-039 + +Bug-Reported-by: SN +Bug-Reference-ID: <54E2554C.205@gazeta.pl> +Bug-Reference-URL: http://lists.gnu.org/archive/html/bug-bash/2015-02/msg00060.html + +Bug-Description: + +Using the output of `declare -p' when run in a function can result in variables +that are invisible to `declare -p'. This problem occurs when an assignment +builtin such as `declare' receives a quoted compound array assignment as one of +its arguments. + +Index: b/arrayfunc.c +=================================================================== +--- a/arrayfunc.c ++++ b/arrayfunc.c +@@ -404,6 +404,9 @@ assign_array_var_from_word_list (var, li + (*var->assign_func) (var, l->word->word, i, 0); + else + array_insert (a, i, l->word->word); ++ ++ VUNSETATTR (var, att_invisible); /* no longer invisible */ ++ + return var; + } + +@@ -634,6 +637,10 @@ assign_array_var_from_string (var, value + + if (nlist) + dispose_words (nlist); ++ ++ if (var) ++ VUNSETATTR (var, att_invisible); /* no longer invisible */ ++ + return (var); + } + +Index: b/patchlevel.h +=================================================================== +--- 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 38 ++#define PATCHLEVEL 39 + + #endif /* _PATCHLEVEL_H_ */ diff -Nru bash-4.3/debian/patches/man-macro-warnings.diff bash-4.3/debian/patches/man-macro-warnings.diff --- bash-4.3/debian/patches/man-macro-warnings.diff 1969-12-31 21:00:00.000000000 -0300 +++ bash-4.3/debian/patches/man-macro-warnings.diff 2015-07-29 18:24:53.000000000 -0300 @@ -0,0 +1,53 @@ +# DP: Move definition of the macro "FN" out of the region of the "ig" +# DP: macro. Define macros and registers "zZ" and "zY". + +--- a/doc/bash.1 ++++ b/doc/bash.1 +@@ -8,6 +8,22 @@ + .\" Last Change: Sun Feb 2 16:21:40 EST 2014 + .\" + .\" bash_builtins, strip all but Built-Ins section ++.de zZ ++.. ++.de zY ++.. ++.\" ++.\" File Name macro. This used to be `.PN', for Path Name, ++.\" but Sun doesn't seem to like that very much. ++.\" ++.de FN ++\fI\|\\$1\|\fP ++.. ++.\" Number register zZ is defined in bash-builtins(7) ++.\" Number register zY is defined in rbash(1) ++.\" This man-page is included in them ++.if !rzZ .nr zZ 0 \" avoid a warning about an undefined register ++.if !rzY .nr zY 0 \" avoid a warning about an undefined register + .if \n(zZ=1 .ig zZ + .if \n(zY=1 .ig zY + .TH BASH 1 "2014 February 2" "GNU Bash 4.3" +@@ -36,13 +52,6 @@ + .el \\*(]X\h|\\n()Iu+\\n()Ru\c + .}f + .. +-.\" +-.\" File Name macro. This used to be `.PN', for Path Name, +-.\" but Sun doesn't seem to like that very much. +-.\" +-.de FN +-\fI\|\\$1\|\fP +-.. + .SH NAME + bash \- GNU Bourne-Again SHell + .SH SYNOPSIS +@@ -2282,8 +2291,8 @@ The default path is system-dependent, + and is set by the administrator who installs + .BR bash . + A common value is +-.if t \f(CW/usr/local/bin:/usr/local/sbin:/usr/bin:/usr/sbin:/bin:/sbin\fP. +-.if n ``/usr/local/bin:/usr/local/sbin:/usr/bin:/usr/sbin:/bin:/sbin''. ++.if t \f(CW/usr/local/bin:\:/usr/local/sbin:\:/usr/bin:\:/usr/sbin:\:/bin:\:/sbin\fP. ++.if n ``/usr/local/bin:\:/usr/local/sbin:\:/usr/bin:\:/usr/sbin:\:/bin:\:/sbin''. + .TP + .B POSIXLY_CORRECT + If this variable is in the environment when \fBbash\fP starts, the shell diff -Nru bash-4.3/debian/patches/privmode.diff bash-4.3/debian/patches/privmode.diff --- bash-4.3/debian/patches/privmode.diff 2013-10-23 10:41:22.000000000 -0200 +++ bash-4.3/debian/patches/privmode.diff 1969-12-31 21:00:00.000000000 -0300 @@ -1,19 +0,0 @@ -# DP: XXX missing description -# DP: -# DP: Comment from Chet Ramey : -# DP: -# DP: Nope. This will allow setuid scripts if not called as `sh' and not -# DP: called with the -p option. I won't install this. - - ---- a/shell.c -+++ b/shell.c -@@ -492,7 +492,7 @@ - if (dump_translatable_strings) - read_but_dont_execute = 1; - -- if (running_setuid && privileged_mode == 0) -+ if (running_setuid && privileged_mode == 0 && act_like_sh == 0) - disable_priv_mode (); - - /* Need to get the argument to a -c option processed in the diff -Nru bash-4.3/debian/patches/series bash-4.3/debian/patches/series --- bash-4.3/debian/patches/series 2015-05-27 11:57:53.000000000 -0300 +++ bash-4.3/debian/patches/series 2015-07-29 18:36:01.000000000 -0300 @@ -28,6 +28,15 @@ bash43-028.diff bash43-029.diff bash43-030.diff +bash43-031.diff +bash43-032.diff +bash43-033.diff +bash43-034.diff +bash43-035.diff +bash43-036.diff +bash43-037.diff +bash43-038.diff +bash43-039.diff bashbug-editor.diff deb-bash-config.diff deb-examples.diff @@ -38,7 +47,6 @@ man-nocaseglob.diff man-test.diff man-test2.diff -#privmode.diff rbash-manpage.diff bash-default-editor.diff bash-subst-param-length.diff @@ -49,3 +57,4 @@ # no-brk-caching.diff use-system-texi2html.diff bzero.diff +man-macro-warnings.diff diff -Nru bash-4.3/debian/rules bash-4.3/debian/rules --- bash-4.3/debian/rules 2014-04-07 20:02:36.000000000 -0300 +++ bash-4.3/debian/rules 2015-07-29 18:24:53.000000000 -0300 @@ -350,7 +350,8 @@ dh_compress -p$(p_stat) dh_fixperms -p$(p_stat) dh_installdeb -p$(p_stat) - dh_gencontrol -p$(p_stat) + dh_gencontrol -p$(p_stat) -- \ + '-Vglibc:Source=$(shell dpkg-query -f '$${source:Package} (= $${source:Version}), ' -W libc-bin)' dh_md5sums -p$(p_stat) dh_builddeb -p$(p_stat) diff -Nru bash-4.3/debian/skel.bashrc bash-4.3/debian/skel.bashrc --- bash-4.3/debian/skel.bashrc 2014-09-30 15:50:05.000000000 -0300 +++ bash-4.3/debian/skel.bashrc 2015-07-29 18:24:53.000000000 -0300 @@ -37,7 +37,7 @@ # set a fancy prompt (non-color, unless we know we "want" color) case "$TERM" in - xterm-color) color_prompt=yes;; + xterm-color|*-256color) color_prompt=yes;; esac # uncomment for a colored prompt, if the terminal has the capability; turned