2
1

bash32-015 2.3 KB

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