1 diff -urNp -x '*.orig' openssh-8.4p1.org/clientloop.c openssh-8.4p1/clientloop.c
2 --- openssh-8.4p1.org/clientloop.c 2020-09-27 09:25:01.000000000 +0200
3 +++ openssh-8.4p1/clientloop.c 2021-03-01 11:29:10.909905265 +0100
4 @@ -127,6 +127,9 @@ extern int fork_after_authentication_fla
6 extern int muxserver_sock; /* XXX use mux_client_cleanup() instead */
8 +/* if we process SIGPIPE */
9 +extern int enable_sigpipe;
12 * Name of the host we are connecting to. This is the name given on the
13 * command line, or the Hostname specified for the user-supplied name in a
14 @@ -1301,6 +1304,8 @@ client_loop(struct ssh *ssh, int have_pt
15 ssh_signal(SIGQUIT, signal_handler);
16 if (ssh_signal(SIGTERM, SIG_IGN) != SIG_IGN)
17 ssh_signal(SIGTERM, signal_handler);
19 + signal(SIGPIPE, signal_handler);
20 ssh_signal(SIGWINCH, window_change_handler);
23 diff -urNp -x '*.orig' openssh-8.4p1.org/ssh.0 openssh-8.4p1/ssh.0
24 --- openssh-8.4p1.org/ssh.0 2020-09-27 09:42:10.000000000 +0200
25 +++ openssh-8.4p1/ssh.0 2021-03-01 11:29:10.909905265 +0100
26 @@ -446,6 +446,8 @@ DESCRIPTION
27 -y Send log information using the syslog(3) system module. By
28 default this information is sent to stderr.
30 + -Z Enable SIGPIPE processing.
32 ssh may additionally obtain configuration data from a per-user
33 configuration file and a system-wide configuration file. The file format
34 and configuration options are described in ssh_config(5).
35 diff -urNp -x '*.orig' openssh-8.4p1.org/ssh.1 openssh-8.4p1/ssh.1
36 --- openssh-8.4p1.org/ssh.1 2020-09-27 09:25:01.000000000 +0200
37 +++ openssh-8.4p1/ssh.1 2021-03-01 11:29:10.909905265 +0100
39 .Nd OpenSSH remote login client
42 -.Op Fl 46AaCfGgKkMNnqsTtVvXxYy
43 +.Op Fl 46AaCfGgKkMNnqsTtVvXxYyZ
44 .Op Fl B Ar bind_interface
45 .Op Fl b Ar bind_address
46 .Op Fl c Ar cipher_spec
47 @@ -142,6 +142,11 @@ on the local machine as the source addre
49 Only useful on systems with more than one address.
52 +Enables processing of SIGPIPE. Useful when using ssh output as input for
53 +another process, for example in a shell script. Be careful - it may break
54 +port/X11 forwarding when used.
57 Requests compression of all data (including stdin, stdout, stderr, and
58 data for forwarded X11, TCP and
59 diff -urNp -x '*.orig' openssh-8.4p1.org/ssh.c openssh-8.4p1/ssh.c
60 --- openssh-8.4p1.org/ssh.c 2020-09-27 09:25:01.000000000 +0200
61 +++ openssh-8.4p1/ssh.c 2021-03-01 11:29:10.909905265 +0100
62 @@ -190,6 +190,9 @@ struct sshbuf *command;
63 /* Should we execute a command or invoke a subsystem? */
64 int subsystem_flag = 0;
67 +int enable_sigpipe = 0;
69 /* # of replies received for global requests */
70 static int forward_confirms_pending = -1;
72 @@ -203,7 +206,7 @@ static void
76 -"usage: ssh [-46AaCfGgKkMNnqsTtVvXxYy] [-B bind_interface]\n"
77 +"usage: ssh [-46AaCfGgKkMNnqsTtVvXxYyZ] [-B bind_interface]\n"
78 " [-b bind_address] [-c cipher_spec] [-D [bind_address:]port]\n"
79 " [-E log_file] [-e escape_char] [-F configfile] [-I pkcs11]\n"
80 " [-i identity_file] [-J [user@]host[:port]] [-L address]\n"
81 @@ -722,7 +725,7 @@ main(int ac, char **av)
84 while ((opt = getopt(ac, av, "1246ab:c:e:fgi:kl:m:no:p:qstvx"
85 - "AB:CD:E:F:GI:J:KL:MNO:PQ:R:S:TVw:W:XYy")) != -1) {
86 + "AB:CD:E:F:GI:J:KL:MNO:PQ:R:S:TVw:W:XYyZ")) != -1) {
89 fatal("SSH protocol v.1 is no longer supported");
90 @@ -1066,6 +1069,9 @@ main(int ac, char **av)