summaryrefslogtreecommitdiffstats
path: root/source/a/bash/bash-4.2-patches/bash42-040
blob: 1de0fe370b30aebc813515930e84fba9022b60f3 (about) (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
			     BASH PATCH REPORT
			     =================

Bash-Release:	4.2
Patch-ID:	bash42-040

Bug-Reported-by:	Andrey Zaitsev <jstcdr@gmail.com>
Bug-Reference-ID:	<CAEZVQT5PJ1Mb_Zh8LT5qz8sv+-9Q6hGfQ5DU9ZxdJ+gV7xBUaQ@mail.gmail.com>
Bug-Reference-URL:	http://lists.gnu.org/archive/html/bug-bash/2012-04/msg00144.html

Bug-Description:

Output redirection applied to builtin commands missed I/O errors if
they happened when the file descriptor was closed, rather than on write
(e.g., like with an out-of-space error on a remote NFS file system).

Patch (apply with `patch -p0'):

*** ../bash-4.2-patched/redir.c	2011-01-02 16:00:31.000000000 -0500
--- redir.c	2012-04-24 20:42:12.000000000 -0400
***************
*** 1092,1099 ****
  #if defined (BUFFERED_INPUT)
  	  check_bash_input (redirector);
! 	  close_buffered_fd (redirector);
  #else /* !BUFFERED_INPUT */
! 	  close (redirector);
  #endif /* !BUFFERED_INPUT */
  	}
        break;
--- 1092,1101 ----
  #if defined (BUFFERED_INPUT)
  	  check_bash_input (redirector);
! 	  r = close_buffered_fd (redirector);
  #else /* !BUFFERED_INPUT */
! 	  r = close (redirector);
  #endif /* !BUFFERED_INPUT */
+ 	  if (r < 0 && (flags & RX_INTERNAL) && (errno == EIO || errno == ENOSPC))
+ 	    REDIRECTION_ERROR (r, errno, -1);
  	}
        break;
*** ../bash-4.2-patched/patchlevel.h	Sat Jun 12 20:14:48 2010
--- patchlevel.h	Thu Feb 24 21:41:34 2011
***************
*** 26,30 ****
     looks for to find the patch level (for the sccs version string). */
  
! #define PATCHLEVEL 39
  
  #endif /* _PATCHLEVEL_H_ */
--- 26,30 ----
     looks for to find the patch level (for the sccs version string). */
  
! #define PATCHLEVEL 40
  
  #endif /* _PATCHLEVEL_H_ */