Blame SOURCES/bash42-040

ff19ae
			     BASH PATCH REPORT
ff19ae
			     =================
ff19ae
ff19ae
Bash-Release:	4.2
ff19ae
Patch-ID:	bash42-040
ff19ae
ff19ae
Bug-Reported-by:	Andrey Zaitsev <jstcdr@gmail.com>
ff19ae
Bug-Reference-ID:	<CAEZVQT5PJ1Mb_Zh8LT5qz8sv+-9Q6hGfQ5DU9ZxdJ+gV7xBUaQ@mail.gmail.com>
ff19ae
Bug-Reference-URL:	http://lists.gnu.org/archive/html/bug-bash/2012-04/msg00144.html
ff19ae
ff19ae
Bug-Description:
ff19ae
ff19ae
Output redirection applied to builtin commands missed I/O errors if
ff19ae
they happened when the file descriptor was closed, rather than on write
ff19ae
(e.g., like with an out-of-space error on a remote NFS file system).
ff19ae
ff19ae
Patch (apply with `patch -p0'):
ff19ae
ff19ae
*** ../bash-4.2-patched/redir.c	2011-01-02 16:00:31.000000000 -0500
ff19ae
--- redir.c	2012-04-24 20:42:12.000000000 -0400
ff19ae
***************
ff19ae
*** 1092,1099 ****
ff19ae
  #if defined (BUFFERED_INPUT)
ff19ae
  	  check_bash_input (redirector);
ff19ae
! 	  close_buffered_fd (redirector);
ff19ae
  #else /* !BUFFERED_INPUT */
ff19ae
! 	  close (redirector);
ff19ae
  #endif /* !BUFFERED_INPUT */
ff19ae
  	}
ff19ae
        break;
ff19ae
--- 1092,1101 ----
ff19ae
  #if defined (BUFFERED_INPUT)
ff19ae
  	  check_bash_input (redirector);
ff19ae
! 	  r = close_buffered_fd (redirector);
ff19ae
  #else /* !BUFFERED_INPUT */
ff19ae
! 	  r = close (redirector);
ff19ae
  #endif /* !BUFFERED_INPUT */
ff19ae
+ 	  if (r < 0 && (flags & RX_INTERNAL) && (errno == EIO || errno == ENOSPC))
ff19ae
+ 	    REDIRECTION_ERROR (r, errno, -1);
ff19ae
  	}
ff19ae
        break;
ff19ae
*** ../bash-4.2-patched/patchlevel.h	Sat Jun 12 20:14:48 2010
ff19ae
--- patchlevel.h	Thu Feb 24 21:41:34 2011
ff19ae
***************
ff19ae
*** 26,30 ****
ff19ae
     looks for to find the patch level (for the sccs version string). */
ff19ae
  
ff19ae
! #define PATCHLEVEL 39
ff19ae
  
ff19ae
  #endif /* _PATCHLEVEL_H_ */
ff19ae
--- 26,30 ----
ff19ae
     looks for to find the patch level (for the sccs version string). */
ff19ae
  
ff19ae
! #define PATCHLEVEL 40
ff19ae
  
ff19ae
  #endif /* _PATCHLEVEL_H_ */