0015-bash50-015.patch 2.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182
  1. From https://ftp.gnu.org/gnu/bash/bash-5.0-patches/bash50-015
  2. Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>
  3. BASH PATCH REPORT
  4. =================
  5. Bash-Release: 5.0
  6. Patch-ID: bash50-015
  7. Bug-Reported-by: Yu Kou <ckyoog@gmail.com>
  8. Bug-Reference-ID: <CAAqoF9Ko3nAShJXGzucafs-ByUagzZ4nbQonwEkwC7s9UqfWKw@mail.gmail.com>
  9. Bug-Reference-URL: https://lists.gnu.org/archive/html/bug-bash/2019-05/msg00032.html
  10. Bug-Description:
  11. If alias expansion is enabled when processing the command argument to the
  12. `-c' option, an alias is defined in that command, and the command ends with
  13. the invocation of that alias, the shell's command parser can prematurely
  14. terminate before the entire command is executed.
  15. Patch (apply with `patch -p0'):
  16. *** ../bash-20190426/builtins/evalstring.c 2019-01-29 14:15:19.000000000 -0500
  17. --- b/builtins/evalstring.c 2019-05-15 14:19:36.000000000 -0400
  18. ***************
  19. *** 92,95 ****
  20. --- 92,96 ----
  21. running_trap == 0 &&
  22. *bash_input.location.string == '\0' &&
  23. + parser_expanding_alias () == 0 &&
  24. command->type == cm_simple &&
  25. signal_is_trapped (EXIT_TRAP) == 0 &&
  26. ***************
  27. *** 106,109 ****
  28. --- 107,111 ----
  29. {
  30. return (*bash_input.location.string == '\0' &&
  31. + parser_expanding_alias () == 0 &&
  32. (command->value.Connection->connector == AND_AND || command->value.Connection->connector == OR_OR || command->value.Connection->connector == ';') &&
  33. command->value.Connection->second->type == cm_simple);
  34. ***************
  35. *** 291,295 ****
  36. with_input_from_string (string, from_file);
  37. clear_shell_input_line ();
  38. ! while (*(bash_input.location.string))
  39. {
  40. command = (COMMAND *)NULL;
  41. --- 293,297 ----
  42. with_input_from_string (string, from_file);
  43. clear_shell_input_line ();
  44. ! while (*(bash_input.location.string) || parser_expanding_alias ())
  45. {
  46. command = (COMMAND *)NULL;
  47. ***************
  48. *** 546,550 ****
  49. with_input_from_string (string, from_file);
  50. ! while (*(bash_input.location.string))
  51. {
  52. command = (COMMAND *)NULL;
  53. --- 548,552 ----
  54. with_input_from_string (string, from_file);
  55. ! while (*(bash_input.location.string)) /* XXX - parser_expanding_alias () ? */
  56. {
  57. command = (COMMAND *)NULL;
  58. *** ../bash-5.0/patchlevel.h 2016-06-22 14:51:03.000000000 -0400
  59. --- b/patchlevel.h 2016-10-01 11:01:28.000000000 -0400
  60. ***************
  61. *** 26,30 ****
  62. looks for to find the patch level (for the sccs version string). */
  63. ! #define PATCHLEVEL 14
  64. #endif /* _PATCHLEVEL_H_ */
  65. --- 26,30 ----
  66. looks for to find the patch level (for the sccs version string). */
  67. ! #define PATCHLEVEL 15
  68. #endif /* _PATCHLEVEL_H_ */