0016-bash50-016.patch 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  1. From https://ftp.gnu.org/gnu/bash/bash-5.0-patches/bash50-016
  2. Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>
  3. BASH PATCH REPORT
  4. =================
  5. Bash-Release: 5.0
  6. Patch-ID: bash50-016
  7. Bug-Reported-by: sunnycemetery@gmail.com
  8. Bug-Reference-ID: <20190316041534.GB22884@midnight>
  9. Bug-Reference-URL: https://lists.gnu.org/archive/html/bug-bash/2019-03/msg00070.html
  10. Bug-Description:
  11. Bash waits too long to reap /dev/fd process substitutions used as redirections
  12. with loops and group commands, which can lead to file descriptor exhaustion.
  13. Patch (apply with `patch -p0'):
  14. *** ../bash-5.0-patched/execute_cmd.c 2019-04-19 15:46:36.000000000 -0400
  15. --- b/execute_cmd.c 2019-07-01 16:45:49.000000000 -0400
  16. ***************
  17. *** 1104,1107 ****
  18. --- 1085,1104 ----
  19. discard_unwind_frame ("internal_fifos");
  20. }
  21. + # if defined (HAVE_DEV_FD)
  22. + /* Reap process substitutions at the end of loops */
  23. + switch (command->type)
  24. + {
  25. + case cm_while:
  26. + case cm_until:
  27. + case cm_for:
  28. + case cm_group:
  29. + # if defined (ARITH_FOR_COMMAND)
  30. + case cm_arith_for:
  31. + # endif
  32. + reap_procsubs ();
  33. + default:
  34. + break;
  35. + }
  36. + # endif /* HAVE_DEV_FD */
  37. #endif
  38. *** ../bash-5.0/patchlevel.h 2016-06-22 14:51:03.000000000 -0400
  39. --- b/patchlevel.h 2016-10-01 11:01:28.000000000 -0400
  40. ***************
  41. *** 26,30 ****
  42. looks for to find the patch level (for the sccs version string). */
  43. ! #define PATCHLEVEL 15
  44. #endif /* _PATCHLEVEL_H_ */
  45. --- 26,30 ----
  46. looks for to find the patch level (for the sccs version string). */
  47. ! #define PATCHLEVEL 16
  48. #endif /* _PATCHLEVEL_H_ */