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.

78 lines
2.7 KiB

  1. BASH PATCH REPORT
  2. =================
  3. Bash-Release: 4.3
  4. Patch-ID: bash43-023
  5. Bug-Reported-by: Tim Friske <me@timfriske.com>
  6. Bug-Reference-ID: <CAM1RzOcOR9zzC2i+aeES6LtbHNHoOV+0pZEYPrqxv_QAii-RXA@mail.gmail.com>
  7. Bug-Reference-URL: http://lists.gnu.org/archive/html/bug-bash/2014-06/msg00056.html
  8. Bug-Description:
  9. Bash does not correctly parse process substitution constructs that contain
  10. unbalanced parentheses as part of the contained command.
  11. Patch (apply with `patch -p0'):
  12. --- a/subst.h
  13. +++ b/subst.h
  14. @@ -82,7 +82,7 @@ extern char *extract_arithmetic_subst __
  15. /* Extract the <( or >( construct in STRING, and return a new string.
  16. Start extracting at (SINDEX) as if we had just seen "<(".
  17. Make (SINDEX) get the position just after the matching ")". */
  18. -extern char *extract_process_subst __P((char *, char *, int *));
  19. +extern char *extract_process_subst __P((char *, char *, int *, int));
  20. #endif /* PROCESS_SUBSTITUTION */
  21. /* Extract the name of the variable to bind to from the assignment string. */
  22. --- a/subst.c
  23. +++ b/subst.c
  24. @@ -1192,12 +1192,18 @@ extract_arithmetic_subst (string, sindex
  25. Start extracting at (SINDEX) as if we had just seen "<(".
  26. Make (SINDEX) get the position of the matching ")". */ /*))*/
  27. char *
  28. -extract_process_subst (string, starter, sindex)
  29. +extract_process_subst (string, starter, sindex, xflags)
  30. char *string;
  31. char *starter;
  32. int *sindex;
  33. + int xflags;
  34. {
  35. +#if 0
  36. return (extract_delimited_string (string, sindex, starter, "(", ")", SX_COMMAND));
  37. +#else
  38. + xflags |= (no_longjmp_on_fatal_error ? SX_NOLONGJMP : 0);
  39. + return (xparse_dolparen (string, string+*sindex, sindex, xflags));
  40. +#endif
  41. }
  42. #endif /* PROCESS_SUBSTITUTION */
  43. @@ -1785,7 +1791,7 @@ skip_to_delim (string, start, delims, fl
  44. si = i + 2;
  45. if (string[si] == '\0')
  46. CQ_RETURN(si);
  47. - temp = extract_process_subst (string, (c == '<') ? "<(" : ">(", &si);
  48. + temp = extract_process_subst (string, (c == '<') ? "<(" : ">(", &si, 0);
  49. free (temp); /* no SX_ALLOC here */
  50. i = si;
  51. if (string[i] == '\0')
  52. @@ -8249,7 +8255,7 @@ add_string:
  53. else
  54. t_index = sindex + 1; /* skip past both '<' and LPAREN */
  55. - temp1 = extract_process_subst (string, (c == '<') ? "<(" : ">(", &t_index); /*))*/
  56. + temp1 = extract_process_subst (string, (c == '<') ? "<(" : ">(", &t_index, 0); /*))*/
  57. sindex = t_index;
  58. /* If the process substitution specification is `<()', we want to
  59. --- a/patchlevel.h
  60. +++ b/patchlevel.h
  61. @@ -25,6 +25,6 @@
  62. regexp `^#define[ ]*PATCHLEVEL', since that's what support/mkversion.sh
  63. looks for to find the patch level (for the sccs version string). */
  64. -#define PATCHLEVEL 22
  65. +#define PATCHLEVEL 23
  66. #endif /* _PATCHLEVEL_H_ */