usr/src/cmd/bash/Patches-4.0/bash40-039
author Jon Tibble <meths@btinternet.com>
Mon, 04 May 2015 14:04:39 +0100
branchoi_151a
changeset 254 9c2a4ac793f0
permissions -rw-r--r--
Bash patch catchup including shellshock
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
254
9c2a4ac793f0 Bash patch catchup including shellshock
Jon Tibble <meths@btinternet.com>
parents:
diff changeset
     1
			     BASH PATCH REPORT
9c2a4ac793f0 Bash patch catchup including shellshock
Jon Tibble <meths@btinternet.com>
parents:
diff changeset
     2
			     =================
9c2a4ac793f0 Bash patch catchup including shellshock
Jon Tibble <meths@btinternet.com>
parents:
diff changeset
     3
9c2a4ac793f0 Bash patch catchup including shellshock
Jon Tibble <meths@btinternet.com>
parents:
diff changeset
     4
Bash-Release:	4.0
9c2a4ac793f0 Bash patch catchup including shellshock
Jon Tibble <meths@btinternet.com>
parents:
diff changeset
     5
Patch-ID:	bash40-039
9c2a4ac793f0 Bash patch catchup including shellshock
Jon Tibble <meths@btinternet.com>
parents:
diff changeset
     6
9c2a4ac793f0 Bash patch catchup including shellshock
Jon Tibble <meths@btinternet.com>
parents:
diff changeset
     7
Bug-Reported-by:	Stephane Chazelas <[email protected]>
9c2a4ac793f0 Bash patch catchup including shellshock
Jon Tibble <meths@btinternet.com>
parents:
diff changeset
     8
Bug-Reference-ID:
9c2a4ac793f0 Bash patch catchup including shellshock
Jon Tibble <meths@btinternet.com>
parents:
diff changeset
     9
Bug-Reference-URL:
9c2a4ac793f0 Bash patch catchup including shellshock
Jon Tibble <meths@btinternet.com>
parents:
diff changeset
    10
9c2a4ac793f0 Bash patch catchup including shellshock
Jon Tibble <meths@btinternet.com>
parents:
diff changeset
    11
Bug-Description:
9c2a4ac793f0 Bash patch catchup including shellshock
Jon Tibble <meths@btinternet.com>
parents:
diff changeset
    12
9c2a4ac793f0 Bash patch catchup including shellshock
Jon Tibble <meths@btinternet.com>
parents:
diff changeset
    13
Under certain circumstances, bash will execute user code while processing the
9c2a4ac793f0 Bash patch catchup including shellshock
Jon Tibble <meths@btinternet.com>
parents:
diff changeset
    14
environment for exported function definitions.
9c2a4ac793f0 Bash patch catchup including shellshock
Jon Tibble <meths@btinternet.com>
parents:
diff changeset
    15
9c2a4ac793f0 Bash patch catchup including shellshock
Jon Tibble <meths@btinternet.com>
parents:
diff changeset
    16
Patch (apply with `patch -p0'):
9c2a4ac793f0 Bash patch catchup including shellshock
Jon Tibble <meths@btinternet.com>
parents:
diff changeset
    17
9c2a4ac793f0 Bash patch catchup including shellshock
Jon Tibble <meths@btinternet.com>
parents:
diff changeset
    18
*** ../bash-4.0.38/builtins/common.h	2009-01-15 23:08:54.000000000 -0500
9c2a4ac793f0 Bash patch catchup including shellshock
Jon Tibble <meths@btinternet.com>
parents:
diff changeset
    19
--- builtins/common.h	2014-09-16 19:20:48.000000000 -0400
9c2a4ac793f0 Bash patch catchup including shellshock
Jon Tibble <meths@btinternet.com>
parents:
diff changeset
    20
***************
9c2a4ac793f0 Bash patch catchup including shellshock
Jon Tibble <meths@btinternet.com>
parents:
diff changeset
    21
*** 36,39 ****
9c2a4ac793f0 Bash patch catchup including shellshock
Jon Tibble <meths@btinternet.com>
parents:
diff changeset
    22
--- 36,41 ----
9c2a4ac793f0 Bash patch catchup including shellshock
Jon Tibble <meths@btinternet.com>
parents:
diff changeset
    23
  
9c2a4ac793f0 Bash patch catchup including shellshock
Jon Tibble <meths@btinternet.com>
parents:
diff changeset
    24
  /* Flags for describe_command, shared between type.def and command.def */
9c2a4ac793f0 Bash patch catchup including shellshock
Jon Tibble <meths@btinternet.com>
parents:
diff changeset
    25
+ #define SEVAL_FUNCDEF	0x080		/* only allow function definitions */
9c2a4ac793f0 Bash patch catchup including shellshock
Jon Tibble <meths@btinternet.com>
parents:
diff changeset
    26
+ #define SEVAL_ONECMD	0x100		/* only allow a single command */
9c2a4ac793f0 Bash patch catchup including shellshock
Jon Tibble <meths@btinternet.com>
parents:
diff changeset
    27
  #define CDESC_ALL		0x001	/* type -a */
9c2a4ac793f0 Bash patch catchup including shellshock
Jon Tibble <meths@btinternet.com>
parents:
diff changeset
    28
  #define CDESC_SHORTDESC		0x002	/* command -V */
9c2a4ac793f0 Bash patch catchup including shellshock
Jon Tibble <meths@btinternet.com>
parents:
diff changeset
    29
*** ../bash-4.0.38/builtins/evalstring.c	2009-01-13 14:44:12.000000000 -0500
9c2a4ac793f0 Bash patch catchup including shellshock
Jon Tibble <meths@btinternet.com>
parents:
diff changeset
    30
--- builtins/evalstring.c	2014-09-16 19:20:48.000000000 -0400
9c2a4ac793f0 Bash patch catchup including shellshock
Jon Tibble <meths@btinternet.com>
parents:
diff changeset
    31
***************
9c2a4ac793f0 Bash patch catchup including shellshock
Jon Tibble <meths@btinternet.com>
parents:
diff changeset
    32
*** 259,262 ****
9c2a4ac793f0 Bash patch catchup including shellshock
Jon Tibble <meths@btinternet.com>
parents:
diff changeset
    33
--- 259,270 ----
9c2a4ac793f0 Bash patch catchup including shellshock
Jon Tibble <meths@btinternet.com>
parents:
diff changeset
    34
  	      struct fd_bitmap *bitmap;
9c2a4ac793f0 Bash patch catchup including shellshock
Jon Tibble <meths@btinternet.com>
parents:
diff changeset
    35
  
9c2a4ac793f0 Bash patch catchup including shellshock
Jon Tibble <meths@btinternet.com>
parents:
diff changeset
    36
+ 	      if ((flags & SEVAL_FUNCDEF) && command->type != cm_function_def)
9c2a4ac793f0 Bash patch catchup including shellshock
Jon Tibble <meths@btinternet.com>
parents:
diff changeset
    37
+ 		{
9c2a4ac793f0 Bash patch catchup including shellshock
Jon Tibble <meths@btinternet.com>
parents:
diff changeset
    38
+ 		  internal_warning ("%s: ignoring function definition attempt", from_file);
9c2a4ac793f0 Bash patch catchup including shellshock
Jon Tibble <meths@btinternet.com>
parents:
diff changeset
    39
+ 		  should_jump_to_top_level = 0;
9c2a4ac793f0 Bash patch catchup including shellshock
Jon Tibble <meths@btinternet.com>
parents:
diff changeset
    40
+ 		  last_result = last_command_exit_value = EX_BADUSAGE;
9c2a4ac793f0 Bash patch catchup including shellshock
Jon Tibble <meths@btinternet.com>
parents:
diff changeset
    41
+ 		  break;
9c2a4ac793f0 Bash patch catchup including shellshock
Jon Tibble <meths@btinternet.com>
parents:
diff changeset
    42
+ 		}
9c2a4ac793f0 Bash patch catchup including shellshock
Jon Tibble <meths@btinternet.com>
parents:
diff changeset
    43
+ 
9c2a4ac793f0 Bash patch catchup including shellshock
Jon Tibble <meths@btinternet.com>
parents:
diff changeset
    44
  	      bitmap = new_fd_bitmap (FD_BITMAP_SIZE);
9c2a4ac793f0 Bash patch catchup including shellshock
Jon Tibble <meths@btinternet.com>
parents:
diff changeset
    45
  	      begin_unwind_frame ("pe_dispose");
9c2a4ac793f0 Bash patch catchup including shellshock
Jon Tibble <meths@btinternet.com>
parents:
diff changeset
    46
***************
9c2a4ac793f0 Bash patch catchup including shellshock
Jon Tibble <meths@btinternet.com>
parents:
diff changeset
    47
*** 319,322 ****
9c2a4ac793f0 Bash patch catchup including shellshock
Jon Tibble <meths@btinternet.com>
parents:
diff changeset
    48
--- 327,333 ----
9c2a4ac793f0 Bash patch catchup including shellshock
Jon Tibble <meths@btinternet.com>
parents:
diff changeset
    49
  	      dispose_fd_bitmap (bitmap);
9c2a4ac793f0 Bash patch catchup including shellshock
Jon Tibble <meths@btinternet.com>
parents:
diff changeset
    50
  	      discard_unwind_frame ("pe_dispose");
9c2a4ac793f0 Bash patch catchup including shellshock
Jon Tibble <meths@btinternet.com>
parents:
diff changeset
    51
+ 
9c2a4ac793f0 Bash patch catchup including shellshock
Jon Tibble <meths@btinternet.com>
parents:
diff changeset
    52
+ 	      if (flags & SEVAL_ONECMD)
9c2a4ac793f0 Bash patch catchup including shellshock
Jon Tibble <meths@btinternet.com>
parents:
diff changeset
    53
+ 		break;
9c2a4ac793f0 Bash patch catchup including shellshock
Jon Tibble <meths@btinternet.com>
parents:
diff changeset
    54
  	    }
9c2a4ac793f0 Bash patch catchup including shellshock
Jon Tibble <meths@btinternet.com>
parents:
diff changeset
    55
  	}
9c2a4ac793f0 Bash patch catchup including shellshock
Jon Tibble <meths@btinternet.com>
parents:
diff changeset
    56
*** ../bash-4.0.38/variables.c	2009-09-19 13:04:23.000000000 -0400
9c2a4ac793f0 Bash patch catchup including shellshock
Jon Tibble <meths@btinternet.com>
parents:
diff changeset
    57
--- variables.c	2014-09-16 19:20:48.000000000 -0400
9c2a4ac793f0 Bash patch catchup including shellshock
Jon Tibble <meths@btinternet.com>
parents:
diff changeset
    58
***************
9c2a4ac793f0 Bash patch catchup including shellshock
Jon Tibble <meths@btinternet.com>
parents:
diff changeset
    59
*** 344,353 ****
9c2a4ac793f0 Bash patch catchup including shellshock
Jon Tibble <meths@btinternet.com>
parents:
diff changeset
    60
  	  strcpy (temp_string + char_index + 1, string);
9c2a4ac793f0 Bash patch catchup including shellshock
Jon Tibble <meths@btinternet.com>
parents:
diff changeset
    61
  
9c2a4ac793f0 Bash patch catchup including shellshock
Jon Tibble <meths@btinternet.com>
parents:
diff changeset
    62
! 	  parse_and_execute (temp_string, name, SEVAL_NONINT|SEVAL_NOHIST);
9c2a4ac793f0 Bash patch catchup including shellshock
Jon Tibble <meths@btinternet.com>
parents:
diff changeset
    63
! 
9c2a4ac793f0 Bash patch catchup including shellshock
Jon Tibble <meths@btinternet.com>
parents:
diff changeset
    64
! 	  /* Ancient backwards compatibility.  Old versions of bash exported
9c2a4ac793f0 Bash patch catchup including shellshock
Jon Tibble <meths@btinternet.com>
parents:
diff changeset
    65
! 	     functions like name()=() {...} */
9c2a4ac793f0 Bash patch catchup including shellshock
Jon Tibble <meths@btinternet.com>
parents:
diff changeset
    66
! 	  if (name[char_index - 1] == ')' && name[char_index - 2] == '(')
9c2a4ac793f0 Bash patch catchup including shellshock
Jon Tibble <meths@btinternet.com>
parents:
diff changeset
    67
! 	    name[char_index - 2] = '\0';
9c2a4ac793f0 Bash patch catchup including shellshock
Jon Tibble <meths@btinternet.com>
parents:
diff changeset
    68
  
9c2a4ac793f0 Bash patch catchup including shellshock
Jon Tibble <meths@btinternet.com>
parents:
diff changeset
    69
  	  if (temp_var = find_function (name))
9c2a4ac793f0 Bash patch catchup including shellshock
Jon Tibble <meths@btinternet.com>
parents:
diff changeset
    70
--- 344,351 ----
9c2a4ac793f0 Bash patch catchup including shellshock
Jon Tibble <meths@btinternet.com>
parents:
diff changeset
    71
  	  strcpy (temp_string + char_index + 1, string);
9c2a4ac793f0 Bash patch catchup including shellshock
Jon Tibble <meths@btinternet.com>
parents:
diff changeset
    72
  
9c2a4ac793f0 Bash patch catchup including shellshock
Jon Tibble <meths@btinternet.com>
parents:
diff changeset
    73
! 	  /* Don't import function names that are invalid identifiers from the
9c2a4ac793f0 Bash patch catchup including shellshock
Jon Tibble <meths@btinternet.com>
parents:
diff changeset
    74
! 	     environment. */
9c2a4ac793f0 Bash patch catchup including shellshock
Jon Tibble <meths@btinternet.com>
parents:
diff changeset
    75
! 	  if (legal_identifier (name))
9c2a4ac793f0 Bash patch catchup including shellshock
Jon Tibble <meths@btinternet.com>
parents:
diff changeset
    76
! 	    parse_and_execute (temp_string, name, SEVAL_NONINT|SEVAL_NOHIST|SEVAL_FUNCDEF|SEVAL_ONECMD);
9c2a4ac793f0 Bash patch catchup including shellshock
Jon Tibble <meths@btinternet.com>
parents:
diff changeset
    77
  
9c2a4ac793f0 Bash patch catchup including shellshock
Jon Tibble <meths@btinternet.com>
parents:
diff changeset
    78
  	  if (temp_var = find_function (name))
9c2a4ac793f0 Bash patch catchup including shellshock
Jon Tibble <meths@btinternet.com>
parents:
diff changeset
    79
***************
9c2a4ac793f0 Bash patch catchup including shellshock
Jon Tibble <meths@btinternet.com>
parents:
diff changeset
    80
*** 358,365 ****
9c2a4ac793f0 Bash patch catchup including shellshock
Jon Tibble <meths@btinternet.com>
parents:
diff changeset
    81
  	  else
9c2a4ac793f0 Bash patch catchup including shellshock
Jon Tibble <meths@btinternet.com>
parents:
diff changeset
    82
  	    report_error (_("error importing function definition for `%s'"), name);
9c2a4ac793f0 Bash patch catchup including shellshock
Jon Tibble <meths@btinternet.com>
parents:
diff changeset
    83
- 
9c2a4ac793f0 Bash patch catchup including shellshock
Jon Tibble <meths@btinternet.com>
parents:
diff changeset
    84
- 	  /* ( */
9c2a4ac793f0 Bash patch catchup including shellshock
Jon Tibble <meths@btinternet.com>
parents:
diff changeset
    85
- 	  if (name[char_index - 1] == ')' && name[char_index - 2] == '\0')
9c2a4ac793f0 Bash patch catchup including shellshock
Jon Tibble <meths@btinternet.com>
parents:
diff changeset
    86
- 	    name[char_index - 2] = '(';		/* ) */
9c2a4ac793f0 Bash patch catchup including shellshock
Jon Tibble <meths@btinternet.com>
parents:
diff changeset
    87
  	}
9c2a4ac793f0 Bash patch catchup including shellshock
Jon Tibble <meths@btinternet.com>
parents:
diff changeset
    88
  #if defined (ARRAY_VARS)
9c2a4ac793f0 Bash patch catchup including shellshock
Jon Tibble <meths@btinternet.com>
parents:
diff changeset
    89
--- 356,359 ----
9c2a4ac793f0 Bash patch catchup including shellshock
Jon Tibble <meths@btinternet.com>
parents:
diff changeset
    90
*** ../bash-4.0/patchlevel.h	2009-01-04 14:32:40.000000000 -0500
9c2a4ac793f0 Bash patch catchup including shellshock
Jon Tibble <meths@btinternet.com>
parents:
diff changeset
    91
--- patchlevel.h	2009-02-22 16:11:31.000000000 -0500
9c2a4ac793f0 Bash patch catchup including shellshock
Jon Tibble <meths@btinternet.com>
parents:
diff changeset
    92
***************
9c2a4ac793f0 Bash patch catchup including shellshock
Jon Tibble <meths@btinternet.com>
parents:
diff changeset
    93
*** 26,30 ****
9c2a4ac793f0 Bash patch catchup including shellshock
Jon Tibble <meths@btinternet.com>
parents:
diff changeset
    94
     looks for to find the patch level (for the sccs version string). */
9c2a4ac793f0 Bash patch catchup including shellshock
Jon Tibble <meths@btinternet.com>
parents:
diff changeset
    95
  
9c2a4ac793f0 Bash patch catchup including shellshock
Jon Tibble <meths@btinternet.com>
parents:
diff changeset
    96
! #define PATCHLEVEL 38
9c2a4ac793f0 Bash patch catchup including shellshock
Jon Tibble <meths@btinternet.com>
parents:
diff changeset
    97
  
9c2a4ac793f0 Bash patch catchup including shellshock
Jon Tibble <meths@btinternet.com>
parents:
diff changeset
    98
  #endif /* _PATCHLEVEL_H_ */
9c2a4ac793f0 Bash patch catchup including shellshock
Jon Tibble <meths@btinternet.com>
parents:
diff changeset
    99
--- 26,30 ----
9c2a4ac793f0 Bash patch catchup including shellshock
Jon Tibble <meths@btinternet.com>
parents:
diff changeset
   100
     looks for to find the patch level (for the sccs version string). */
9c2a4ac793f0 Bash patch catchup including shellshock
Jon Tibble <meths@btinternet.com>
parents:
diff changeset
   101
  
9c2a4ac793f0 Bash patch catchup including shellshock
Jon Tibble <meths@btinternet.com>
parents:
diff changeset
   102
! #define PATCHLEVEL 39
9c2a4ac793f0 Bash patch catchup including shellshock
Jon Tibble <meths@btinternet.com>
parents:
diff changeset
   103
  
9c2a4ac793f0 Bash patch catchup including shellshock
Jon Tibble <meths@btinternet.com>
parents:
diff changeset
   104
  #endif /* _PATCHLEVEL_H_ */