#5 Fix handling case statement in command subsitution
Closed 2 years ago by svashisht. Opened 2 years ago by svashisht.
rpms/ svashisht/bash rhbz1556867  into  master

@@ -0,0 +1,18 @@ 

+ diff --git a/parse.y b/parse.y

+ --- a/parse.y

+ +++ b/parse.y

+ @@ -4011,11 +4011,13 @@ eof_error:

+  		  tflags |= LEX_RESWDOK;

+  		  lex_rwlen = 0;

+  		}

+ -	       else

+ +	       else if (shellmeta (ch) == 0)

+  		{

+  		  tflags &= ~LEX_RESWDOK;

+  /*itrace("parse_comsub:%d: found `%.4s', lex_reswdok -> 0", line_number, ret+retind-4);*/

+  		}

+ +	      else	/* can't be in a reserved word any more */

+ +	        lex_rwlen = 0;

+  	    }

+  	  else if MBTEST((tflags & LEX_CKCOMMENT) && ch == '#' && (lex_rwlen == 0 || ((tflags & LEX_INWORD) && lex_wlen == 0)))

+  	    ;	/* don't modify LEX_RESWDOK if we're starting a comment */

file modified
+9 -1

@@ -7,7 +7,7 @@ 

  Version: %{baseversion}%{patchleveltag}

  Name: bash

  Summary: The GNU Bourne Again shell

- Release: 1%{?dist}

+ Release: 2%{?dist}

  License: GPLv3+

  Url: https://www.gnu.org/software/bash

  Source0: https://ftp.gnu.org/gnu/bash/bash-%{baseversion}.tar.gz

@@ -89,6 +89,10 @@ 

  # This should be dropped while rebasing to bash-4.5

  Patch130: bash-4.5-test-modification-time.patch

  

+ # 1556867 - case in a for loop inside subshell causes syntax error

+ # This should be dropped while rebasing to bash-4.5

+ Patch131: bash-4.4-case-in-command-subst.patch

+ 

  BuildRequires: texinfo bison

  BuildRequires: ncurses-devel

  BuildRequires: autoconf, gettext

@@ -312,6 +316,10 @@ 

  %{_libdir}/pkgconfig/%{name}.pc

  

  %changelog

+ * Thu Mar 15 2018 Siteshwar Vashisht <svashisht@redhat.com> - 4.4.19-2

+ - Fix handling case statement in command subsitution

+   Resolves: #1556867

+ 

  * Mon Feb 12 2018 Siteshwar Vashisht <svashisht@redhat.com> - 4.4.19-1

  - Update to bash-4.4 patchlevel 19

    Resolves: #1540383

It looks like the correct upstream fix. It did not test it though.

Pull-Request has been closed by svashisht

2 years ago