[arch-commits] Commit in bash/trunk (4 files)

Bartłomiej Piotrowski bpiotrowski at archlinux.org
Sun Sep 28 10:01:09 UTC 2014


    Date: Sunday, September 28, 2014 @ 12:01:08
  Author: bpiotrowski
Revision: 223622

upgpkg: bash 4.3.027-1

bump upstream patchlevel

- replace unofficial bash43-026 with the upstream one
- bash43-027 replaces variables-affix.patch

Modified:
  bash/trunk/PKGBUILD
Deleted:
  bash/trunk/bash43-026
  bash/trunk/funcdef-import.patch
  bash/trunk/variables-affix.patch

-----------------------+
 PKGBUILD              |   18 ++---
 bash43-026            |   60 ------------------
 funcdef-import.patch  |   91 ----------------------------
 variables-affix.patch |  155 ------------------------------------------------
 4 files changed, 8 insertions(+), 316 deletions(-)

Modified: PKGBUILD
===================================================================
--- PKGBUILD	2014-09-28 08:25:50 UTC (rev 223621)
+++ PKGBUILD	2014-09-28 10:01:08 UTC (rev 223622)
@@ -5,7 +5,7 @@
 
 pkgname=bash
 _basever=4.3
-_patchlevel=026
+_patchlevel=027
 pkgver=$_basever.$_patchlevel
 pkgrel=1
 pkgdesc='The GNU Bourne Again shell'
@@ -25,15 +25,12 @@
         system.bashrc
         system.bash_logout
         privmode-setuid-fail.patch
-        # CVE-2014-7169 patch from http://www.openwall.com/lists/oss-security/2014/09/26/1
-        bash43-026
-        variables-affix.patch
         parser-oob-4.2.patch)
 
 if [[ $((10#${_patchlevel})) -gt 0 ]]; then
-    for (( _p=1; _p<=$((10#${_patchlevel}-1)); _p++ )); do   # "-1" was added as workaround for not-published 026 patch)
-        source=(${source[@]} http://ftp.gnu.org/gnu/bash/bash-$_basever-patches/bash${_basever//.}-$(printf "%03d" $_p){,.sig})
-    done
+  for (( _p=1; _p<=$((10#${_patchlevel})); _p++ )); do
+    source=(${source[@]} http://ftp.gnu.org/gnu/bash/bash-$_basever-patches/bash${_basever//.}-$(printf "%03d" $_p){,.sig})
+  done
 fi
 
 prepare() {
@@ -48,7 +45,6 @@
   patch -p0 -i ../privmode-setuid-fail.patch
 
   # CVE-2014-7169 patches
-  patch -p0 -i ../variables-affix.patch
   patch -p0 -i ../parser-oob-4.2.patch
 }
 
@@ -93,8 +89,6 @@
          '561949793177116b7be29a07c385ba8b'
          '472f536d7c9e8250dc4568ec4cfaf294'
          'a577d42e38249d298d6a8d4bf2823883'
-         '922578e2be7ed03729454e92ee8d3f3a'
-         '2ac173523d3437a0ab517ae4248d0a98'
          '461145288c8ffbf05c0f90554b2aa885'
          '1ab682b4e36afa4cf1b426aa7ac81c0d'
          'SKIP'
@@ -145,4 +139,8 @@
          'b5ea5600942acceb4b6f07313d2de74e'
          'SKIP'
          '193c06f578d38ffdbaebae9c51a7551f'
+         'SKIP'
+         '922578e2be7ed03729454e92ee8d3f3a'
+         'SKIP'
+         '8ff6948b16f2db5c29b1b9ae1085bbe7'
          'SKIP')

Deleted: bash43-026
===================================================================
--- bash43-026	2014-09-28 08:25:50 UTC (rev 223621)
+++ bash43-026	2014-09-28 10:01:08 UTC (rev 223622)
@@ -1,60 +0,0 @@
-			     BASH PATCH REPORT
-			     =================
-
-Bash-Release:	4.3
-Patch-ID:	bash43-026
-
-Bug-Reported-by:	Tavis Ormandy <taviso at cmpxchg8b.com>
-Bug-Reference-ID:
-Bug-Reference-URL:	http://twitter.com/taviso/statuses/514887394294652929
-
-Bug-Description:
-
-Under certain circumstances, bash can incorrectly save a lookahead character and
-return it on a subsequent call, even when reading a new line.
-
-Patch (apply with `patch -p0'):
-
-*** ../bash-4.3.25/parse.y	2014-07-30 10:14:31.000000000 -0400
---- parse.y	2014-09-25 20:20:21.000000000 -0400
-***************
-*** 2954,2957 ****
---- 2954,2959 ----
-    word_desc_to_read = (WORD_DESC *)NULL;
-  
-+   eol_ungetc_lookahead = 0;
-+ 
-    current_token = '\n';		/* XXX */
-    last_read_token = '\n';
-*** ../bash-4.3.25/y.tab.c	2014-07-30 10:14:32.000000000 -0400
---- y.tab.c	2014-09-25 20:21:48.000000000 -0400
-***************
-*** 5266,5269 ****
---- 5266,5271 ----
-    word_desc_to_read = (WORD_DESC *)NULL;
-  
-+   eol_ungetc_lookahead = 0;
-+ 
-    current_token = '\n';		/* XXX */
-    last_read_token = '\n';
-***************
-*** 8540,8542 ****
-  }
-  #endif /* HANDLE_MULTIBYTE */
-- 
---- 8542,8543 ----
-*** ../bash-4.3/patchlevel.h	2012-12-29 10:47:57.000000000 -0500
---- patchlevel.h	2014-03-20 20:01:28.000000000 -0400
-***************
-*** 26,30 ****
-     looks for to find the patch level (for the sccs version string). */
-  
-! #define PATCHLEVEL 25
-  
-  #endif /* _PATCHLEVEL_H_ */
---- 26,30 ----
-     looks for to find the patch level (for the sccs version string). */
-  
-! #define PATCHLEVEL 26
-  
-  #endif /* _PATCHLEVEL_H_ */

Deleted: funcdef-import.patch
===================================================================
--- funcdef-import.patch	2014-09-28 08:25:50 UTC (rev 223621)
+++ funcdef-import.patch	2014-09-28 10:01:08 UTC (rev 223622)
@@ -1,91 +0,0 @@
-*** ../bash-4.3-patched/builtins/common.h	2013-07-08 16:54:47.000000000 -0400
---- builtins/common.h	2014-09-12 14:25:47.000000000 -0400
-***************
-*** 34,37 ****
---- 49,54 ----
-  #define SEVAL_PARSEONLY	0x020
-  #define SEVAL_NOLONGJMP 0x040
-+ #define SEVAL_FUNCDEF	0x080		/* only allow function definitions */
-+ #define SEVAL_ONECMD	0x100		/* only allow a single command */
-  
-  /* Flags for describe_command, shared between type.def and command.def */
-*** ../bash-4.3-patched/builtins/evalstring.c	2014-02-11 09:42:10.000000000 -0500
---- builtins/evalstring.c	2014-09-14 14:15:13.000000000 -0400
-***************
-*** 309,312 ****
---- 313,324 ----
-  	      struct fd_bitmap *bitmap;
-  
-+ 	      if ((flags & SEVAL_FUNCDEF) && command->type != cm_function_def)
-+ 		{
-+ 		  internal_warning ("%s: ignoring function definition attempt", from_file);
-+ 		  should_jump_to_top_level = 0;
-+ 		  last_result = last_command_exit_value = EX_BADUSAGE;
-+ 		  break;
-+ 		}
-+ 
-  	      bitmap = new_fd_bitmap (FD_BITMAP_SIZE);
-  	      begin_unwind_frame ("pe_dispose");
-***************
-*** 369,372 ****
---- 381,387 ----
-  	      dispose_fd_bitmap (bitmap);
-  	      discard_unwind_frame ("pe_dispose");
-+ 
-+ 	      if (flags & SEVAL_ONECMD)
-+ 		break;
-  	    }
-  	}
-*** ../bash-4.3-patched/variables.c	2014-05-15 08:26:50.000000000 -0400
---- variables.c	2014-09-14 14:23:35.000000000 -0400
-***************
-*** 359,369 ****
-  	  strcpy (temp_string + char_index + 1, string);
-  
-! 	  if (posixly_correct == 0 || legal_identifier (name))
-! 	    parse_and_execute (temp_string, name, SEVAL_NONINT|SEVAL_NOHIST);
-! 
-! 	  /* Ancient backwards compatibility.  Old versions of bash exported
-! 	     functions like name()=() {...} */
-! 	  if (name[char_index - 1] == ')' && name[char_index - 2] == '(')
-! 	    name[char_index - 2] = '\0';
-  
-  	  if (temp_var = find_function (name))
---- 364,372 ----
-  	  strcpy (temp_string + char_index + 1, string);
-  
-! 	  /* Don't import function names that are invalid identifiers from the
-! 	     environment, though we still allow them to be defined as shell
-! 	     variables. */
-! 	  if (legal_identifier (name))
-! 	    parse_and_execute (temp_string, name, SEVAL_NONINT|SEVAL_NOHIST|SEVAL_FUNCDEF|SEVAL_ONECMD);
-  
-  	  if (temp_var = find_function (name))
-***************
-*** 382,389 ****
-  	      report_error (_("error importing function definition for `%s'"), name);
-  	    }
-- 
-- 	  /* ( */
-- 	  if (name[char_index - 1] == ')' && name[char_index - 2] == '\0')
-- 	    name[char_index - 2] = '(';		/* ) */
-  	}
-  #if defined (ARRAY_VARS)
---- 385,388 ----
-*** ../bash-4.3-patched/subst.c	2014-08-11 11:16:35.000000000 -0400
---- subst.c	2014-09-12 15:31:04.000000000 -0400
-***************
-*** 8048,8052 ****
-  	  goto return0;
-  	}
-!       else if (var = find_variable_last_nameref (temp1))
-  	{
-  	  temp = nameref_cell (var);
---- 8118,8124 ----
-  	  goto return0;
-  	}
-!       else if (var && (invisible_p (var) || var_isset (var) == 0))
-! 	temp = (char *)NULL;
-!       else if ((var = find_variable_last_nameref (temp1)) && var_isset (var) && invisible_p (var) == 0)
-  	{
-  	  temp = nameref_cell (var);

Deleted: variables-affix.patch
===================================================================
--- variables-affix.patch	2014-09-28 08:25:50 UTC (rev 223621)
+++ variables-affix.patch	2014-09-28 10:01:08 UTC (rev 223622)
@@ -1,155 +0,0 @@
---- ../bash-4.2-orig/variables.c	2014-09-25 13:07:59.313209541 +0200
-+++ variables.c	2014-09-25 13:15:29.869420719 +0200
-@@ -268,7 +268,7 @@
- static void propagate_temp_var __P((PTR_T));
- static void dispose_temporary_env __P((sh_free_func_t *));     
- 
--static inline char *mk_env_string __P((const char *, const char *));
-+static inline char *mk_env_string __P((const char *, const char *, int));
- static char **make_env_array_from_var_list __P((SHELL_VAR **));
- static char **make_var_export_array __P((VAR_CONTEXT *));
- static char **make_func_export_array __P((void));
-@@ -301,6 +301,14 @@
- #endif
- }
- 
-+/* Prefix and suffix for environment variable names which contain
-+   shell functions. */
-+#define FUNCDEF_PREFIX "BASH_FUNC_"
-+#define FUNCDEF_PREFIX_LEN (strlen (FUNCDEF_PREFIX))
-+#define FUNCDEF_SUFFIX "()"
-+#define FUNCDEF_SUFFIX_LEN (strlen (FUNCDEF_SUFFIX))
-+
-+
- /* Initialize the shell variables from the current environment.
-    If PRIVMODE is nonzero, don't import functions from ENV or
-    parse $SHELLOPTS. */
-@@ -338,36 +346,48 @@
- 
-       /* If exported function, define it now.  Don't import functions from
- 	 the environment in privileged mode. */
--      if (privmode == 0 && read_but_dont_execute == 0 && STREQN ("() {", string, 4))
--	{
--	  string_length = strlen (string);
--	  temp_string = (char *)xmalloc (3 + string_length + char_index);
-+      if (privmode == 0 && read_but_dont_execute == 0
-+	  && STREQN (FUNCDEF_PREFIX, name, FUNCDEF_PREFIX_LEN)
-+	  && STREQ (name + char_index - FUNCDEF_SUFFIX_LEN, FUNCDEF_SUFFIX)
-+	  && STREQN ("() {", string, 4))
-+	{
-+	  size_t name_length
-+	    = char_index - (FUNCDEF_PREFIX_LEN + FUNCDEF_SUFFIX_LEN);
-+	  char *temp_name = name + FUNCDEF_PREFIX_LEN;
-+	  /* Temporarily remove the suffix. */
-+	  temp_name[name_length] = '\0';
- 
--	  strcpy (temp_string, name);
--	  temp_string[char_index] = ' ';
--	  strcpy (temp_string + char_index + 1, string);
-+	  string_length = strlen (string);
-+	  temp_string = (char *)xmalloc (name_length + 1 + string_length + 1);
-+	  memcpy (temp_string, temp_name, name_length);
-+	  temp_string[name_length] = ' ';
-+	  memcpy (temp_string + name_length + 1, string, string_length + 1);
- 
- 	  /* Don't import function names that are invalid identifiers from the
- 	     environment, though we still allow them to be defined as shell
- 	     variables. */
--	  if (legal_identifier (name))
--	    parse_and_execute (temp_string, name, SEVAL_NONINT|SEVAL_NOHIST|SEVAL_FUNCDEF|SEVAL_ONECMD);
-+	  if (legal_identifier (temp_name))
-+	    parse_and_execute (temp_string, temp_name,
-+			       SEVAL_NONINT|SEVAL_NOHIST|SEVAL_FUNCDEF|SEVAL_ONECMD);
- 
--	  if (temp_var = find_function (name))
-+	  if (temp_var = find_function (temp_name))
- 	    {
- 	      VSETATTR (temp_var, (att_exported|att_imported));
- 	      array_needs_making = 1;
- 	    }
- 	  else
- 	    {
- 	      if (temp_var = bind_variable (name, string, 0))
- 		{
- 		  VSETATTR (temp_var, (att_exported | att_imported | att_invisible));
- 		  array_needs_making = 1;
- 		}
- 	      last_command_exit_value = 1;
- 	      report_error (_("error importing function definition for `%s'"), name);
- 	    }
-+
-+	  /* Restore the original suffix. */
-+	  temp_name[name_length] = FUNCDEF_SUFFIX[0];
- 	}
- #if defined (ARRAY_VARS)
- #  if ARRAY_EXPORT
-@@ -2537,7 +2557,7 @@
-   var->context = variable_context;	/* XXX */
- 
-   INVALIDATE_EXPORTSTR (var);
--  var->exportstr = mk_env_string (name, value);
-+  var->exportstr = mk_env_string (name, value, 0);
- 
-   array_needs_making = 1;
- 
-@@ -3388,22 +3408,43 @@
- /*								    */
- /* **************************************************************** */
- 
-+/* Returns the string NAME=VALUE if !FUNCTIONP or if VALUE == NULL (in
-+   which case it is treated as empty).  Otherwise, decorate NAME with
-+   FUNCDEF_PREFIX and FUNCDEF_SUFFIX, and return a string of the form
-+   FUNCDEF_PREFIX NAME FUNCDEF_SUFFIX = VALUE (without spaces).  */
- static inline char *
--mk_env_string (name, value)
-+mk_env_string (name, value, functionp)
-      const char *name, *value;
-+     int functionp;
- {
--  int name_len, value_len;
--  char	*p;
-+  size_t name_len, value_len;
-+  char *p, *q;
- 
-   name_len = strlen (name);
-   value_len = STRLEN (value);
--  p = (char *)xmalloc (2 + name_len + value_len);
--  strcpy (p, name);
--  p[name_len] = '=';
-+  if (functionp && value != NULL)
-+    {
-+      p = (char *)xmalloc (FUNCDEF_PREFIX_LEN + name_len + FUNCDEF_SUFFIX_LEN
-+			   + 1 + value_len + 1);
-+      q = p;
-+      memcpy (q, FUNCDEF_PREFIX, FUNCDEF_PREFIX_LEN);
-+      q += FUNCDEF_PREFIX_LEN;
-+      memcpy (q, name, name_len);
-+      q += name_len;
-+      memcpy (q, FUNCDEF_SUFFIX, FUNCDEF_SUFFIX_LEN);
-+      q += FUNCDEF_SUFFIX_LEN;
-+    }
-+  else
-+    {
-+      p = (char *)xmalloc (name_len + 1 + value_len + 1);
-+      memcpy (p, name, name_len);
-+      q = p + name_len;
-+    }
-+  q[0] = '=';
-   if (value && *value)
--    strcpy (p + name_len + 1, value);
-+    memcpy (q + 1, value, value_len + 1);
-   else
--    p[name_len + 1] = '\0';
-+    q[1] = '\0';
-   return (p);
- }
- 
-@@ -3489,7 +3530,7 @@
- 	  /* Gee, I'd like to get away with not using savestring() if we're
- 	     using the cached exportstr... */
- 	  list[list_index] = USE_EXPORTSTR ? savestring (value)
--					   : mk_env_string (var->name, value);
-+	    : mk_env_string (var->name, value, function_p (var));
- 
- 	  if (USE_EXPORTSTR == 0)
- 	    SAVE_EXPORTSTR (var, list[list_index]);



More information about the arch-commits mailing list