Bash patch catchup including shellshock oi_151a tip
authorJon Tibble <meths@btinternet.com>
Mon May 04 14:04:39 2015 +0100 (2015-05-04)
branchoi_151a
changeset 2549c2a4ac793f0
parent 253 702bbe36863b
Bash patch catchup including shellshock
usr/src/cmd/bash/Patches-4.0/bash40-029
usr/src/cmd/bash/Patches-4.0/bash40-030
usr/src/cmd/bash/Patches-4.0/bash40-031
usr/src/cmd/bash/Patches-4.0/bash40-032
usr/src/cmd/bash/Patches-4.0/bash40-033
usr/src/cmd/bash/Patches-4.0/bash40-034
usr/src/cmd/bash/Patches-4.0/bash40-035
usr/src/cmd/bash/Patches-4.0/bash40-036
usr/src/cmd/bash/Patches-4.0/bash40-037
usr/src/cmd/bash/Patches-4.0/bash40-038
usr/src/cmd/bash/Patches-4.0/bash40-039
usr/src/cmd/bash/Patches-4.0/bash40-040
usr/src/cmd/bash/Patches-4.0/bash40-041
usr/src/cmd/bash/Patches-4.0/bash40-042
usr/src/cmd/bash/Patches-4.0/bash40-043
usr/src/cmd/bash/Patches-4.0/bash40-044
usr/src/cmd/bash/Patches-4.0/disable-function-imports
usr/src/cmd/bash/Solaris/apply_patches.sh
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/usr/src/cmd/bash/Patches-4.0/bash40-029	Mon May 04 14:04:39 2015 +0100
     1.3 @@ -0,0 +1,106 @@
     1.4 +			     BASH PATCH REPORT
     1.5 +			     =================
     1.6 +
     1.7 +Bash-Release: 4.0
     1.8 +Patch-ID: bash40-029
     1.9 +
    1.10 +Bug-Reported-by:	Christian Krause <chkr@plauener.de>
    1.11 +Bug-Reference-ID:	Thu, 25 Jun 2009 21:47:59 +0200
    1.12 +Bug-Reference-URL:	http://lists.gnu.org/archive/html/bug-bash/2009-06/msg00078.html
    1.13 +
    1.14 +Bug-Description:
    1.15 +
    1.16 +Previous versions of bash accepted strings in the initial environment
    1.17 +that were not valid shell variable assignments, usually because the
    1.18 +names were invalid, but still created shell variables from them and
    1.19 +passed them to child processes in the environment.
    1.20 +
    1.21 +Bash-4.0 ignores those names and does not pass them to child processes.
    1.22 +Some users and automated processes depend on invalid variables being
    1.23 +ignored and passed to child processes.
    1.24 +
    1.25 +This patch makes bash continue to ignore the invalid names, but pass
    1.26 +them to child processes in the export environment.
    1.27 +
    1.28 +Patch:
    1.29 +
    1.30 +*** ../bash-4.0-patched/variables.c	2009-01-04 14:32:46.000000000 -0500
    1.31 +--- variables.c	2009-06-29 09:17:20.000000000 -0400
    1.32 +***************
    1.33 +*** 253,256 ****
    1.34 +--- 255,259 ----
    1.35 +  static int visible_var __P((SHELL_VAR *));
    1.36 +  static int visible_and_exported __P((SHELL_VAR *));
    1.37 ++ static int export_environment_candidate __P((SHELL_VAR *));
    1.38 +  static int local_and_exported __P((SHELL_VAR *));
    1.39 +  static int variable_in_context __P((SHELL_VAR *));
    1.40 +***************
    1.41 +*** 376,383 ****
    1.42 +  #  endif
    1.43 +  #endif
    1.44 +        else if (legal_identifier (name))
    1.45 +  	{
    1.46 +  	  temp_var = bind_variable (name, string, 0);
    1.47 +! 	  VSETATTR (temp_var, (att_exported | att_imported));
    1.48 +  	  array_needs_making = 1;
    1.49 +  	}
    1.50 +--- 379,393 ----
    1.51 +  #  endif
    1.52 +  #endif
    1.53 ++ #if 0
    1.54 +        else if (legal_identifier (name))
    1.55 ++ #else
    1.56 ++       else
    1.57 ++ #endif
    1.58 +  	{
    1.59 +  	  temp_var = bind_variable (name, string, 0);
    1.60 +! 	  if (legal_identifier (name))
    1.61 +! 	    VSETATTR (temp_var, (att_exported | att_imported));
    1.62 +! 	  else
    1.63 +! 	    VSETATTR (temp_var, (att_exported | att_imported | att_invisible));
    1.64 +  	  array_needs_making = 1;
    1.65 +  	}
    1.66 +***************
    1.67 +*** 3083,3086 ****
    1.68 +--- 3098,3111 ----
    1.69 +  }
    1.70 +  
    1.71 ++ /* Candidate variables for the export environment are either valid variables
    1.72 ++    with the export attribute or invalid variables inherited from the initial
    1.73 ++    environment and simply passed through. */
    1.74 ++ static int
    1.75 ++ export_environment_candidate (var)
    1.76 ++      SHELL_VAR *var;
    1.77 ++ {
    1.78 ++   return (exported_p (var) && (invisible_p (var) == 0 || imported_p (var)));
    1.79 ++ }
    1.80 ++ 
    1.81 +  /* Return non-zero if VAR is a local variable in the current context and
    1.82 +     is exported. */
    1.83 +***************
    1.84 +*** 3439,3443 ****
    1.85 +--- 3464,3472 ----
    1.86 +    SHELL_VAR **vars;
    1.87 +  
    1.88 ++ #if 0
    1.89 +    vars = map_over (visible_and_exported, vcxt);
    1.90 ++ #else
    1.91 ++   vars = map_over (export_environment_candidate, vcxt);
    1.92 ++ #endif
    1.93 +  
    1.94 +    if (vars == 0)
    1.95 +*** ../bash-4.0/patchlevel.h	2009-01-04 14:32:40.000000000 -0500
    1.96 +--- patchlevel.h	2009-02-22 16:11:31.000000000 -0500
    1.97 +***************
    1.98 +*** 26,30 ****
    1.99 +     looks for to find the patch level (for the sccs version string). */
   1.100 +  
   1.101 +! #define PATCHLEVEL 28
   1.102 +  
   1.103 +  #endif /* _PATCHLEVEL_H_ */
   1.104 +--- 26,30 ----
   1.105 +     looks for to find the patch level (for the sccs version string). */
   1.106 +  
   1.107 +! #define PATCHLEVEL 29
   1.108 +  
   1.109 +  #endif /* _PATCHLEVEL_H_ */
     2.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     2.2 +++ b/usr/src/cmd/bash/Patches-4.0/bash40-030	Mon May 04 14:04:39 2015 +0100
     2.3 @@ -0,0 +1,64 @@
     2.4 +			     BASH PATCH REPORT
     2.5 +			     =================
     2.6 +
     2.7 +Bash-Release: 4.0
     2.8 +Patch-ID: bash40-030
     2.9 +
    2.10 +Bug-Reported-by:	Henning Bekel <h.bekel@googlemail.com>
    2.11 +Bug-Reference-ID:	<7c6eacF262ctuU1@mid.individual.net>
    2.12 +Bug-Reference-URL:	http://lists.gnu.org/archive/html/bug-bash/2009-07/msg00054.html
    2.13 +
    2.14 +Bug-Description:
    2.15 +
    2.16 +A shell function invoked with `bind -x' is supposed to be able to move the
    2.17 +cursor by setting READLINE_POINT.  The effects of this assignment were
    2.18 +sometimes ignored.
    2.19 +
    2.20 +Patch:
    2.21 +
    2.22 +*** ../bash-4.0-patched/bashline.c	2009-01-08 09:29:24.000000000 -0500
    2.23 +--- bashline.c	2009-07-16 14:13:41.000000000 -0400
    2.24 +***************
    2.25 +*** 3389,3393 ****
    2.26 +    register int i;
    2.27 +    intmax_t mi;
    2.28 +-   int save_point;
    2.29 +    sh_parser_state_t ps;
    2.30 +    char *cmd, *value, *l;
    2.31 +--- 3389,3392 ----
    2.32 +***************
    2.33 +*** 3433,3437 ****
    2.34 +      VSETATTR (v, att_exported);
    2.35 +    l = value_cell (v);
    2.36 +-   save_point = rl_point;
    2.37 +    value = inttostr (rl_point, ibuf, sizeof (ibuf));
    2.38 +    v = bind_int_variable ("READLINE_POINT", value);
    2.39 +--- 3432,3435 ----
    2.40 +***************
    2.41 +*** 3451,3455 ****
    2.42 +      {
    2.43 +        i = mi;
    2.44 +!       if (i != save_point)
    2.45 +  	{
    2.46 +  	  rl_point = i;
    2.47 +--- 3449,3453 ----
    2.48 +      {
    2.49 +        i = mi;
    2.50 +!       if (i != rl_point)
    2.51 +  	{
    2.52 +  	  rl_point = i;
    2.53 +*** ../bash-4.0/patchlevel.h	2009-01-04 14:32:40.000000000 -0500
    2.54 +--- patchlevel.h	2009-02-22 16:11:31.000000000 -0500
    2.55 +***************
    2.56 +*** 26,30 ****
    2.57 +     looks for to find the patch level (for the sccs version string). */
    2.58 +  
    2.59 +! #define PATCHLEVEL 29
    2.60 +  
    2.61 +  #endif /* _PATCHLEVEL_H_ */
    2.62 +--- 26,30 ----
    2.63 +     looks for to find the patch level (for the sccs version string). */
    2.64 +  
    2.65 +! #define PATCHLEVEL 30
    2.66 +  
    2.67 +  #endif /* _PATCHLEVEL_H_ */
     3.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     3.2 +++ b/usr/src/cmd/bash/Patches-4.0/bash40-031	Mon May 04 14:04:39 2015 +0100
     3.3 @@ -0,0 +1,62 @@
     3.4 +			     BASH PATCH REPORT
     3.5 +			     =================
     3.6 +
     3.7 +Bash-Release: 4.0
     3.8 +Patch-ID: bash40-031
     3.9 +
    3.10 +Bug-Reported-by:	Roman Rakus <rrakus@redhat.com>
    3.11 +Bug-Reference-ID:	<4A93F6E9.4050401@redhat.com>
    3.12 +Bug-Reference-URL:	
    3.13 +
    3.14 +Bug-Description:
    3.15 +
    3.16 +An implicit assignment to index "0" of an existing array variable caused
    3.17 +the shell to crash when the variable was unset.
    3.18 +
    3.19 +Patch:
    3.20 +
    3.21 +*** ../bash-4.0-patched/arrayfunc.c	2009-03-08 21:24:39.000000000 -0400
    3.22 +--- arrayfunc.c	2009-08-24 09:29:43.000000000 -0400
    3.23 +***************
    3.24 +*** 99,103 ****
    3.25 +    hash = assoc_create (0);
    3.26 +    if (oldval)
    3.27 +!     assoc_insert (hash, "0", oldval);
    3.28 +  
    3.29 +    FREE (value_cell (var));
    3.30 +--- 99,103 ----
    3.31 +    hash = assoc_create (0);
    3.32 +    if (oldval)
    3.33 +!     assoc_insert (hash, savestring ("0"), oldval);
    3.34 +  
    3.35 +    FREE (value_cell (var));
    3.36 +*** ../bash-4.0-patched/variables.c	2009-01-04 14:32:46.000000000 -0500
    3.37 +--- variables.c	2009-08-24 09:29:58.000000000 -0400
    3.38 +***************
    3.39 +*** 2218,2222 ****
    3.40 +        else if (assoc_p (entry))
    3.41 +  	{
    3.42 +! 	  assoc_insert (assoc_cell (entry), "0", newval);
    3.43 +  	  free (newval);
    3.44 +  	}
    3.45 +--- 2218,2222 ----
    3.46 +        else if (assoc_p (entry))
    3.47 +  	{
    3.48 +! 	  assoc_insert (assoc_cell (entry), savestring ("0"), newval);
    3.49 +  	  free (newval);
    3.50 +  	}
    3.51 +*** ../bash-4.0/patchlevel.h	2009-01-04 14:32:40.000000000 -0500
    3.52 +--- patchlevel.h	2009-02-22 16:11:31.000000000 -0500
    3.53 +***************
    3.54 +*** 26,30 ****
    3.55 +     looks for to find the patch level (for the sccs version string). */
    3.56 +  
    3.57 +! #define PATCHLEVEL 30
    3.58 +  
    3.59 +  #endif /* _PATCHLEVEL_H_ */
    3.60 +--- 26,30 ----
    3.61 +     looks for to find the patch level (for the sccs version string). */
    3.62 +  
    3.63 +! #define PATCHLEVEL 31
    3.64 +  
    3.65 +  #endif /* _PATCHLEVEL_H_ */
     4.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     4.2 +++ b/usr/src/cmd/bash/Patches-4.0/bash40-032	Mon May 04 14:04:39 2015 +0100
     4.3 @@ -0,0 +1,46 @@
     4.4 +			     BASH PATCH REPORT
     4.5 +			     =================
     4.6 +
     4.7 +Bash-Release: 4.0
     4.8 +Patch-ID: bash40-032
     4.9 +
    4.10 +Bug-Reported-by:	muszi@muszi.kite.hu
    4.11 +Bug-Reference-ID:	<20090826113159.18815.qmail@muszi.kite.hu>
    4.12 +Bug-Reference-URL:	http://lists.gnu.org/archive/html/bug-bash/2009-08/msg00090.html
    4.13 +
    4.14 +Bug-Description:
    4.15 +
    4.16 +Bash-4.0 has a memory leak when processing ${!prefix@}.
    4.17 +
    4.18 +Patch:
    4.19 +
    4.20 +*** ../bash-4.0-patched/subst.c	2009-07-22 23:18:55.000000000 -0400
    4.21 +--- subst.c	2009-08-26 23:08:51.000000000 -0400
    4.22 +***************
    4.23 +*** 6607,6611 ****
    4.24 +  	}
    4.25 +        free (x);
    4.26 +!       free (xlist);
    4.27 +        free (temp1);
    4.28 +        *indexp = sindex;
    4.29 +--- 6769,6773 ----
    4.30 +  	}
    4.31 +        free (x);
    4.32 +!       dispose_words (xlist);
    4.33 +        free (temp1);
    4.34 +        *indexp = sindex;
    4.35 +*** ../bash-4.0/patchlevel.h	2009-01-04 14:32:40.000000000 -0500
    4.36 +--- patchlevel.h	2009-02-22 16:11:31.000000000 -0500
    4.37 +***************
    4.38 +*** 26,30 ****
    4.39 +     looks for to find the patch level (for the sccs version string). */
    4.40 +  
    4.41 +! #define PATCHLEVEL 31
    4.42 +  
    4.43 +  #endif /* _PATCHLEVEL_H_ */
    4.44 +--- 26,30 ----
    4.45 +     looks for to find the patch level (for the sccs version string). */
    4.46 +  
    4.47 +! #define PATCHLEVEL 32
    4.48 +  
    4.49 +  #endif /* _PATCHLEVEL_H_ */
     5.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     5.2 +++ b/usr/src/cmd/bash/Patches-4.0/bash40-033	Mon May 04 14:04:39 2015 +0100
     5.3 @@ -0,0 +1,50 @@
     5.4 +			     BASH PATCH REPORT
     5.5 +			     =================
     5.6 +
     5.7 +Bash-Release: 4.0
     5.8 +Patch-ID: bash40-033
     5.9 +
    5.10 +Bug-Reported-by:	Dr. Werner Fink <werner@suse.de>
    5.11 +Bug-Reference-ID:	<200907010951.n619p76I013912@boole.suse.de>
    5.12 +Bug-Reference-URL:	http://lists.gnu.org/archive/html/bug-bash/2009-07/msg00000.html
    5.13 +
    5.14 +Bug-Description:
    5.15 +
    5.16 +Bash-4.0 has a memory leak in the `read' builtin when the number of fields
    5.17 +read is not the same as the number of variables passed as arguments.
    5.18 +
    5.19 +Patch:
    5.20 +
    5.21 +*** ../bash-4.0-patched/builtins/read.def	2009-03-08 21:24:45.000000000 -0400
    5.22 +--- builtins/read.def	2009-07-01 15:32:42.000000000 -0400
    5.23 +***************
    5.24 +*** 764,768 ****
    5.25 +  	tofree = input_string = t;
    5.26 +        else
    5.27 +! 	input_string = strip_trailing_ifs_whitespace (t1, ifs_chars, saw_escape);
    5.28 +      }
    5.29 +  #endif
    5.30 +--- 764,771 ----
    5.31 +  	tofree = input_string = t;
    5.32 +        else
    5.33 +! 	{
    5.34 +! 	  input_string = strip_trailing_ifs_whitespace (t1, ifs_chars, saw_escape);
    5.35 +! 	  tofree = t;
    5.36 +! 	}
    5.37 +      }
    5.38 +  #endif
    5.39 +*** ../bash-4.0/patchlevel.h	2009-01-04 14:32:40.000000000 -0500
    5.40 +--- patchlevel.h	2009-02-22 16:11:31.000000000 -0500
    5.41 +***************
    5.42 +*** 26,30 ****
    5.43 +     looks for to find the patch level (for the sccs version string). */
    5.44 +  
    5.45 +! #define PATCHLEVEL 32
    5.46 +  
    5.47 +  #endif /* _PATCHLEVEL_H_ */
    5.48 +--- 26,30 ----
    5.49 +     looks for to find the patch level (for the sccs version string). */
    5.50 +  
    5.51 +! #define PATCHLEVEL 33
    5.52 +  
    5.53 +  #endif /* _PATCHLEVEL_H_ */
     6.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     6.2 +++ b/usr/src/cmd/bash/Patches-4.0/bash40-034	Mon May 04 14:04:39 2015 +0100
     6.3 @@ -0,0 +1,59 @@
     6.4 +			     BASH PATCH REPORT
     6.5 +			     =================
     6.6 +
     6.7 +Bash-Release:	4.0
     6.8 +Patch-ID:	bash40-034
     6.9 +
    6.10 +Bug-Reported-by:	Anders Kaseorg <andersk@mit.edu>
    6.11 +Bug-Reference-ID:	<1252856832.991059.8162.nullmailer@balanced-tree.mit.edu>
    6.12 +Bug-Reference-URL:	http://lists.gnu.org/archive/html/bug-bash/2009-09/msg00043.html
    6.13 +
    6.14 +Bug-Description:
    6.15 +
    6.16 +When using the globstar option, bash incorrectly interprets wildcarded path
    6.17 +components between a **/ and the last / as matching any path, even if the
    6.18 +constructed path does not match any files.
    6.19 +
    6.20 +Patch:
    6.21 +
    6.22 +*** ../bash-4.0-patched/lib/glob/glob.c	2009-07-22 23:18:50.000000000 -0400
    6.23 +--- lib/glob/glob.c	2009-09-18 17:53:25.000000000 -0400
    6.24 +***************
    6.25 +*** 920,928 ****
    6.26 +  	  char **temp_results;
    6.27 +  
    6.28 +  	  /* Scan directory even on a NULL filename.  That way, `*h/'
    6.29 +  	     returns only directories ending in `h', instead of all
    6.30 +  	     files ending in `h' with a `/' appended. */
    6.31 +  	  dname = directories[i];
    6.32 +! 	  dflags = flags & ~GX_MARKDIRS;
    6.33 +  	  if ((flags & GX_GLOBSTAR) && filename[0] == '*' && filename[1] == '*' && filename[2] == '\0')
    6.34 +  	    dflags |= GX_ALLDIRS|GX_ADDCURDIR;
    6.35 +--- 927,938 ----
    6.36 +  	  char **temp_results;
    6.37 +  
    6.38 ++ 	  /* XXX -- we've recursively scanned any directories resulting from
    6.39 ++ 	     a `**', so turn off the flag.  We turn it on again below if
    6.40 ++ 	     filename is `**' */
    6.41 +  	  /* Scan directory even on a NULL filename.  That way, `*h/'
    6.42 +  	     returns only directories ending in `h', instead of all
    6.43 +  	     files ending in `h' with a `/' appended. */
    6.44 +  	  dname = directories[i];
    6.45 +! 	  dflags = flags & ~(GX_MARKDIRS|GX_ALLDIRS|GX_ADDCURDIR);
    6.46 +  	  if ((flags & GX_GLOBSTAR) && filename[0] == '*' && filename[1] == '*' && filename[2] == '\0')
    6.47 +  	    dflags |= GX_ALLDIRS|GX_ADDCURDIR;
    6.48 +*** ../bash-4.0/patchlevel.h	2009-01-04 14:32:40.000000000 -0500
    6.49 +--- patchlevel.h	2009-02-22 16:11:31.000000000 -0500
    6.50 +***************
    6.51 +*** 26,30 ****
    6.52 +     looks for to find the patch level (for the sccs version string). */
    6.53 +  
    6.54 +! #define PATCHLEVEL 33
    6.55 +  
    6.56 +  #endif /* _PATCHLEVEL_H_ */
    6.57 +--- 26,30 ----
    6.58 +     looks for to find the patch level (for the sccs version string). */
    6.59 +  
    6.60 +! #define PATCHLEVEL 34
    6.61 +  
    6.62 +  #endif /* _PATCHLEVEL_H_ */
     7.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     7.2 +++ b/usr/src/cmd/bash/Patches-4.0/bash40-035	Mon May 04 14:04:39 2015 +0100
     7.3 @@ -0,0 +1,62 @@
     7.4 +			     BASH PATCH REPORT
     7.5 +			     =================
     7.6 +
     7.7 +Bash-Release:	4.0
     7.8 +Patch-ID:	bash40-035
     7.9 +
    7.10 +Bug-Reported-by:	Freddy Vulto <fvulto@gmail.com>
    7.11 +Bug-Reference-ID:	<e9c463930909171341p7cbe6e43pa3788ebbe3adec4d@mail.gmail.com>
    7.12 +Bug-Reference-URL:	http://lists.gnu.org/archive/html/bug-bash/2009-09/msg00044.html
    7.13 +
    7.14 +Bug-Description:
    7.15 +
    7.16 +Bash-4.0 incorrectly treated single and double quotes as delimiters rather
    7.17 +than introducing quoted strings when splitting the line into words for
    7.18 +programmable completion functions.
    7.19 +
    7.20 +Patch:
    7.21 +
    7.22 +*** ../bash-4.0-patched/pcomplete.c	2009-03-08 21:24:31.000000000 -0400
    7.23 +--- pcomplete.c	2009-09-26 16:30:16.000000000 -0400
    7.24 +***************
    7.25 +*** 1176,1186 ****
    7.26 +    WORD_LIST *ret;
    7.27 +    char *delims;
    7.28 +  
    7.29 +! #if 0
    7.30 +!   delims = "()<>;&| \t\n";	/* shell metacharacters break words */
    7.31 +! #else
    7.32 +!   delims = rl_completer_word_break_characters;
    7.33 +! #endif
    7.34 +    ret = split_at_delims (line, llen, delims, sentinel, nwp, cwp);
    7.35 +    return (ret);
    7.36 +  }
    7.37 +--- 1176,1188 ----
    7.38 +    WORD_LIST *ret;
    7.39 +    char *delims;
    7.40 ++   int i, j;
    7.41 +  
    7.42 +!   delims = xmalloc (strlen (rl_completer_word_break_characters) + 1);
    7.43 +!   for (i = j = 0; rl_completer_word_break_characters[i]; i++)
    7.44 +!     if (rl_completer_word_break_characters[i] != '\'' && rl_completer_word_break_characters[i] != '"')
    7.45 +!       delims[j++] = rl_completer_word_break_characters[i];
    7.46 +!   delims[j] = '\0';
    7.47 +    ret = split_at_delims (line, llen, delims, sentinel, nwp, cwp);
    7.48 ++   free (delims);
    7.49 +    return (ret);
    7.50 +  }
    7.51 +*** ../bash-4.0/patchlevel.h	2009-01-04 14:32:40.000000000 -0500
    7.52 +--- patchlevel.h	2009-02-22 16:11:31.000000000 -0500
    7.53 +***************
    7.54 +*** 26,30 ****
    7.55 +     looks for to find the patch level (for the sccs version string). */
    7.56 +  
    7.57 +! #define PATCHLEVEL 34
    7.58 +  
    7.59 +  #endif /* _PATCHLEVEL_H_ */
    7.60 +--- 26,30 ----
    7.61 +     looks for to find the patch level (for the sccs version string). */
    7.62 +  
    7.63 +! #define PATCHLEVEL 35
    7.64 +  
    7.65 +  #endif /* _PATCHLEVEL_H_ */
     8.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     8.2 +++ b/usr/src/cmd/bash/Patches-4.0/bash40-036	Mon May 04 14:04:39 2015 +0100
     8.3 @@ -0,0 +1,90 @@
     8.4 +			     BASH PATCH REPORT
     8.5 +			     =================
     8.6 +
     8.7 +Bash-Release: 4.0
     8.8 +Patch-ID: bash40-036
     8.9 +
    8.10 +Bug-Reported-by:	Jerome Reybert <jreybert@gmail.com>
    8.11 +Bug-Reference-ID:	<f5da50720908070109p1faa3847x5a9dff68d24a7197@mail.gmail.com>
    8.12 +Bug-Reference-URL:	http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=538013
    8.13 +
    8.14 +Bug-Description:
    8.15 +
    8.16 +Under some circumstances, menu-complete is unable to complete filenames.
    8.17 +
    8.18 +Patch:
    8.19 +
    8.20 +*** ../bash-4.0-patched/lib/readline/complete.c	2009-01-22 15:15:14.000000000 -0500
    8.21 +--- lib/readline/complete.c	2009-08-26 17:15:59.000000000 -0400
    8.22 +***************
    8.23 +*** 2209,2213 ****
    8.24 +    /* The first time through, we generate the list of matches and set things
    8.25 +       up to insert them. */
    8.26 +!   if (rl_last_func != rl_menu_complete)
    8.27 +      {
    8.28 +        /* Clean up from previous call, if any. */
    8.29 +--- 2252,2256 ----
    8.30 +    /* The first time through, we generate the list of matches and set things
    8.31 +       up to insert them. */
    8.32 +!   if (rl_last_func != rl_old_menu_complete)
    8.33 +      {
    8.34 +        /* Clean up from previous call, if any. */
    8.35 +***************
    8.36 +*** 2221,2224 ****
    8.37 +--- 2264,2269 ----
    8.38 +        rl_completion_invoking_key = invoking_key;
    8.39 +  
    8.40 ++       RL_SETSTATE(RL_STATE_COMPLETING);
    8.41 ++ 
    8.42 +        /* Only the completion entry function can change these. */
    8.43 +        set_completion_defaults ('%');
    8.44 +***************
    8.45 +*** 2260,2266 ****
    8.46 +--- 2305,2314 ----
    8.47 +  	  orig_text = (char *)0;
    8.48 +      	  completion_changed_buffer = 0;
    8.49 ++  	  RL_UNSETSTATE(RL_STATE_COMPLETING);
    8.50 +            return (0);
    8.51 +  	}
    8.52 +  
    8.53 ++       RL_UNSETSTATE(RL_STATE_COMPLETING);
    8.54 ++ 
    8.55 +        for (match_list_size = 0; matches[match_list_size]; match_list_size++)
    8.56 +          ;
    8.57 +***************
    8.58 +*** 2338,2341 ****
    8.59 +--- 2386,2391 ----
    8.60 +        full_completion = 0;
    8.61 +  
    8.62 ++       RL_SETSTATE(RL_STATE_COMPLETING);
    8.63 ++ 
    8.64 +        /* Only the completion entry function can change these. */
    8.65 +        set_completion_defaults ('%');
    8.66 +***************
    8.67 +*** 2379,2385 ****
    8.68 +--- 2429,2438 ----
    8.69 +  	  orig_text = (char *)0;
    8.70 +      	  completion_changed_buffer = 0;
    8.71 ++  	  RL_UNSETSTATE(RL_STATE_COMPLETING);
    8.72 +            return (0);
    8.73 +  	}
    8.74 +  
    8.75 ++       RL_UNSETSTATE(RL_STATE_COMPLETING);
    8.76 ++ 
    8.77 +        for (match_list_size = 0; matches[match_list_size]; match_list_size++)
    8.78 +          ;
    8.79 +*** ../bash-4.0/patchlevel.h	2009-01-04 14:32:40.000000000 -0500
    8.80 +--- patchlevel.h	2009-02-22 16:11:31.000000000 -0500
    8.81 +***************
    8.82 +*** 26,30 ****
    8.83 +     looks for to find the patch level (for the sccs version string). */
    8.84 +  
    8.85 +! #define PATCHLEVEL 35
    8.86 +  
    8.87 +  #endif /* _PATCHLEVEL_H_ */
    8.88 +--- 26,30 ----
    8.89 +     looks for to find the patch level (for the sccs version string). */
    8.90 +  
    8.91 +! #define PATCHLEVEL 36
    8.92 +  
    8.93 +  #endif /* _PATCHLEVEL_H_ */
     9.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     9.2 +++ b/usr/src/cmd/bash/Patches-4.0/bash40-037	Mon May 04 14:04:39 2015 +0100
     9.3 @@ -0,0 +1,60 @@
     9.4 +			     BASH PATCH REPORT
     9.5 +			     =================
     9.6 +
     9.7 +Bash-Release: 4.0
     9.8 +Patch-ID: bash40-037
     9.9 +
    9.10 +Bug-Reported-by:	Chet Ramey <chet.ramey@case.edu>
    9.11 +Bug-Reference-ID:	<4AD7D749.5030601@case.edu>
    9.12 +Bug-Reference-URL:
    9.13 +
    9.14 +Bug-Description:
    9.15 +
    9.16 +The configure script does not work on Snow Leopard and will result in
    9.17 +attempts to link against the incorrect version of readline.
    9.18 +
    9.19 +Patch:
    9.20 +
    9.21 +*** ../bash-4.0-patched/configure.in	2009-02-06 12:03:44.000000000 -0500
    9.22 +--- configure.in	2009-10-01 16:38:24.000000000 -0400
    9.23 +***************
    9.24 +*** 534,538 ****
    9.25 +  		# dynamic version
    9.26 +  		case "${host_os}" in
    9.27 +! 		darwin[[89]]*)	READLINE_LIB='${READLINE_LIBRARY}' ;;
    9.28 +  		*)		READLINE_LIB=-lreadline ;;
    9.29 +  		esac
    9.30 +--- 534,538 ----
    9.31 +  		# dynamic version
    9.32 +  		case "${host_os}" in
    9.33 +! 		darwin[[89]]*|darwin10*) READLINE_LIB='${READLINE_LIBRARY}' ;;
    9.34 +  		*)		READLINE_LIB=-lreadline ;;
    9.35 +  		esac
    9.36 +***************
    9.37 +*** 569,573 ****
    9.38 +  		# dynamic version
    9.39 +  		case "${host_os}" in
    9.40 +! 		darwin[[89]]*)	HISTORY_LIB='${HISTORY_LIBRARY}' ;;
    9.41 +  		*)		HISTORY_LIB=-lhistory ;;
    9.42 +  		esac
    9.43 +--- 569,573 ----
    9.44 +  		# dynamic version
    9.45 +  		case "${host_os}" in
    9.46 +! 		darwin[[89]]*|darwin10*) HISTORY_LIB='${HISTORY_LIBRARY}' ;;
    9.47 +  		*)		HISTORY_LIB=-lhistory ;;
    9.48 +  		esac
    9.49 +*** ../bash-4.0/patchlevel.h	2009-01-04 14:32:40.000000000 -0500
    9.50 +--- patchlevel.h	2009-02-22 16:11:31.000000000 -0500
    9.51 +***************
    9.52 +*** 26,30 ****
    9.53 +     looks for to find the patch level (for the sccs version string). */
    9.54 +  
    9.55 +! #define PATCHLEVEL 36
    9.56 +  
    9.57 +  #endif /* _PATCHLEVEL_H_ */
    9.58 +--- 26,30 ----
    9.59 +     looks for to find the patch level (for the sccs version string). */
    9.60 +  
    9.61 +! #define PATCHLEVEL 37
    9.62 +  
    9.63 +  #endif /* _PATCHLEVEL_H_ */
    10.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    10.2 +++ b/usr/src/cmd/bash/Patches-4.0/bash40-038	Mon May 04 14:04:39 2015 +0100
    10.3 @@ -0,0 +1,56 @@
    10.4 +			     BASH PATCH REPORT
    10.5 +			     =================
    10.6 +
    10.7 +Bash-Release:	4.0
    10.8 +Patch-ID:	bash40-038
    10.9 +
   10.10 +Bug-Reported-by:	werner@suse.de
   10.11 +Bug-Reference-ID:	<201002251238.o1PCcYcg016893@boole.suse.de>
   10.12 +Bug-Reference-URL:	http://lists.gnu.org/archive/html/bug-bash/2010-02/msg00132.html
   10.13 +
   10.14 +Bug-Description:
   10.15 +
   10.16 +When the `read' builtin times out after the timeout specified with -t is
   10.17 +exceeded, it does not reset the flags that tell signal handlers to process
   10.18 +signals immediately instead of deferring their handling.  This can result
   10.19 +in unsafe functions being called from signal handlers, which can cause bash
   10.20 +to hang or dump core.
   10.21 +
   10.22 +Patch (apply with `patch -p0'):
   10.23 +
   10.24 +*** ../bash-4.0-patched/builtins/read.def	2009-09-03 14:40:03.000000000 -0400
   10.25 +--- builtins/read.def	2010-03-17 17:35:39.000000000 -0400
   10.26 +***************
   10.27 +*** 602,607 ****
   10.28 +      zsyncfd (fd);
   10.29 +  
   10.30 +-   interrupt_immediately--;
   10.31 +-   terminate_immediately--;
   10.32 +    discard_unwind_frame ("read_builtin");
   10.33 +  
   10.34 +--- 616,619 ----
   10.35 +***************
   10.36 +*** 610,613 ****
   10.37 +--- 622,628 ----
   10.38 +  assign_vars:
   10.39 +  
   10.40 ++   interrupt_immediately--;
   10.41 ++   terminate_immediately--;
   10.42 ++ 
   10.43 +  #if defined (ARRAY_VARS)
   10.44 +    /* If -a was given, take the string read, break it into a list of words,
   10.45 +*** ../bash-4.0/patchlevel.h	2009-01-04 14:32:40.000000000 -0500
   10.46 +--- patchlevel.h	2009-02-22 16:11:31.000000000 -0500
   10.47 +***************
   10.48 +*** 26,30 ****
   10.49 +     looks for to find the patch level (for the sccs version string). */
   10.50 +  
   10.51 +! #define PATCHLEVEL 37
   10.52 +  
   10.53 +  #endif /* _PATCHLEVEL_H_ */
   10.54 +--- 26,30 ----
   10.55 +     looks for to find the patch level (for the sccs version string). */
   10.56 +  
   10.57 +! #define PATCHLEVEL 38
   10.58 +  
   10.59 +  #endif /* _PATCHLEVEL_H_ */
    11.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    11.2 +++ b/usr/src/cmd/bash/Patches-4.0/bash40-039	Mon May 04 14:04:39 2015 +0100
    11.3 @@ -0,0 +1,104 @@
    11.4 +			     BASH PATCH REPORT
    11.5 +			     =================
    11.6 +
    11.7 +Bash-Release:	4.0
    11.8 +Patch-ID:	bash40-039
    11.9 +
   11.10 +Bug-Reported-by:	Stephane Chazelas <stephane.chazelas@gmail.com>
   11.11 +Bug-Reference-ID:
   11.12 +Bug-Reference-URL:
   11.13 +
   11.14 +Bug-Description:
   11.15 +
   11.16 +Under certain circumstances, bash will execute user code while processing the
   11.17 +environment for exported function definitions.
   11.18 +
   11.19 +Patch (apply with `patch -p0'):
   11.20 +
   11.21 +*** ../bash-4.0.38/builtins/common.h	2009-01-15 23:08:54.000000000 -0500
   11.22 +--- builtins/common.h	2014-09-16 19:20:48.000000000 -0400
   11.23 +***************
   11.24 +*** 36,39 ****
   11.25 +--- 36,41 ----
   11.26 +  
   11.27 +  /* Flags for describe_command, shared between type.def and command.def */
   11.28 ++ #define SEVAL_FUNCDEF	0x080		/* only allow function definitions */
   11.29 ++ #define SEVAL_ONECMD	0x100		/* only allow a single command */
   11.30 +  #define CDESC_ALL		0x001	/* type -a */
   11.31 +  #define CDESC_SHORTDESC		0x002	/* command -V */
   11.32 +*** ../bash-4.0.38/builtins/evalstring.c	2009-01-13 14:44:12.000000000 -0500
   11.33 +--- builtins/evalstring.c	2014-09-16 19:20:48.000000000 -0400
   11.34 +***************
   11.35 +*** 259,262 ****
   11.36 +--- 259,270 ----
   11.37 +  	      struct fd_bitmap *bitmap;
   11.38 +  
   11.39 ++ 	      if ((flags & SEVAL_FUNCDEF) && command->type != cm_function_def)
   11.40 ++ 		{
   11.41 ++ 		  internal_warning ("%s: ignoring function definition attempt", from_file);
   11.42 ++ 		  should_jump_to_top_level = 0;
   11.43 ++ 		  last_result = last_command_exit_value = EX_BADUSAGE;
   11.44 ++ 		  break;
   11.45 ++ 		}
   11.46 ++ 
   11.47 +  	      bitmap = new_fd_bitmap (FD_BITMAP_SIZE);
   11.48 +  	      begin_unwind_frame ("pe_dispose");
   11.49 +***************
   11.50 +*** 319,322 ****
   11.51 +--- 327,333 ----
   11.52 +  	      dispose_fd_bitmap (bitmap);
   11.53 +  	      discard_unwind_frame ("pe_dispose");
   11.54 ++ 
   11.55 ++ 	      if (flags & SEVAL_ONECMD)
   11.56 ++ 		break;
   11.57 +  	    }
   11.58 +  	}
   11.59 +*** ../bash-4.0.38/variables.c	2009-09-19 13:04:23.000000000 -0400
   11.60 +--- variables.c	2014-09-16 19:20:48.000000000 -0400
   11.61 +***************
   11.62 +*** 344,353 ****
   11.63 +  	  strcpy (temp_string + char_index + 1, string);
   11.64 +  
   11.65 +! 	  parse_and_execute (temp_string, name, SEVAL_NONINT|SEVAL_NOHIST);
   11.66 +! 
   11.67 +! 	  /* Ancient backwards compatibility.  Old versions of bash exported
   11.68 +! 	     functions like name()=() {...} */
   11.69 +! 	  if (name[char_index - 1] == ')' && name[char_index - 2] == '(')
   11.70 +! 	    name[char_index - 2] = '\0';
   11.71 +  
   11.72 +  	  if (temp_var = find_function (name))
   11.73 +--- 344,351 ----
   11.74 +  	  strcpy (temp_string + char_index + 1, string);
   11.75 +  
   11.76 +! 	  /* Don't import function names that are invalid identifiers from the
   11.77 +! 	     environment. */
   11.78 +! 	  if (legal_identifier (name))
   11.79 +! 	    parse_and_execute (temp_string, name, SEVAL_NONINT|SEVAL_NOHIST|SEVAL_FUNCDEF|SEVAL_ONECMD);
   11.80 +  
   11.81 +  	  if (temp_var = find_function (name))
   11.82 +***************
   11.83 +*** 358,365 ****
   11.84 +  	  else
   11.85 +  	    report_error (_("error importing function definition for `%s'"), name);
   11.86 +- 
   11.87 +- 	  /* ( */
   11.88 +- 	  if (name[char_index - 1] == ')' && name[char_index - 2] == '\0')
   11.89 +- 	    name[char_index - 2] = '(';		/* ) */
   11.90 +  	}
   11.91 +  #if defined (ARRAY_VARS)
   11.92 +--- 356,359 ----
   11.93 +*** ../bash-4.0/patchlevel.h	2009-01-04 14:32:40.000000000 -0500
   11.94 +--- patchlevel.h	2009-02-22 16:11:31.000000000 -0500
   11.95 +***************
   11.96 +*** 26,30 ****
   11.97 +     looks for to find the patch level (for the sccs version string). */
   11.98 +  
   11.99 +! #define PATCHLEVEL 38
  11.100 +  
  11.101 +  #endif /* _PATCHLEVEL_H_ */
  11.102 +--- 26,30 ----
  11.103 +     looks for to find the patch level (for the sccs version string). */
  11.104 +  
  11.105 +! #define PATCHLEVEL 39
  11.106 +  
  11.107 +  #endif /* _PATCHLEVEL_H_ */
    12.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    12.2 +++ b/usr/src/cmd/bash/Patches-4.0/bash40-040	Mon May 04 14:04:39 2015 +0100
    12.3 @@ -0,0 +1,43 @@
    12.4 +			     BASH PATCH REPORT
    12.5 +			     =================
    12.6 +
    12.7 +Bash-Release:	4.0
    12.8 +Patch-ID:	bash40-040
    12.9 +
   12.10 +Bug-Reported-by:	Tavis Ormandy <taviso@cmpxchg8b.com>
   12.11 +Bug-Reference-ID:
   12.12 +Bug-Reference-URL:	http://twitter.com/taviso/statuses/514887394294652929
   12.13 +
   12.14 +Bug-Description:
   12.15 +
   12.16 +Under certain circumstances, bash can incorrectly save a lookahead character and
   12.17 +return it on a subsequent call, even when reading a new line.
   12.18 +
   12.19 +Patch (apply with `patch -p0'):
   12.20 +
   12.21 +*** ../bash-4.0.39/parse.y	2009-06-02 09:08:07.000000000 -0400
   12.22 +--- parse.y	2014-09-25 16:15:47.000000000 -0400
   12.23 +***************
   12.24 +*** 2671,2674 ****
   12.25 +--- 2671,2676 ----
   12.26 +    word_desc_to_read = (WORD_DESC *)NULL;
   12.27 +  
   12.28 ++   eol_ungetc_lookahead = 0;
   12.29 ++ 
   12.30 +    current_token = '\n';		/* XXX */
   12.31 +    last_read_token = '\n';
   12.32 +*** ../bash-4.0/patchlevel.h	2009-01-04 14:32:40.000000000 -0500
   12.33 +--- patchlevel.h	2009-02-22 16:11:31.000000000 -0500
   12.34 +***************
   12.35 +*** 26,30 ****
   12.36 +     looks for to find the patch level (for the sccs version string). */
   12.37 +  
   12.38 +! #define PATCHLEVEL 39
   12.39 +  
   12.40 +  #endif /* _PATCHLEVEL_H_ */
   12.41 +--- 26,30 ----
   12.42 +     looks for to find the patch level (for the sccs version string). */
   12.43 +  
   12.44 +! #define PATCHLEVEL 40
   12.45 +  
   12.46 +  #endif /* _PATCHLEVEL_H_ */
    13.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    13.2 +++ b/usr/src/cmd/bash/Patches-4.0/bash40-041	Mon May 04 14:04:39 2015 +0100
    13.3 @@ -0,0 +1,217 @@
    13.4 +			     BASH PATCH REPORT
    13.5 +			     =================
    13.6 +
    13.7 +Bash-Release: 4.0
    13.8 +Patch-ID: bash40-041
    13.9 +
   13.10 +Bug-Reported-by:	Florian Weimer <fweimer@redhat.com>
   13.11 +Bug-Reference-ID:
   13.12 +Bug-Reference-URL:
   13.13 +
   13.14 +Bug-Description:
   13.15 +
   13.16 +This patch changes the encoding bash uses for exported functions to avoid
   13.17 +clashes with shell variables and to avoid depending only on an environment
   13.18 +variable's contents to determine whether or not to interpret it as a shell
   13.19 +function.
   13.20 +
   13.21 +Patch:
   13.22 +
   13.23 +*** ../bash-4.0.40/variables.c	2014-09-16 19:20:48.000000000 -0400
   13.24 +--- variables.c	2014-09-27 21:01:42.000000000 -0400
   13.25 +***************
   13.26 +*** 78,81 ****
   13.27 +--- 78,86 ----
   13.28 +  #define ifsname(s)	((s)[0] == 'I' && (s)[1] == 'F' && (s)[2] == 'S' && (s)[3] == '\0')
   13.29 +  
   13.30 ++ #define BASHFUNC_PREFIX		"BASH_FUNC_"
   13.31 ++ #define BASHFUNC_PREFLEN	10	/* == strlen(BASHFUNC_PREFIX */
   13.32 ++ #define BASHFUNC_SUFFIX		"%%"
   13.33 ++ #define BASHFUNC_SUFFLEN	2	/* == strlen(BASHFUNC_SUFFIX) */
   13.34 ++ 
   13.35 +  extern char **environ;
   13.36 +  
   13.37 +***************
   13.38 +*** 265,269 ****
   13.39 +  static void dispose_temporary_env __P((sh_free_func_t *));     
   13.40 +  
   13.41 +! static inline char *mk_env_string __P((const char *, const char *));
   13.42 +  static char **make_env_array_from_var_list __P((SHELL_VAR **));
   13.43 +  static char **make_var_export_array __P((VAR_CONTEXT *));
   13.44 +--- 270,274 ----
   13.45 +  static void dispose_temporary_env __P((sh_free_func_t *));     
   13.46 +  
   13.47 +! static inline char *mk_env_string __P((const char *, const char *, int));
   13.48 +  static char **make_env_array_from_var_list __P((SHELL_VAR **));
   13.49 +  static char **make_var_export_array __P((VAR_CONTEXT *));
   13.50 +***************
   13.51 +*** 335,353 ****
   13.52 +        /* If exported function, define it now.  Don't import functions from
   13.53 +  	 the environment in privileged mode. */
   13.54 +!       if (privmode == 0 && read_but_dont_execute == 0 && STREQN ("() {", string, 4))
   13.55 +  	{
   13.56 +  	  string_length = strlen (string);
   13.57 +! 	  temp_string = (char *)xmalloc (3 + string_length + char_index);
   13.58 +  
   13.59 +! 	  strcpy (temp_string, name);
   13.60 +! 	  temp_string[char_index] = ' ';
   13.61 +! 	  strcpy (temp_string + char_index + 1, string);
   13.62 +  
   13.63 +  	  /* Don't import function names that are invalid identifiers from the
   13.64 +  	     environment. */
   13.65 +! 	  if (legal_identifier (name))
   13.66 +! 	    parse_and_execute (temp_string, name, SEVAL_NONINT|SEVAL_NOHIST|SEVAL_FUNCDEF|SEVAL_ONECMD);
   13.67 +  
   13.68 +! 	  if (temp_var = find_function (name))
   13.69 +  	    {
   13.70 +  	      VSETATTR (temp_var, (att_exported|att_imported));
   13.71 +--- 340,369 ----
   13.72 +        /* If exported function, define it now.  Don't import functions from
   13.73 +  	 the environment in privileged mode. */
   13.74 +!       if (privmode == 0 && read_but_dont_execute == 0 &&
   13.75 +! 	  STREQN (BASHFUNC_PREFIX, name, BASHFUNC_PREFLEN) &&
   13.76 +! 	  STREQ (BASHFUNC_SUFFIX, name + char_index - BASHFUNC_SUFFLEN) &&
   13.77 +! 	  STREQN ("() {", string, 4))
   13.78 +  	{
   13.79 ++ 	  size_t namelen;
   13.80 ++ 	  char *tname;		/* desired imported function name */
   13.81 ++ 
   13.82 ++ 	  namelen = char_index - BASHFUNC_PREFLEN - BASHFUNC_SUFFLEN;
   13.83 ++ 
   13.84 ++ 	  tname = name + BASHFUNC_PREFLEN;	/* start of func name */
   13.85 ++ 	  tname[namelen] = '\0';		/* now tname == func name */
   13.86 ++ 
   13.87 +  	  string_length = strlen (string);
   13.88 +! 	  temp_string = (char *)xmalloc (namelen + string_length + 2);
   13.89 +  
   13.90 +! 	  memcpy (temp_string, tname, namelen);
   13.91 +! 	  temp_string[namelen] = ' ';
   13.92 +! 	  memcpy (temp_string + namelen + 1, string, string_length + 1);
   13.93 +  
   13.94 +  	  /* Don't import function names that are invalid identifiers from the
   13.95 +  	     environment. */
   13.96 +! 	  if (absolute_program (tname) == 0 && (posixly_correct == 0 || legal_identifier (tname)))
   13.97 +! 	    parse_and_execute (temp_string, tname, SEVAL_NONINT|SEVAL_NOHIST|SEVAL_FUNCDEF|SEVAL_ONECMD);
   13.98 +  
   13.99 +! 	  if (temp_var = find_function (tname))
  13.100 +  	    {
  13.101 +  	      VSETATTR (temp_var, (att_exported|att_imported));
  13.102 +***************
  13.103 +*** 355,359 ****
  13.104 +  	    }
  13.105 +  	  else
  13.106 +! 	    report_error (_("error importing function definition for `%s'"), name);
  13.107 +  	}
  13.108 +  #if defined (ARRAY_VARS)
  13.109 +--- 371,378 ----
  13.110 +  	    }
  13.111 +  	  else
  13.112 +! 	    report_error (_("error importing function definition for `%s'"), tname);
  13.113 +! 
  13.114 +! 	  /* Restore original suffix */
  13.115 +! 	  tname[namelen] = BASHFUNC_SUFFIX[0];
  13.116 +  	}
  13.117 +  #if defined (ARRAY_VARS)
  13.118 +***************
  13.119 +*** 2506,2510 ****
  13.120 +  
  13.121 +    INVALIDATE_EXPORTSTR (var);
  13.122 +!   var->exportstr = mk_env_string (name, value);
  13.123 +  
  13.124 +    array_needs_making = 1;
  13.125 +--- 2525,2529 ----
  13.126 +  
  13.127 +    INVALIDATE_EXPORTSTR (var);
  13.128 +!   var->exportstr = mk_env_string (name, value, 0);
  13.129 +  
  13.130 +    array_needs_making = 1;
  13.131 +***************
  13.132 +*** 3325,3343 ****
  13.133 +  
  13.134 +  static inline char *
  13.135 +! mk_env_string (name, value)
  13.136 +       const char *name, *value;
  13.137 +  {
  13.138 +!   int name_len, value_len;
  13.139 +!   char	*p;
  13.140 +  
  13.141 +    name_len = strlen (name);
  13.142 +    value_len = STRLEN (value);
  13.143 +!   p = (char *)xmalloc (2 + name_len + value_len);
  13.144 +!   strcpy (p, name);
  13.145 +!   p[name_len] = '=';
  13.146 +    if (value && *value)
  13.147 +!     strcpy (p + name_len + 1, value);
  13.148 +    else
  13.149 +!     p[name_len + 1] = '\0';
  13.150 +    return (p);
  13.151 +  }
  13.152 +--- 3344,3383 ----
  13.153 +  
  13.154 +  static inline char *
  13.155 +! mk_env_string (name, value, isfunc)
  13.156 +       const char *name, *value;
  13.157 ++      int isfunc;
  13.158 +  {
  13.159 +!   size_t name_len, value_len;
  13.160 +!   char	*p, *q;
  13.161 +  
  13.162 +    name_len = strlen (name);
  13.163 +    value_len = STRLEN (value);
  13.164 +! 
  13.165 +!   /* If we are exporting a shell function, construct the encoded function
  13.166 +!      name. */
  13.167 +!   if (isfunc && value)
  13.168 +!     {
  13.169 +!       p = (char *)xmalloc (BASHFUNC_PREFLEN + name_len + BASHFUNC_SUFFLEN + value_len + 2);
  13.170 +!       q = p;
  13.171 +!       memcpy (q, BASHFUNC_PREFIX, BASHFUNC_PREFLEN);
  13.172 +!       q += BASHFUNC_PREFLEN;
  13.173 +!       memcpy (q, name, name_len);
  13.174 +!       q += name_len;
  13.175 +!       memcpy (q, BASHFUNC_SUFFIX, BASHFUNC_SUFFLEN);
  13.176 +!       q += BASHFUNC_SUFFLEN;
  13.177 +!     }
  13.178 +!   else
  13.179 +!     {
  13.180 +!       p = (char *)xmalloc (2 + name_len + value_len);
  13.181 +!       memcpy (p, name, name_len);
  13.182 +!       q = p + name_len;
  13.183 +!     }
  13.184 +! 
  13.185 +!   q[0] = '=';
  13.186 +    if (value && *value)
  13.187 +!     memcpy (q + 1, value, value_len + 1);
  13.188 +    else
  13.189 +!     q[1] = '\0';
  13.190 +! 
  13.191 +    return (p);
  13.192 +  }
  13.193 +***************
  13.194 +*** 3420,3424 ****
  13.195 +  	     using the cached exportstr... */
  13.196 +  	  list[list_index] = USE_EXPORTSTR ? savestring (value)
  13.197 +! 					   : mk_env_string (var->name, value);
  13.198 +  
  13.199 +  	  if (USE_EXPORTSTR == 0)
  13.200 +--- 3460,3464 ----
  13.201 +  	     using the cached exportstr... */
  13.202 +  	  list[list_index] = USE_EXPORTSTR ? savestring (value)
  13.203 +! 					   : mk_env_string (var->name, value, function_p (var));
  13.204 +  
  13.205 +  	  if (USE_EXPORTSTR == 0)
  13.206 +*** ../bash-4.0/patchlevel.h	2009-01-04 14:32:40.000000000 -0500
  13.207 +--- patchlevel.h	2009-02-22 16:11:31.000000000 -0500
  13.208 +***************
  13.209 +*** 26,30 ****
  13.210 +     looks for to find the patch level (for the sccs version string). */
  13.211 +  
  13.212 +! #define PATCHLEVEL 40
  13.213 +  
  13.214 +  #endif /* _PATCHLEVEL_H_ */
  13.215 +--- 26,30 ----
  13.216 +     looks for to find the patch level (for the sccs version string). */
  13.217 +  
  13.218 +! #define PATCHLEVEL 41
  13.219 +  
  13.220 +  #endif /* _PATCHLEVEL_H_ */
    14.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    14.2 +++ b/usr/src/cmd/bash/Patches-4.0/bash40-042	Mon May 04 14:04:39 2015 +0100
    14.3 @@ -0,0 +1,147 @@
    14.4 +			     BASH PATCH REPORT
    14.5 +			     =================
    14.6 +
    14.7 +Bash-Release: 4.0
    14.8 +Patch-ID: bash40-042
    14.9 +
   14.10 +Bug-Reported-by:	Florian Weimer <fweimer@redhat.com>
   14.11 +Bug-Reference-ID:
   14.12 +Bug-Reference-URL:
   14.13 +
   14.14 +Bug-Description:
   14.15 +
   14.16 +There are two local buffer overflows in parse.y that can cause the shell
   14.17 +to dump core when given many here-documents attached to a single command
   14.18 +or many nested loops.
   14.19 +
   14.20 +Patch:
   14.21 +
   14.22 +*** ../bash-4.0.41/parse.y	2014-09-27 12:17:56.000000000 -0400
   14.23 +--- parse.y	2014-09-30 19:41:09.000000000 -0400
   14.24 +***************
   14.25 +*** 167,170 ****
   14.26 +--- 167,173 ----
   14.27 +  static int reserved_word_acceptable __P((int));
   14.28 +  static int yylex __P((void));
   14.29 ++ 
   14.30 ++ static void push_heredoc __P((REDIRECT *));
   14.31 ++ static char *mk_alexpansion __P((char *));
   14.32 +  static int alias_expand_token __P((char *));
   14.33 +  static int time_command_acceptable __P((void));
   14.34 +***************
   14.35 +*** 262,266 ****
   14.36 +  /* Variables to manage the task of reading here documents, because we need to
   14.37 +     defer the reading until after a complete command has been collected. */
   14.38 +! static REDIRECT *redir_stack[10];
   14.39 +  int need_here_doc;
   14.40 +  
   14.41 +--- 265,271 ----
   14.42 +  /* Variables to manage the task of reading here documents, because we need to
   14.43 +     defer the reading until after a complete command has been collected. */
   14.44 +! #define HEREDOC_MAX 16
   14.45 +! 
   14.46 +! static REDIRECT *redir_stack[HEREDOC_MAX];
   14.47 +  int need_here_doc;
   14.48 +  
   14.49 +***************
   14.50 +*** 301,305 ****
   14.51 +     index is decremented after a case, select, or for command is parsed. */
   14.52 +  #define MAX_CASE_NEST	128
   14.53 +! static int word_lineno[MAX_CASE_NEST];
   14.54 +  static int word_top = -1;
   14.55 +  
   14.56 +--- 306,310 ----
   14.57 +     index is decremented after a case, select, or for command is parsed. */
   14.58 +  #define MAX_CASE_NEST	128
   14.59 +! static int word_lineno[MAX_CASE_NEST+1];
   14.60 +  static int word_top = -1;
   14.61 +  
   14.62 +***************
   14.63 +*** 452,456 ****
   14.64 +  			  redir.filename = $2;
   14.65 +  			  $$ = make_redirection (0, r_reading_until, redir);
   14.66 +! 			  redir_stack[need_here_doc++] = $$;
   14.67 +  			}
   14.68 +  	|	NUMBER LESS_LESS WORD
   14.69 +--- 457,461 ----
   14.70 +  			  redir.filename = $2;
   14.71 +  			  $$ = make_redirection (0, r_reading_until, redir);
   14.72 +! 			  push_heredoc ($$);
   14.73 +  			}
   14.74 +  	|	NUMBER LESS_LESS WORD
   14.75 +***************
   14.76 +*** 458,462 ****
   14.77 +  			  redir.filename = $3;
   14.78 +  			  $$ = make_redirection ($1, r_reading_until, redir);
   14.79 +! 			  redir_stack[need_here_doc++] = $$;
   14.80 +  			}
   14.81 +  	|	LESS_LESS_LESS WORD
   14.82 +--- 463,467 ----
   14.83 +  			  redir.filename = $3;
   14.84 +  			  $$ = make_redirection ($1, r_reading_until, redir);
   14.85 +! 			  push_heredoc ($$);
   14.86 +  			}
   14.87 +  	|	LESS_LESS_LESS WORD
   14.88 +***************
   14.89 +*** 515,519 ****
   14.90 +  			  $$ = make_redirection
   14.91 +  			    (0, r_deblank_reading_until, redir);
   14.92 +! 			  redir_stack[need_here_doc++] = $$;
   14.93 +  			}
   14.94 +  	|	NUMBER LESS_LESS_MINUS WORD
   14.95 +--- 520,524 ----
   14.96 +  			  $$ = make_redirection
   14.97 +  			    (0, r_deblank_reading_until, redir);
   14.98 +! 			  push_heredoc ($$);
   14.99 +  			}
  14.100 +  	|	NUMBER LESS_LESS_MINUS WORD
  14.101 +***************
  14.102 +*** 522,526 ****
  14.103 +  			  $$ = make_redirection
  14.104 +  			    ($1, r_deblank_reading_until, redir);
  14.105 +! 			  redir_stack[need_here_doc++] = $$;
  14.106 +  			}
  14.107 +  	|	GREATER_AND '-'
  14.108 +--- 527,531 ----
  14.109 +  			  $$ = make_redirection
  14.110 +  			    ($1, r_deblank_reading_until, redir);
  14.111 +! 			  push_heredoc ($$);
  14.112 +  			}
  14.113 +  	|	GREATER_AND '-'
  14.114 +***************
  14.115 +*** 2377,2380 ****
  14.116 +--- 2382,2400 ----
  14.117 +  static int esacs_needed_count;
  14.118 +  
  14.119 ++ static void
  14.120 ++ push_heredoc (r)
  14.121 ++      REDIRECT *r;
  14.122 ++ {
  14.123 ++   if (need_here_doc >= HEREDOC_MAX)
  14.124 ++     {
  14.125 ++       last_command_exit_value = EX_BADUSAGE;
  14.126 ++       need_here_doc = 0;
  14.127 ++       report_syntax_error (_("maximum here-document count exceeded"));
  14.128 ++       reset_parser ();
  14.129 ++       exit_shell (last_command_exit_value);
  14.130 ++     }
  14.131 ++   redir_stack[need_here_doc++] = r;
  14.132 ++ }
  14.133 ++ 
  14.134 +  void
  14.135 +  gather_here_documents ()
  14.136 +*** ../bash-4.0/patchlevel.h	2009-01-04 14:32:40.000000000 -0500
  14.137 +--- patchlevel.h	2009-02-22 16:11:31.000000000 -0500
  14.138 +***************
  14.139 +*** 26,30 ****
  14.140 +     looks for to find the patch level (for the sccs version string). */
  14.141 +  
  14.142 +! #define PATCHLEVEL 41
  14.143 +  
  14.144 +  #endif /* _PATCHLEVEL_H_ */
  14.145 +--- 26,30 ----
  14.146 +     looks for to find the patch level (for the sccs version string). */
  14.147 +  
  14.148 +! #define PATCHLEVEL 42
  14.149 +  
  14.150 +  #endif /* _PATCHLEVEL_H_ */
    15.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    15.2 +++ b/usr/src/cmd/bash/Patches-4.0/bash40-043	Mon May 04 14:04:39 2015 +0100
    15.3 @@ -0,0 +1,59 @@
    15.4 +			     BASH PATCH REPORT
    15.5 +			     =================
    15.6 +
    15.7 +Bash-Release:	4.0
    15.8 +Patch-ID:	bash40-043
    15.9 +
   15.10 +Bug-Reported-by:	Michal Zalewski <lcamtuf@coredump.cx>
   15.11 +Bug-Reference-ID:
   15.12 +Bug-Reference-URL:
   15.13 +
   15.14 +Bug-Description:
   15.15 +
   15.16 +When bash is parsing a function definition that contains a here-document
   15.17 +delimited by end-of-file (or end-of-string), it leaves the closing delimiter
   15.18 +uninitialized.  This can result in an invalid memory access when the parsed
   15.19 +function is later copied.
   15.20 +
   15.21 +Patch (apply with `patch -p0'):
   15.22 +
   15.23 +*** ../bash-4.0.42/make_cmd.c	2009-01-04 14:32:38.000000000 -0500
   15.24 +--- make_cmd.c	2014-10-02 11:36:55.000000000 -0400
   15.25 +***************
   15.26 +*** 681,684 ****
   15.27 +--- 681,685 ----
   15.28 +    temp->redirector = source;
   15.29 +    temp->redirectee = dest_and_filename;
   15.30 ++   temp->here_doc_eof = 0;
   15.31 +    temp->instruction = instruction;
   15.32 +    temp->flags = 0;
   15.33 +*** ../bash-4.0.42/copy_cmd.c	2009-01-04 14:32:23.000000000 -0500
   15.34 +--- copy_cmd.c	2014-10-02 11:36:55.000000000 -0400
   15.35 +***************
   15.36 +*** 119,123 ****
   15.37 +      case r_reading_until:
   15.38 +      case r_deblank_reading_until:
   15.39 +!       new_redirect->here_doc_eof = savestring (redirect->here_doc_eof);
   15.40 +        /*FALLTHROUGH*/
   15.41 +      case r_reading_string:
   15.42 +--- 119,123 ----
   15.43 +      case r_reading_until:
   15.44 +      case r_deblank_reading_until:
   15.45 +!       new_redirect->here_doc_eof = redirect->here_doc_eof ? savestring (redirect->here_doc_eof) : 0;
   15.46 +        /*FALLTHROUGH*/
   15.47 +      case r_reading_string:
   15.48 +*** ../bash-4.0/patchlevel.h	2009-01-04 14:32:40.000000000 -0500
   15.49 +--- patchlevel.h	2009-02-22 16:11:31.000000000 -0500
   15.50 +***************
   15.51 +*** 26,30 ****
   15.52 +     looks for to find the patch level (for the sccs version string). */
   15.53 +  
   15.54 +! #define PATCHLEVEL 42
   15.55 +  
   15.56 +  #endif /* _PATCHLEVEL_H_ */
   15.57 +--- 26,30 ----
   15.58 +     looks for to find the patch level (for the sccs version string). */
   15.59 +  
   15.60 +! #define PATCHLEVEL 43
   15.61 +  
   15.62 +  #endif /* _PATCHLEVEL_H_ */
    16.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    16.2 +++ b/usr/src/cmd/bash/Patches-4.0/bash40-044	Mon May 04 14:04:39 2015 +0100
    16.3 @@ -0,0 +1,140 @@
    16.4 +			     BASH PATCH REPORT
    16.5 +			     =================
    16.6 +
    16.7 +Bash-Release: 4.0
    16.8 +Patch-ID: bash40-044
    16.9 +
   16.10 +Bug-Reported-by:	Michal Zalewski <lcamtuf@coredump.cx>
   16.11 +Bug-Reference-ID:
   16.12 +Bug-Reference-URL:
   16.13 +
   16.14 +Bug-Description:
   16.15 +
   16.16 +A combination of nested command substitutions and function importing from
   16.17 +the environment can cause bash to execute code appearing in the environment
   16.18 +variable value following the function definition.
   16.19 +
   16.20 +Patch:
   16.21 +
   16.22 +*** ../bash-4.0.43/builtins/evalstring.c	2014-09-16 19:20:48.000000000 -0400
   16.23 +--- builtins/evalstring.c	2014-10-04 15:33:32.000000000 -0400
   16.24 +***************
   16.25 +*** 44,47 ****
   16.26 +--- 44,48 ----
   16.27 +  #include "../redir.h"
   16.28 +  #include "../trap.h"
   16.29 ++ #include "../bashintl.h"
   16.30 +  
   16.31 +  #include <y.tab.h>
   16.32 +***************
   16.33 +*** 259,268 ****
   16.34 +  	      struct fd_bitmap *bitmap;
   16.35 +  
   16.36 +! 	      if ((flags & SEVAL_FUNCDEF) && command->type != cm_function_def)
   16.37 +  		{
   16.38 +! 		  internal_warning ("%s: ignoring function definition attempt", from_file);
   16.39 +! 		  should_jump_to_top_level = 0;
   16.40 +! 		  last_result = last_command_exit_value = EX_BADUSAGE;
   16.41 +! 		  break;
   16.42 +  		}
   16.43 +  
   16.44 +--- 260,282 ----
   16.45 +  	      struct fd_bitmap *bitmap;
   16.46 +  
   16.47 +! 	      if (flags & SEVAL_FUNCDEF)
   16.48 +  		{
   16.49 +! 		  char *x;
   16.50 +! 
   16.51 +! 		  /* If the command parses to something other than a straight
   16.52 +! 		     function definition, or if we have not consumed the entire
   16.53 +! 		     string, or if the parser has transformed the function
   16.54 +! 		     name (as parsing will if it begins or ends with shell
   16.55 +! 		     whitespace, for example), reject the attempt */
   16.56 +! 		  if (command->type != cm_function_def ||
   16.57 +! 		      ((x = parser_remaining_input ()) && *x) ||
   16.58 +! 		      (STREQ (from_file, command->value.Function_def->name->word) == 0))
   16.59 +! 		    {
   16.60 +! 		      internal_warning (_("%s: ignoring function definition attempt"), from_file);
   16.61 +! 		      should_jump_to_top_level = 0;
   16.62 +! 		      last_result = last_command_exit_value = EX_BADUSAGE;
   16.63 +! 		      reset_parser ();
   16.64 +! 		      break;
   16.65 +! 		    }
   16.66 +  		}
   16.67 +  
   16.68 +***************
   16.69 +*** 329,333 ****
   16.70 +  
   16.71 +  	      if (flags & SEVAL_ONECMD)
   16.72 +! 		break;
   16.73 +  	    }
   16.74 +  	}
   16.75 +--- 343,350 ----
   16.76 +  
   16.77 +  	      if (flags & SEVAL_ONECMD)
   16.78 +! 		{
   16.79 +! 		  reset_parser ();
   16.80 +! 		  break;
   16.81 +! 		}
   16.82 +  	    }
   16.83 +  	}
   16.84 +*** ../bash-4.0.43/parse.y	2014-09-30 19:41:09.000000000 -0400
   16.85 +--- parse.y	2014-10-04 15:27:12.000000000 -0400
   16.86 +***************
   16.87 +*** 2279,2282 ****
   16.88 +--- 2279,2292 ----
   16.89 +  }
   16.90 +  
   16.91 ++ char *
   16.92 ++ parser_remaining_input ()
   16.93 ++ {
   16.94 ++   if (shell_input_line == 0)
   16.95 ++     return 0;
   16.96 ++   if (shell_input_line_index < 0 || shell_input_line_index >= shell_input_line_len)
   16.97 ++     return '\0';	/* XXX */
   16.98 ++   return (shell_input_line + shell_input_line_index);
   16.99 ++ }
  16.100 ++ 
  16.101 +  #ifdef INCLUDE_UNUSED
  16.102 +  /* Back the input pointer up by one, effectively `ungetting' a character. */
  16.103 +***************
  16.104 +*** 3628,3633 ****
  16.105 +    restore_parser_state (&ps);
  16.106 +    reset_parser ();
  16.107 +!   if (interactive)
  16.108 +!     token_to_read = 0;
  16.109 +  
  16.110 +    /* Need to find how many characters parse_and_execute consumed, update
  16.111 +--- 3638,3643 ----
  16.112 +    restore_parser_state (&ps);
  16.113 +    reset_parser ();
  16.114 +! 
  16.115 +!   token_to_read = 0;
  16.116 +  
  16.117 +    /* Need to find how many characters parse_and_execute consumed, update
  16.118 +*** ../bash-4.0.43/shell.h	2009-01-04 14:32:41.000000000 -0500
  16.119 +--- shell.h	2014-10-04 15:27:12.000000000 -0400
  16.120 +***************
  16.121 +*** 161,164 ****
  16.122 +--- 161,166 ----
  16.123 +  
  16.124 +  /* Let's try declaring these here. */
  16.125 ++ extern char *parser_remaining_input __P((void));
  16.126 ++ 
  16.127 +  extern sh_parser_state_t *save_parser_state __P((sh_parser_state_t *));
  16.128 +  extern void restore_parser_state __P((sh_parser_state_t *));
  16.129 +*** ../bash-4.0/patchlevel.h	2009-01-04 14:32:40.000000000 -0500
  16.130 +--- patchlevel.h	2009-02-22 16:11:31.000000000 -0500
  16.131 +***************
  16.132 +*** 26,30 ****
  16.133 +     looks for to find the patch level (for the sccs version string). */
  16.134 +  
  16.135 +! #define PATCHLEVEL 43
  16.136 +  
  16.137 +  #endif /* _PATCHLEVEL_H_ */
  16.138 +--- 26,30 ----
  16.139 +     looks for to find the patch level (for the sccs version string). */
  16.140 +  
  16.141 +! #define PATCHLEVEL 44
  16.142 +  
  16.143 +  #endif /* _PATCHLEVEL_H_ */
    17.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    17.2 +++ b/usr/src/cmd/bash/Patches-4.0/disable-function-imports	Mon May 04 14:04:39 2015 +0100
    17.3 @@ -0,0 +1,38 @@
    17.4 +--- shell.c.orig	2009-01-04 19:32:41.000000000 +0000
    17.5 ++++ shell.c	2014-10-07 21:32:58.976889335 +0100
    17.6 +@@ -225,7 +225,7 @@
    17.7 + #else
    17.8 + int posixly_correct = 0;	/* Non-zero means posix.2 superset. */
    17.9 + #endif
   17.10 +-
   17.11 ++int import_functions = 0;       /* Import functions from environment */
   17.12 + 
   17.13 + /* Some long-winded argument names.  These are obviously new. */
   17.14 + #define Int 1
   17.15 +@@ -245,6 +245,7 @@
   17.16 +   { "help", Int, &want_initial_help, (char **)0x0 },
   17.17 +   { "init-file", Charp, (int *)0x0, &bashrc_file },
   17.18 +   { "login", Int, &make_login_shell, (char **)0x0 },
   17.19 ++  { "import-functions", Int, &import_functions, (char **)0x0 },
   17.20 +   { "noediting", Int, &no_line_editing, (char **)0x0 },
   17.21 +   { "noprofile", Int, &no_profile, (char **)0x0 },
   17.22 +   { "norc", Int, &no_rc, (char **)0x0 },
   17.23 +--- variables.c.orig	2014-10-07 23:39:11.759973975 +0100
   17.24 ++++ variables.c	2014-10-08 12:29:14.858891509 +0100
   17.25 +@@ -102,6 +102,7 @@
   17.26 + extern time_t shell_start_time;
   17.27 + extern int assigning_in_environment;
   17.28 + extern int executing_builtin;
   17.29 ++extern int import_functions;
   17.30 + 
   17.31 + #if defined (READLINE)
   17.32 + extern int no_line_editing;
   17.33 +@@ -339,7 +340,7 @@
   17.34 + 
   17.35 +       /* If exported function, define it now.  Don't import functions from
   17.36 + 	 the environment in privileged mode. */
   17.37 +-      if (privmode == 0 && read_but_dont_execute == 0 &&
   17.38 ++      if (import_functions && privmode == 0 && read_but_dont_execute == 0 &&
   17.39 + 	  STREQN (BASHFUNC_PREFIX, name, BASHFUNC_PREFLEN) &&
   17.40 + 	  STREQ (BASHFUNC_SUFFIX, name + char_index - BASHFUNC_SUFFLEN) &&
   17.41 + 	  STREQN ("() {", string, 4))
    18.1 --- a/usr/src/cmd/bash/Solaris/apply_patches.sh	Sat Jan 18 20:08:55 2014 +0000
    18.2 +++ b/usr/src/cmd/bash/Solaris/apply_patches.sh	Mon May 04 14:04:39 2015 +0100
    18.3 @@ -56,7 +56,24 @@
    18.4      bash40-025 \
    18.5      bash40-026 \
    18.6      bash40-027 \
    18.7 -    bash40-028
    18.8 +    bash40-028 \
    18.9 +    bash40-029 \
   18.10 +    bash40-030 \
   18.11 +    bash40-031 \
   18.12 +    bash40-032 \
   18.13 +    bash40-033 \
   18.14 +    bash40-034 \
   18.15 +    bash40-035 \
   18.16 +    bash40-036 \
   18.17 +    bash40-037 \
   18.18 +    bash40-038 \
   18.19 +    bash40-039 \
   18.20 +    bash40-040 \
   18.21 +    bash40-041 \
   18.22 +    bash40-042 \
   18.23 +    bash40-043 \
   18.24 +    bash40-044 \
   18.25 +    disable-function-imports
   18.26  do
   18.27      if [ ! -f ${PATCHDB}/${file}.applied ] ; then
   18.28          echo "Applying upstream bash 4.0 patch ${file}."