7 Bug-Reported-by: Tim Friske <me@timfriske.com>
8 Bug-Reference-ID: <CAM1RzOcOR9zzC2i+aeES6LtbHNHoOV+0pZEYPrqxv_QAii-RXA@mail.gmail.com>
9 Bug-Reference-URL: http://lists.gnu.org/archive/html/bug-bash/2014-06/msg00056.html
13 Bash does not correctly parse process substitution constructs that contain
14 unbalanced parentheses as part of the contained command.
16 Patch (apply with `patch -p0'):
18 *** ../bash-4.3-patched/subst.h 2014-01-11 21:02:27.000000000 -0500
19 --- subst.h 2014-07-20 17:25:01.000000000 -0400
22 Start extracting at (SINDEX) as if we had just seen "<(".
23 Make (SINDEX) get the position just after the matching ")". */
24 ! extern char *extract_process_subst __P((char *, char *, int *));
25 #endif /* PROCESS_SUBSTITUTION */
28 Start extracting at (SINDEX) as if we had just seen "<(".
29 Make (SINDEX) get the position just after the matching ")". */
30 ! extern char *extract_process_subst __P((char *, char *, int *, int));
31 #endif /* PROCESS_SUBSTITUTION */
33 *** ../bash-4.3-patched/subst.c 2014-05-15 08:26:45.000000000 -0400
34 --- subst.c 2014-07-20 17:26:44.000000000 -0400
37 Make (SINDEX) get the position of the matching ")". */ /*))*/
39 ! extract_process_subst (string, starter, sindex)
44 return (extract_delimited_string (string, sindex, starter, "(", ")", SX_COMMAND));
46 #endif /* PROCESS_SUBSTITUTION */
48 Make (SINDEX) get the position of the matching ")". */ /*))*/
50 ! extract_process_subst (string, starter, sindex, xflags)
57 return (extract_delimited_string (string, sindex, starter, "(", ")", SX_COMMAND));
59 + xflags |= (no_longjmp_on_fatal_error ? SX_NOLONGJMP : 0);
60 + return (xparse_dolparen (string, string+*sindex, sindex, xflags));
63 #endif /* PROCESS_SUBSTITUTION */
66 if (string[si] == '\0')
68 ! temp = extract_process_subst (string, (c == '<') ? "<(" : ">(", &si);
69 free (temp); /* no SX_ALLOC here */
72 if (string[si] == '\0')
74 ! temp = extract_process_subst (string, (c == '<') ? "<(" : ">(", &si, 0);
75 free (temp); /* no SX_ALLOC here */
79 t_index = sindex + 1; /* skip past both '<' and LPAREN */
81 ! temp1 = extract_process_subst (string, (c == '<') ? "<(" : ">(", &t_index); /*))*/
85 t_index = sindex + 1; /* skip past both '<' and LPAREN */
87 ! temp1 = extract_process_subst (string, (c == '<') ? "<(" : ">(", &t_index, 0); /*))*/
90 *** ../bash-4.3/patchlevel.h 2012-12-29 10:47:57.000000000 -0500
91 --- patchlevel.h 2014-03-20 20:01:28.000000000 -0400
94 looks for to find the patch level (for the sccs version string). */
96 ! #define PATCHLEVEL 22
98 #endif /* _PATCHLEVEL_H_ */
100 looks for to find the patch level (for the sccs version string). */
102 ! #define PATCHLEVEL 23
104 #endif /* _PATCHLEVEL_H_ */