b130412
			     BASH PATCH REPORT
b130412
			     =================
b130412
b130412
Bash-Release: 3.2
b130412
Patch-ID: bash32-015
b130412
b130412
Bug-Reported-by:
b130412
Bug-Reference-ID:
b130412
Bug-Reference-URL:
b130412
b130412
Bug-Description:
b130412
b130412
Under certain circumstances, when using FIFOs for process substitution,
b130412
bash fails to unlink the FIFOs.  This leaves open file descriptors that
b130412
can cause the shell to hang and litters the file system.
b130412
b130412
Patch:
b130412
b130412
*** ../bash-3.2-patched/execute_cmd.c	Fri Mar  2 16:20:50 2007
b130412
--- execute_cmd.c	Wed Jan 31 23:12:06 2007
b130412
***************
b130412
*** 3051,3054 ****
b130412
--- 3051,3059 ----
b130412
      command_line = savestring (the_printed_command_except_trap);
b130412
  
b130412
+ #if defined (PROCESS_SUBSTITUTION)
b130412
+   if ((subshell_environment & SUBSHELL_COMSUB) && (simple_command->flags & CMD_NO_FORK) && fifos_pending() > 0)
b130412
+     simple_command->flags &= ~CMD_NO_FORK;
b130412
+ #endif
b130412
+ 
b130412
    execute_disk_command (words, simple_command->redirects, command_line,
b130412
  			pipe_in, pipe_out, async, fds_to_close,
b130412
*** ../bash-3.2-patched/subst.c	Fri Mar  2 16:20:50 2007
b130412
--- subst.c	Tue Mar  6 11:40:55 2007
b130412
***************
b130412
*** 4129,4132 ****
b130412
--- 4151,4160 ----
b130412
  }
b130412
  
b130412
+ int
b130412
+ fifos_pending ()
b130412
+ {
b130412
+   return nfifo;
b130412
+ }
b130412
+ 
b130412
  static char *
b130412
  make_named_pipe ()
b130412
***************
b130412
*** 4178,4181 ****
b130412
--- 4206,4215 ----
b130412
  }
b130412
  
b130412
+ int
b130412
+ fifos_pending ()
b130412
+ {
b130412
+   return 0;	/* used for cleanup; not needed with /dev/fd */
b130412
+ }
b130412
+ 
b130412
  void
b130412
  unlink_fifo_list ()
b130412
***************
b130412
*** 4671,4674 ****
b130412
--- 4719,4725 ----
b130412
        last_command_exit_value = rc;
b130412
        rc = run_exit_trap ();
b130412
+ #if defined (PROCESS_SUBSTITUTION)
b130412
+       unlink_fifo_list ();
b130412
+ #endif
b130412
        exit (rc);
b130412
      }
b130412
*** ../bash-3.2-patched/subst.h	Tue Sep 19 08:34:41 2006
b130412
--- subst.h	Wed Jan 10 09:46:47 2007
b130412
***************
b130412
*** 223,226 ****
b130412
--- 223,227 ----
b130412
  extern char *pat_subst __P((char *, char *, char *, int));
b130412
  
b130412
+ extern int fifos_pending __P((void));
b130412
  extern void unlink_fifo_list __P((void));
b130412
b130412
*** ../bash-3.2/patchlevel.h	Thu Apr 13 08:31:04 2006
b130412
--- patchlevel.h	Mon Oct 16 14:22:54 2006
b130412
***************
b130412
*** 26,30 ****
b130412
     looks for to find the patch level (for the sccs version string). */
b130412
  
b130412
! #define PATCHLEVEL 14
b130412
  
b130412
  #endif /* _PATCHLEVEL_H_ */
b130412
--- 26,30 ----
b130412
     looks for to find the patch level (for the sccs version string). */
b130412
  
b130412
! #define PATCHLEVEL 15
b130412
  
b130412
  #endif /* _PATCHLEVEL_H_ */