Roman Rakus b34845c
			     BASH PATCH REPORT
Roman Rakus b34845c
			     =================
Roman Rakus b34845c
Roman Rakus b34845c
Bash-Release:	4.0
Roman Rakus b34845c
Patch-ID:	bash40-034
Roman Rakus b34845c
Roman Rakus b34845c
Bug-Reported-by:	Anders Kaseorg <andersk@mit.edu>
Roman Rakus b34845c
Bug-Reference-ID:	<1252856832.991059.8162.nullmailer@balanced-tree.mit.edu>
Roman Rakus b34845c
Bug-Reference-URL:	http://lists.gnu.org/archive/html/bug-bash/2009-09/msg00043.html
Roman Rakus b34845c
Roman Rakus b34845c
Bug-Description:
Roman Rakus b34845c
Roman Rakus b34845c
When using the globstar option, bash incorrectly interprets wildcarded path
Roman Rakus b34845c
components between a **/ and the last / as matching any path, even if the
Roman Rakus b34845c
constructed path does not match any files.
Roman Rakus b34845c
Roman Rakus b34845c
Patch:
Roman Rakus b34845c
Roman Rakus b34845c
*** ../bash-4.0-patched/lib/glob/glob.c	2009-07-22 23:18:50.000000000 -0400
Roman Rakus b34845c
--- lib/glob/glob.c	2009-09-18 17:53:25.000000000 -0400
Roman Rakus b34845c
***************
Roman Rakus b34845c
*** 920,928 ****
Roman Rakus b34845c
  	  char **temp_results;
Roman Rakus b34845c
  
Roman Rakus b34845c
  	  /* Scan directory even on a NULL filename.  That way, `*h/'
Roman Rakus b34845c
  	     returns only directories ending in `h', instead of all
Roman Rakus b34845c
  	     files ending in `h' with a `/' appended. */
Roman Rakus b34845c
  	  dname = directories[i];
Roman Rakus b34845c
! 	  dflags = flags & ~GX_MARKDIRS;
Roman Rakus b34845c
  	  if ((flags & GX_GLOBSTAR) && filename[0] == '*' && filename[1] == '*' && filename[2] == '\0')
Roman Rakus b34845c
  	    dflags |= GX_ALLDIRS|GX_ADDCURDIR;
Roman Rakus b34845c
--- 927,938 ----
Roman Rakus b34845c
  	  char **temp_results;
Roman Rakus b34845c
  
Roman Rakus b34845c
+ 	  /* XXX -- we've recursively scanned any directories resulting from
Roman Rakus b34845c
+ 	     a `**', so turn off the flag.  We turn it on again below if
Roman Rakus b34845c
+ 	     filename is `**' */
Roman Rakus b34845c
  	  /* Scan directory even on a NULL filename.  That way, `*h/'
Roman Rakus b34845c
  	     returns only directories ending in `h', instead of all
Roman Rakus b34845c
  	     files ending in `h' with a `/' appended. */
Roman Rakus b34845c
  	  dname = directories[i];
Roman Rakus b34845c
! 	  dflags = flags & ~(GX_MARKDIRS|GX_ALLDIRS|GX_ADDCURDIR);
Roman Rakus b34845c
  	  if ((flags & GX_GLOBSTAR) && filename[0] == '*' && filename[1] == '*' && filename[2] == '\0')
Roman Rakus b34845c
  	    dflags |= GX_ALLDIRS|GX_ADDCURDIR;
Roman Rakus b34845c
*** ../bash-4.0/patchlevel.h	2009-01-04 14:32:40.000000000 -0500
Roman Rakus b34845c
--- patchlevel.h	2009-02-22 16:11:31.000000000 -0500
Roman Rakus b34845c
***************
Roman Rakus b34845c
*** 26,30 ****
Roman Rakus b34845c
     looks for to find the patch level (for the sccs version string). */
Roman Rakus b34845c
  
Roman Rakus b34845c
! #define PATCHLEVEL 33
Roman Rakus b34845c
  
Roman Rakus b34845c
  #endif /* _PATCHLEVEL_H_ */
Roman Rakus b34845c
--- 26,30 ----
Roman Rakus b34845c
     looks for to find the patch level (for the sccs version string). */
Roman Rakus b34845c
  
Roman Rakus b34845c
! #define PATCHLEVEL 34
Roman Rakus b34845c
  
Roman Rakus b34845c
  #endif /* _PATCHLEVEL_H_ */