]> git.ipfire.org Git - people/pmueller/ipfire-2.x.git/blob - src/patches/bash/bash52-003
suricata: Change midstream policy to "pass-flow"
[people/pmueller/ipfire-2.x.git] / src / patches / bash / bash52-003
1 BASH PATCH REPORT
2 =================
3
4 Bash-Release: 5.2
5 Patch-ID: bash52-003
6
7 Bug-Reported-by: D630 <d630@posteo.net>
8 Bug-Reference-ID: <cf8523d58ac75b9ffba9519faa175618@posteo.de>
9 Bug-Reference-URL: https://lists.gnu.org/archive/html/bug-bash/2022-10/msg00092.html
10
11 Bug-Description:
12
13 Command substitutions need to preserve newlines instead of replacing them
14 with semicolons, especially in the presence of multiple here-documents.
15
16 Patch (apply with `patch -p0'):
17
18 *** ../bash-5.2-patched/print_cmd.c 2022-07-26 09:16:39.000000000 -0400
19 --- print_cmd.c 2022-10-17 10:41:06.000000000 -0400
20 ***************
21 *** 298,305 ****
22 --- 298,307 ----
23 {
24 char c = command->value.Connection->connector;
25 + int was_newline;
26
27 s[0] = printing_comsub ? c : ';';
28 s[1] = '\0';
29
30 + was_newline = deferred_heredocs == 0 && was_heredoc == 0 && c == '\n';
31 if (deferred_heredocs == 0)
32 {
33 ***************
34 *** 315,318 ****
35 --- 317,322 ----
36 if (inside_function_def)
37 cprintf ("\n");
38 + else if (printing_comsub && c == '\n' && was_newline == 0)
39 + cprintf ("\n"); /* preserve newlines in comsubs but don't double them */
40 else
41 {
42 ***************
43 *** 1366,1370 ****
44 }
45 else
46 ! newline ("}");
47
48 dispose_command (cmdcopy);
49 --- 1371,1379 ----
50 }
51 else
52 ! {
53 ! /* { */
54 ! newline ("}");
55 ! was_heredoc = 0; /* not printing any here-documents now */
56 ! }
57
58 dispose_command (cmdcopy);
59 ***************
60 *** 1443,1447 ****
61 }
62 else
63 ! newline ("}");
64
65 result = the_printed_command;
66 --- 1452,1459 ----
67 }
68 else
69 ! { /* { */
70 ! newline ("}");
71 ! was_heredoc = 0;
72 ! }
73
74 result = the_printed_command;
75 *** ../bash-5.2/patchlevel.h 2020-06-22 14:51:03.000000000 -0400
76 --- patchlevel.h 2020-10-01 11:01:28.000000000 -0400
77 ***************
78 *** 26,30 ****
79 looks for to find the patch level (for the sccs version string). */
80
81 ! #define PATCHLEVEL 2
82
83 #endif /* _PATCHLEVEL_H_ */
84 --- 26,30 ----
85 looks for to find the patch level (for the sccs version string). */
86
87 ! #define PATCHLEVEL 3
88
89 #endif /* _PATCHLEVEL_H_ */