nalika / rpms / bash

Forked from rpms/bash 2 years ago
Clone
462fb2
			     BASH PATCH REPORT
462fb2
			     =================
462fb2
462fb2
Bash-Release:	4.2
462fb2
Patch-ID:	bash42-036
462fb2
462fb2
Bug-Reported-by:	gregrwm <backuppc-users@whitleymott.net>
462fb2
Bug-Reference-ID:	<CAD+dB9B4JG+qUwZBQUwiQmVt0j6NDn=DDTxr9R+nkA8DL4KLJA@mail.gmail.com>
462fb2
Bug-Reference-URL:	http://lists.gnu.org/archive/html/bug-bash/2012-05/msg00108.html
462fb2
462fb2
Bug-Description:
462fb2
462fb2
Bash-4.2 produces incorrect word splitting results when expanding
462fb2
double-quoted $@ in the same string as and adjacent to other variable
462fb2
expansions.  The $@ should be split, the other expansions should not.
462fb2
462fb2
Patch (apply with `patch -p0'):
462fb2
462fb2
*** ../bash-4.2-patched/subst.c	2012-05-02 12:02:33.000000000 -0400
462fb2
--- subst.c	2012-07-08 21:19:32.000000000 -0400
462fb2
***************
462fb2
*** 7923,7927 ****
462fb2
    /* State flags */
462fb2
    int had_quoted_null;
462fb2
!   int has_dollar_at;
462fb2
    int tflag;
462fb2
    int pflags;			/* flags passed to param_expand */
462fb2
--- 7923,7927 ----
462fb2
    /* State flags */
462fb2
    int had_quoted_null;
462fb2
!   int has_dollar_at, temp_has_dollar_at;
462fb2
    int tflag;
462fb2
    int pflags;			/* flags passed to param_expand */
462fb2
***************
462fb2
*** 8128,8138 ****
462fb2
  	    *expanded_something = 1;
462fb2
  
462fb2
! 	  has_dollar_at = 0;
462fb2
  	  pflags = (word->flags & W_NOCOMSUB) ? PF_NOCOMSUB : 0;
462fb2
  	  if (word->flags & W_NOSPLIT2)
462fb2
  	    pflags |= PF_NOSPLIT2;
462fb2
  	  tword = param_expand (string, &sindex, quoted, expanded_something,
462fb2
! 			       &has_dollar_at, &quoted_dollar_at,
462fb2
  			       &had_quoted_null, pflags);
462fb2
  
462fb2
  	  if (tword == &expand_wdesc_error || tword == &expand_wdesc_fatal)
462fb2
--- 8128,8139 ----
462fb2
  	    *expanded_something = 1;
462fb2
  
462fb2
! 	  temp_has_dollar_at = 0;
462fb2
  	  pflags = (word->flags & W_NOCOMSUB) ? PF_NOCOMSUB : 0;
462fb2
  	  if (word->flags & W_NOSPLIT2)
462fb2
  	    pflags |= PF_NOSPLIT2;
462fb2
  	  tword = param_expand (string, &sindex, quoted, expanded_something,
462fb2
! 			       &temp_has_dollar_at, &quoted_dollar_at,
462fb2
  			       &had_quoted_null, pflags);
462fb2
+ 	  has_dollar_at += temp_has_dollar_at;
462fb2
  
462fb2
  	  if (tword == &expand_wdesc_error || tword == &expand_wdesc_fatal)
462fb2
***************
462fb2
*** 8275,8281 ****
462fb2
  	      temp = (char *)NULL;
462fb2
  
462fb2
! 	      has_dollar_at = 0;
462fb2
  	      /* Need to get W_HASQUOTEDNULL flag through this function. */
462fb2
! 	      list = expand_word_internal (tword, Q_DOUBLE_QUOTES, 0, &has_dollar_at, (int *)NULL);
462fb2
  
462fb2
  	      if (list == &expand_word_error || list == &expand_word_fatal)
462fb2
--- 8276,8283 ----
462fb2
  	      temp = (char *)NULL;
462fb2
  
462fb2
! 	      temp_has_dollar_at = 0;	/* XXX */
462fb2
  	      /* Need to get W_HASQUOTEDNULL flag through this function. */
462fb2
! 	      list = expand_word_internal (tword, Q_DOUBLE_QUOTES, 0, &temp_has_dollar_at, (int *)NULL);
462fb2
! 	      has_dollar_at += temp_has_dollar_at;
462fb2
  
462fb2
  	      if (list == &expand_word_error || list == &expand_word_fatal)
462fb2
*** ../bash-4.2-patched/patchlevel.h	Sat Jun 12 20:14:48 2010
462fb2
--- patchlevel.h	Thu Feb 24 21:41:34 2011
462fb2
***************
462fb2
*** 26,30 ****
462fb2
     looks for to find the patch level (for the sccs version string). */
462fb2
  
462fb2
! #define PATCHLEVEL 35
462fb2
  
462fb2
  #endif /* _PATCHLEVEL_H_ */
462fb2
--- 26,30 ----
462fb2
     looks for to find the patch level (for the sccs version string). */
462fb2
  
462fb2
! #define PATCHLEVEL 36
462fb2
  
462fb2
  #endif /* _PATCHLEVEL_H_ */