]> git.pld-linux.org Git - packages/openssh.git/blame - openssh-sigpipe.patch
- add sigpipe patch
[packages/openssh.git] / openssh-sigpipe.patch
CommitLineData
d79228b3
SZ
1diff -Naur openssh-3.5p1/clientloop.c openssh-3.5p1-p/clientloop.c
2--- openssh-3.5p1/clientloop.c Wed Sep 4 08:32:13 2002
3+++ openssh-3.5p1-p/clientloop.c Tue Nov 5 15:46:26 2002
4@@ -96,6 +96,9 @@
5 */
6 extern char *host;
7
8+/* if we process SIGPIPE */
9+extern int enable_sigpipe;
10+
11 /*
12 * Flag to indicate that we have received a window change signal which has
13 * not yet been processed. This will cause a message indicating the new
14@@ -892,6 +895,10 @@
15 signal(SIGINT, signal_handler);
16 signal(SIGQUIT, signal_handler);
17 signal(SIGTERM, signal_handler);
18+
19+ if (enable_sigpipe)
20+ signal(SIGPIPE, signal_handler);
21+
22 if (have_pty)
23 signal(SIGWINCH, window_change_handler);
24
25diff -Naur openssh-3.5p1/ssh.1 openssh-3.5p1-p/ssh.1
26--- openssh-3.5p1/ssh.1 Mon Sep 30 04:00:56 2002
27+++ openssh-3.5p1-p/ssh.1 Tue Nov 5 15:51:54 2002
28@@ -48,7 +48,7 @@
29 .Op Ar command
30 .Pp
31 .Nm ssh
32-.Op Fl afgknqstvxACNTX1246
33+.Op Fl afgknqstvxABCNTX1246
34 .Op Fl b Ar bind_address
35 .Op Fl c Ar cipher_spec
36 .Op Fl e Ar escape_char
37@@ -412,6 +412,9 @@
38 .It Fl b Ar bind_address
39 Specify the interface to transmit from on machines with multiple
40 interfaces or aliased addresses.
41+.It Fl B
42+Enables processing of SIGPIPE. Useful when using ssh output as input for
43+another process, for example in a shell script.
44 .It Fl c Ar blowfish|3des|des
45 Selects the cipher to use for encrypting the session.
46 .Ar 3des
47diff -Naur openssh-3.5p1/ssh.c openssh-3.5p1-p/ssh.c
48--- openssh-3.5p1/ssh.c Thu Sep 19 04:05:04 2002
49+++ openssh-3.5p1-p/ssh.c Tue Nov 5 15:44:57 2002
50@@ -143,6 +143,9 @@
51 /* Should we execute a command or invoke a subsystem? */
52 int subsystem_flag = 0;
53
54+/* Enable sigpipe */
55+int enable_sigpipe = 0;
56+
57 /* # of replies received for global requests */
58 static int client_global_request_id = 0;
59
60@@ -161,6 +164,7 @@
61 fprintf(stderr, " -F config Config file (default: ~/%s).\n",
62 _PATH_SSH_USER_CONFFILE);
63 fprintf(stderr, " -A Enable authentication agent forwarding.\n");
64+ fprintf(stderr, " -B Enable SIGPIPE processing.\n");
65 fprintf(stderr, " -a Disable authentication agent forwarding (default).\n");
66 #ifdef AFS
67 fprintf(stderr, " -k Disable Kerberos ticket and AFS token forwarding.\n");
68@@ -275,7 +279,7 @@
69
70 again:
71 while ((opt = getopt(ac, av,
72- "1246ab:c:e:fgi:kl:m:no:p:qstvxACD:F:I:L:NPR:TVX")) != -1) {
73+ "1246ab:c:e:fgi:kl:m:no:p:qstvxABCD:F:I:L:NPR:TVX")) != -1) {
74 switch (opt) {
75 case '1':
76 options.protocol = SSH_PROTO_1;
77@@ -314,6 +318,9 @@
78 case 'A':
79 options.forward_agent = 1;
80 break;
81+ case 'B':
82+ enable_sigpipe = 1;
83+ break;
84 #ifdef AFS
85 case 'k':
86 options.kerberos_tgt_passing = 0;
This page took 0.03651 seconds and 4 git commands to generate.