]>
Commit | Line | Data |
---|---|---|
24acfa14 MT |
1 | BASH PATCH REPORT |
2 | ================= | |
3 | ||
4 | Bash-Release: 3.2 | |
5 | Patch-ID: bash32-015 | |
6 | ||
7 | Bug-Reported-by: | |
8 | Bug-Reference-ID: | |
9 | Bug-Reference-URL: | |
10 | ||
11 | Bug-Description: | |
12 | ||
13 | Under certain circumstances, when using FIFOs for process substitution, | |
14 | bash fails to unlink the FIFOs. This leaves open file descriptors that | |
15 | can cause the shell to hang and litters the file system. | |
16 | ||
17 | Patch: | |
18 | ||
19 | *** ../bash-3.2-patched/execute_cmd.c Fri Mar 2 16:20:50 2007 | |
20 | --- execute_cmd.c Wed Jan 31 23:12:06 2007 | |
21 | *************** | |
22 | *** 3051,3054 **** | |
23 | --- 3051,3059 ---- | |
24 | command_line = savestring (the_printed_command_except_trap); | |
25 | ||
26 | + #if defined (PROCESS_SUBSTITUTION) | |
27 | + if ((subshell_environment & SUBSHELL_COMSUB) && (simple_command->flags & CMD_NO_FORK) && fifos_pending() > 0) | |
28 | + simple_command->flags &= ~CMD_NO_FORK; | |
29 | + #endif | |
30 | + | |
31 | execute_disk_command (words, simple_command->redirects, command_line, | |
32 | pipe_in, pipe_out, async, fds_to_close, | |
33 | *** ../bash-3.2-patched/subst.c Fri Mar 2 16:20:50 2007 | |
34 | --- subst.c Tue Mar 6 11:40:55 2007 | |
35 | *************** | |
36 | *** 4129,4132 **** | |
37 | --- 4151,4160 ---- | |
38 | } | |
39 | ||
40 | + int | |
41 | + fifos_pending () | |
42 | + { | |
43 | + return nfifo; | |
44 | + } | |
45 | + | |
46 | static char * | |
47 | make_named_pipe () | |
48 | *************** | |
49 | *** 4178,4181 **** | |
50 | --- 4206,4215 ---- | |
51 | } | |
52 | ||
53 | + int | |
54 | + fifos_pending () | |
55 | + { | |
56 | + return 0; /* used for cleanup; not needed with /dev/fd */ | |
57 | + } | |
58 | + | |
59 | void | |
60 | unlink_fifo_list () | |
61 | *************** | |
62 | *** 4671,4674 **** | |
63 | --- 4719,4725 ---- | |
64 | last_command_exit_value = rc; | |
65 | rc = run_exit_trap (); | |
66 | + #if defined (PROCESS_SUBSTITUTION) | |
67 | + unlink_fifo_list (); | |
68 | + #endif | |
69 | exit (rc); | |
70 | } | |
71 | *** ../bash-3.2-patched/subst.h Tue Sep 19 08:34:41 2006 | |
72 | --- subst.h Wed Jan 10 09:46:47 2007 | |
73 | *************** | |
74 | *** 223,226 **** | |
75 | --- 223,227 ---- | |
76 | extern char *pat_subst __P((char *, char *, char *, int)); | |
77 | ||
78 | + extern int fifos_pending __P((void)); | |
79 | extern void unlink_fifo_list __P((void)); | |
80 | ||
81 | *** ../bash-3.2/patchlevel.h Thu Apr 13 08:31:04 2006 | |
82 | --- patchlevel.h Mon Oct 16 14:22:54 2006 | |
83 | *************** | |
84 | *** 26,30 **** | |
85 | looks for to find the patch level (for the sccs version string). */ | |
86 | ||
87 | ! #define PATCHLEVEL 14 | |
88 | ||
89 | #endif /* _PATCHLEVEL_H_ */ | |
90 | --- 26,30 ---- | |
91 | looks for to find the patch level (for the sccs version string). */ | |
92 | ||
93 | ! #define PATCHLEVEL 15 | |
94 | ||
95 | #endif /* _PATCHLEVEL_H_ */ |