svashisht / rpms / bash

Forked from rpms/bash 6 years ago
Clone
Roman Rakus 586cbad
			     BASH PATCH REPORT
Roman Rakus 586cbad
			     =================
Roman Rakus 586cbad
Roman Rakus 586cbad
Bash-Release:	4.2
Roman Rakus 586cbad
Patch-ID:	bash42-028
Roman Rakus 586cbad
Roman Rakus 586cbad
Bug-Reported-by:	Mark Edgar <medgar123@gmail.com>
Roman Rakus 586cbad
Bug-Reference-ID:	<CABHMh_3d+ZgO_zaEtYXPwK4P7tC0ghZ4g=Ue_TRpsEMf5YDsqw@mail.gmail.com>
Roman Rakus 586cbad
Bug-Reference-URL:	http://lists.gnu.org/archive/html/bug-bash/2012-03/msg00109.html
Roman Rakus 586cbad
Roman Rakus 586cbad
Bug-Description:
Roman Rakus 586cbad
Roman Rakus 586cbad
When using a word expansion for which the right hand side is evaluated,
Roman Rakus 586cbad
certain expansions of quoted null strings include spurious ^? characters.
Roman Rakus 586cbad
Roman Rakus 586cbad
Patch (apply with `patch -p0'):
Roman Rakus 586cbad
Roman Rakus 586cbad
*** ../bash-4.2-patched/subst.c	2012-03-11 17:35:13.000000000 -0400
Roman Rakus 586cbad
--- subst.c	2012-03-20 19:30:13.000000000 -0400
Roman Rakus 586cbad
***************
Roman Rakus 586cbad
*** 5810,5813 ****
Roman Rakus 586cbad
--- 5810,5823 ----
Roman Rakus 586cbad
        if (qdollaratp && ((hasdol && quoted) || l->next))
Roman Rakus 586cbad
  	*qdollaratp = 1;
Roman Rakus 586cbad
+       /* If we have a quoted null result (QUOTED_NULL(temp)) and the word is
Roman Rakus 586cbad
+ 	 a quoted null (l->next == 0 && QUOTED_NULL(l->word->word)), the
Roman Rakus 586cbad
+ 	 flags indicate it (l->word->flags & W_HASQUOTEDNULL), and the
Roman Rakus 586cbad
+ 	 expansion is quoted (quoted & (Q_HERE_DOCUMENT|Q_DOUBLE_QUOTES))
Roman Rakus 586cbad
+ 	 (which is more paranoia than anything else), we need to return the
Roman Rakus 586cbad
+ 	 quoted null string and set the flags to indicate it. */
Roman Rakus 586cbad
+       if (l->next == 0 && (quoted & (Q_HERE_DOCUMENT|Q_DOUBLE_QUOTES)) && QUOTED_NULL(temp) && QUOTED_NULL(l->word->word) && (l->word->flags & W_HASQUOTEDNULL))
Roman Rakus 586cbad
+ 	{
Roman Rakus 586cbad
+ 	  w->flags |= W_HASQUOTEDNULL;
Roman Rakus 586cbad
+ 	}
Roman Rakus 586cbad
        dispose_words (l);
Roman Rakus 586cbad
      }
Roman Rakus 586cbad
Roman Rakus 586cbad
*** ../bash-4.2-patched/patchlevel.h	Sat Jun 12 20:14:48 2010
Roman Rakus 586cbad
--- patchlevel.h	Thu Feb 24 21:41:34 2011
Roman Rakus 586cbad
***************
Roman Rakus 586cbad
*** 26,30 ****
Roman Rakus 586cbad
     looks for to find the patch level (for the sccs version string). */
Roman Rakus 586cbad
  
Roman Rakus 586cbad
! #define PATCHLEVEL 27
Roman Rakus 586cbad
  
Roman Rakus 586cbad
  #endif /* _PATCHLEVEL_H_ */
Roman Rakus 586cbad
--- 26,30 ----
Roman Rakus 586cbad
     looks for to find the patch level (for the sccs version string). */
Roman Rakus 586cbad
  
Roman Rakus 586cbad
! #define PATCHLEVEL 28
Roman Rakus 586cbad
  
Roman Rakus 586cbad
  #endif /* _PATCHLEVEL_H_ */