]> git.pld-linux.org Git - packages/openssh.git/blame - openssh-sigpipe.patch
- rediff patches
[packages/openssh.git] / openssh-sigpipe.patch
CommitLineData
7ae7664a
AM
1diff -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
5 /* Control socket */
6 extern int muxserver_sock; /* XXX use mux_client_cleanup() instead */
d79228b3
SZ
7
8+/* if we process SIGPIPE */
9+extern int enable_sigpipe;
10+
11 /*
7ae7664a
AM
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
204858e5
AM
15 ssh_signal(SIGQUIT, signal_handler);
16 if (ssh_signal(SIGTERM, SIG_IGN) != SIG_IGN)
17 ssh_signal(SIGTERM, signal_handler);
d79228b3
SZ
18+ if (enable_sigpipe)
19+ signal(SIGPIPE, signal_handler);
204858e5 20 ssh_signal(SIGWINCH, window_change_handler);
d79228b3 21
9c944978 22 if (have_pty)
7ae7664a
AM
23diff -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
048795bf
AM
27 -y Send log information using the syslog(3) system module. By
28 default this information is sent to stderr.
46931270 29
048795bf 30+ -Z Enable SIGPIPE processing.
46931270 31+
048795bf
AM
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).
7ae7664a
AM
35diff -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
048795bf 38@@ -42,7 +42,7 @@
7ae7664a 39 .Nd OpenSSH remote login client
cd749aff 40 .Sh SYNOPSIS
d79228b3 41 .Nm ssh
8a81cd30 42-.Op Fl 46AaCfGgKkMNnqsTtVvXxYy
048795bf
AM
43+.Op Fl 46AaCfGgKkMNnqsTtVvXxYyZ
44 .Op Fl B Ar bind_interface
d79228b3
SZ
45 .Op Fl b Ar bind_address
46 .Op Fl c Ar cipher_spec
7ae7664a 47@@ -142,6 +142,11 @@ on the local machine as the source addre
4c48535c
AM
48 of the connection.
49 Only useful on systems with more than one address.
f9d8b6a7 50 .Pp
048795bf 51+.It Fl Z
d79228b3 52+Enables processing of SIGPIPE. Useful when using ssh output as input for
aa4ad340
SZ
53+another process, for example in a shell script. Be careful - it may break
54+port/X11 forwarding when used.
f9d8b6a7 55+.Pp
cd749aff 56 .It Fl C
57 Requests compression of all data (including stdin, stdout, stderr, and
f9d8b6a7 58 data for forwarded X11, TCP and
7ae7664a
AM
59diff -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;
d79228b3
SZ
63 /* Should we execute a command or invoke a subsystem? */
64 int subsystem_flag = 0;
65
66+/* Enable sigpipe */
67+int enable_sigpipe = 0;
68+
69 /* # of replies received for global requests */
7ae7664a 70 static int forward_confirms_pending = -1;
d79228b3 71
7ae7664a 72@@ -203,7 +206,7 @@ static void
9c944978
JB
73 usage(void)
74 {
75 fprintf(stderr,
048795bf
AM
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"
7ae7664a 81@@ -722,7 +725,7 @@ main(int ac, char **av)
d79228b3 82
fc8529e5
AM
83 again:
84 while ((opt = getopt(ac, av, "1246ab:c:e:fgi:kl:m:no:p:qstvx"
048795bf
AM
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) {
d79228b3
SZ
87 switch (opt) {
88 case '1':
048795bf 89 fatal("SSH protocol v.1 is no longer supported");
7ae7664a 90@@ -1066,6 +1069,9 @@ main(int ac, char **av)
048795bf
AM
91 case 'F':
92 config = optarg;
d79228b3 93 break;
048795bf 94+ case 'Z':
d79228b3
SZ
95+ enable_sigpipe = 1;
96+ break;
048795bf
AM
97 default:
98 usage();
99 }
This page took 0.049385 seconds and 4 git commands to generate.