You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

113 lines
4.2 KiB

  1. BASH PATCH REPORT
  2. =================
  3. Bash-Release: 5.0
  4. Patch-ID: bash50-002
  5. Bug-Reported-by: Ante Peric <synthmeat@gmail.com>
  6. Bug-Reference-ID: <B7E3B567-2467-4F7B-B6B9-CA4E75A9C93F@gmail.com>
  7. Bug-Reference-URL: http://lists.gnu.org/archive/html/bug-bash/2019-01/msg00095.html
  8. Bug-Description:
  9. When an alias value ends with an unquoted literal tab (not part of a quoted
  10. string or comment), alias expansion cannot correctly detect the end of the
  11. alias value after expanding it.
  12. Patch (apply with `patch -p0'):
  13. *** a/parser.h 2018-12-28 19:11:18.000000000 -0500
  14. --- b/parser.h 2019-01-11 15:13:03.000000000 -0500
  15. ***************
  16. *** 48,51 ****
  17. --- 48,52 ----
  18. #define PST_REDIRLIST 0x080000 /* parsing a list of redirections preceding a simple command name */
  19. #define PST_COMMENT 0x100000 /* parsing a shell comment; used by aliases */
  20. + #define PST_ENDALIAS 0x200000 /* just finished expanding and consuming an alias */
  21. /* Definition of the delimiter stack. Needed by parse.y and bashhist.c. */
  22. *** a/parse.y 2019-01-02 13:57:34.000000000 -0500
  23. --- b/parse.y 2019-01-14 08:23:31.000000000 -0500
  24. ***************
  25. *** 2558,2567 ****
  26. pushed_string_list->flags != PSH_DPAREN &&
  27. (parser_state & PST_COMMENT) == 0 &&
  28. shell_input_line_index > 0 &&
  29. ! shell_input_line[shell_input_line_index-1] != ' ' &&
  30. shell_input_line[shell_input_line_index-1] != '\n' &&
  31. shellmeta (shell_input_line[shell_input_line_index-1]) == 0 &&
  32. (current_delimiter (dstack) != '\'' && current_delimiter (dstack) != '"'))
  33. {
  34. return ' '; /* END_ALIAS */
  35. }
  36. --- 2558,2569 ----
  37. pushed_string_list->flags != PSH_DPAREN &&
  38. (parser_state & PST_COMMENT) == 0 &&
  39. + (parser_state & PST_ENDALIAS) == 0 && /* only once */
  40. shell_input_line_index > 0 &&
  41. ! shellblank (shell_input_line[shell_input_line_index-1]) == 0 &&
  42. shell_input_line[shell_input_line_index-1] != '\n' &&
  43. shellmeta (shell_input_line[shell_input_line_index-1]) == 0 &&
  44. (current_delimiter (dstack) != '\'' && current_delimiter (dstack) != '"'))
  45. {
  46. + parser_state |= PST_ENDALIAS;
  47. return ' '; /* END_ALIAS */
  48. }
  49. ***************
  50. *** 2572,2575 ****
  51. --- 2574,2578 ----
  52. if (uc == 0 && pushed_string_list && pushed_string_list->flags != PSH_SOURCE)
  53. {
  54. + parser_state &= ~PST_ENDALIAS;
  55. pop_string ();
  56. uc = shell_input_line[shell_input_line_index];
  57. *** a/y.tab.c 2019-01-02 13:57:43.000000000 -0500
  58. --- b/y.tab.c 2019-01-14 08:39:23.000000000 -0500
  59. ***************
  60. *** 4874,4883 ****
  61. pushed_string_list->flags != PSH_DPAREN &&
  62. (parser_state & PST_COMMENT) == 0 &&
  63. shell_input_line_index > 0 &&
  64. ! shell_input_line[shell_input_line_index-1] != ' ' &&
  65. shell_input_line[shell_input_line_index-1] != '\n' &&
  66. shellmeta (shell_input_line[shell_input_line_index-1]) == 0 &&
  67. (current_delimiter (dstack) != '\'' && current_delimiter (dstack) != '"'))
  68. {
  69. return ' '; /* END_ALIAS */
  70. }
  71. --- 4874,4885 ----
  72. pushed_string_list->flags != PSH_DPAREN &&
  73. (parser_state & PST_COMMENT) == 0 &&
  74. + (parser_state & PST_ENDALIAS) == 0 && /* only once */
  75. shell_input_line_index > 0 &&
  76. ! shellblank (shell_input_line[shell_input_line_index-1]) == 0 &&
  77. shell_input_line[shell_input_line_index-1] != '\n' &&
  78. shellmeta (shell_input_line[shell_input_line_index-1]) == 0 &&
  79. (current_delimiter (dstack) != '\'' && current_delimiter (dstack) != '"'))
  80. {
  81. + parser_state |= PST_ENDALIAS;
  82. return ' '; /* END_ALIAS */
  83. }
  84. ***************
  85. *** 4888,4891 ****
  86. --- 4890,4894 ----
  87. if (uc == 0 && pushed_string_list && pushed_string_list->flags != PSH_SOURCE)
  88. {
  89. + parser_state &= ~PST_ENDALIAS;
  90. pop_string ();
  91. uc = shell_input_line[shell_input_line_index];
  92. *** a/patchlevel.h 2016-06-22 14:51:03.000000000 -0400
  93. --- b/patchlevel.h 2016-10-01 11:01:28.000000000 -0400
  94. ***************
  95. *** 26,30 ****
  96. looks for to find the patch level (for the sccs version string). */
  97. ! #define PATCHLEVEL 1
  98. #endif /* _PATCHLEVEL_H_ */
  99. --- 26,30 ----
  100. looks for to find the patch level (for the sccs version string). */
  101. ! #define PATCHLEVEL 2
  102. #endif /* _PATCHLEVEL_H_ */