---- openssh-3.8p1/clientloop.c.orig 2003-12-17 06:33:11.000000000 +0100
-+++ openssh-3.8p1/clientloop.c 2004-02-25 21:25:43.000000000 +0100
-@@ -99,6 +99,9 @@
+--- openssh-4.0p1/clientloop.c.orig 2005-03-01 11:24:33.000000000 +0100
++++ openssh-4.0p1/clientloop.c 2005-03-10 15:10:05.000000000 +0100
+@@ -104,6 +104,9 @@
*/
extern char *host;
/*
* Flag to indicate that we have received a window change signal which has
* not yet been processed. This will cause a message indicating the new
-@@ -940,6 +943,8 @@
+@@ -1236,6 +1239,8 @@
signal(SIGQUIT, signal_handler);
if (signal(SIGTERM, SIG_IGN) != SIG_IGN)
signal(SIGTERM, signal_handler);
+ if (enable_sigpipe)
+ signal(SIGPIPE, signal_handler);
+ signal(SIGWINCH, window_change_handler);
+
if (have_pty)
- signal(SIGWINCH, window_change_handler);
+diff -urN openssh-3.9p1.org/ssh.0 openssh-3.9p1/ssh.0
+--- openssh-3.9p1.org/ssh.0 2004-08-17 19:03:29.327565840 +0200
++++ openssh-3.9p1/ssh.0 2004-08-17 19:03:41.809668272 +0200
+@@ -235,6 +235,8 @@
+ that enable them to authenticate using the identities loaded into
+ the agent.
+
++ -B Enable SIGPIPE processing.
++
+ -a Disables forwarding of the authentication agent connection.
---- openssh-3.8p1/ssh.1.orig 2003-12-17 06:33:11.000000000 +0100
-+++ openssh-3.8p1/ssh.1 2004-02-25 21:28:27.000000000 +0100
+ -b bind_address
+--- openssh-4.0p1/ssh.1.orig 2005-03-09 01:00:06.000000000 +0100
++++ openssh-4.0p1/ssh.1 2005-03-10 15:10:40.000000000 +0100
@@ -43,7 +43,7 @@
.Nd OpenSSH SSH client (remote login program)
.Sh SYNOPSIS
.Nm ssh
--.Op Fl 1246AaCfgkNnqsTtVvXxY
-+.Op Fl 1246ABaCfgkNnqsTtVvXxY
+-.Op Fl 1246AaCfgKkMNnqsTtVvXxY
++.Op Fl 1246AaBCfgKkMNnqsTtVvXxY
.Op Fl b Ar bind_address
.Op Fl c Ar cipher_spec
- .Op Fl D Ar port
-@@ -426,6 +426,10 @@
- .It Fl b Ar bind_address
- Specify the interface to transmit from on machines with multiple
- interfaces or aliased addresses.
+ .Oo Fl D\ \&
+@@ -425,6 +425,10 @@
+ on the local machine as the source address
+ of the connection.
+ Only useful on systems with more than one address.
+.It Fl B
+Enables processing of SIGPIPE. Useful when using ssh output as input for
+another process, for example in a shell script. Be careful - it may break
.It Fl C
Requests compression of all data (including stdin, stdout, stderr, and
data for forwarded X11 and TCP/IP connections).
---- openssh-3.8p1/ssh.c.orig 2003-12-17 06:33:11.000000000 +0100
-+++ openssh-3.8p1/ssh.c 2004-02-25 21:30:51.000000000 +0100
+--- openssh-4.0p1/ssh.c.orig 2005-03-02 02:04:33.000000000 +0100
++++ openssh-4.0p1/ssh.c 2005-03-10 15:11:10.000000000 +0100
@@ -135,6 +135,9 @@
/* Should we execute a command or invoke a subsystem? */
int subsystem_flag = 0;
/* # of replies received for global requests */
static int client_global_request_id = 0;
-@@ -153,6 +156,7 @@
- fprintf(stderr, " -F config Config file (default: ~/%s).\n",
- _PATH_SSH_USER_CONFFILE);
- fprintf(stderr, " -A Enable authentication agent forwarding.\n");
-+ fprintf(stderr, " -B Enable SIGPIPE processing.\n");
- fprintf(stderr, " -a Disable authentication agent forwarding (default).\n");
- fprintf(stderr, " -X Enable X11 connection forwarding.\n");
- fprintf(stderr, " -Y Enable trusted X11 connection forwarding.\n");
-@@ -265,7 +269,7 @@
+@@ -157,7 +160,7 @@
+ usage(void)
+ {
+ fprintf(stderr,
+-"usage: ssh [-1246AaCfgKkMNnqsTtVvXxY] [-b bind_address] [-c cipher_spec]\n"
++"usage: ssh [-1246AaBCfgKkMNnqsTtVvXxY] [-b bind_address] [-c cipher_spec]\n"
+ " [-D [bind_address:]port] [-e escape_char] [-F configfile]\n"
+ " [-i identity_file] [-L [bind_address:]port:host:hostport]\n"
+ " [-l login_name] [-m mac_spec] [-O ctl_cmd] [-o option] [-p port]\n"
+@@ -244,7 +247,7 @@
again:
while ((opt = getopt(ac, av,
-- "1246ab:c:e:fgi:kl:m:no:p:qstvxACD:F:I:L:NPR:TVXY")) != -1) {
-+ "1246ab:c:e:fgi:kl:m:no:p:qstvxABCD:F:I:L:NPR:TVXY")) != -1) {
+- "1246ab:c:e:fgi:kl:m:no:p:qstvxACD:F:I:KL:MNO:PR:S:TVw:XY")) != -1) {
++ "1246ab:c:e:fgi:kl:m:no:p:qstvxABCD:F:I:KL:MNO:PR:S:TVw:XY")) != -1) {
switch (opt) {
case '1':
options.protocol = SSH_PROTO_1;
-@@ -308,6 +312,9 @@
+@@ -291,6 +294,9 @@
case 'A':
options.forward_agent = 1;
break;