| Summary: | ssh -2 localhost od /bin/ls | true ignore SIGPIPE | ||
|---|---|---|---|
| Product: | Portable OpenSSH | Reporter: | Markus Friedl <markus> |
| Component: | ssh | Assignee: | OpenSSH Bugzilla mailing list <openssh-bugs> |
| Status: | CLOSED FIXED | ||
| Severity: | normal | CC: | chris, djm |
| Priority: | P2 | ||
| Version: | -current | ||
| Hardware: | All | ||
| OS: | All | ||
| Bug Depends on: | 830 | ||
| Bug Blocks: | 403, 773, 1452 | ||
|
Description
Markus Friedl
2002-01-30 09:39:32 AEDT
fix chan_close/dead/gc:
user_detach decides:
send a close only after a close received or always?
server: delay close until exit message has been sent?
client: always send close ?
What's wrong with the following obvious patch? This fixes the bug for me
(without this, our network backups hang forever if the tape fills up).
diff -ur openssh-3.5p1.orig/clientloop.c openssh-3.5p1/clientloop.c
--- openssh-3.5p1.orig/clientloop.c Wed Sep 4 02:32:13 2002
+++ openssh-3.5p1/clientloop.c Fri Jan 24 12:16:02 2003
@@ -892,6 +892,7 @@
signal(SIGINT, signal_handler);
signal(SIGQUIT, signal_handler);
signal(SIGTERM, signal_handler);
+ signal(SIGPIPE, signal_handler);
if (have_pty)
signal(SIGWINCH, window_change_handler);
i think SIGPIPE can happen in x11-fwding and should not lead to exit(1) I see this bug has now been open for more than four years, with no sign of a fix -- I guess everyone must have a workaround for this issue. Any suggestions, since I haven't been able to find a reliable one...? I am running into this as well, and have not found a workaround. The problem seems to be that protocol 2 lacks a way to "half close" a channel, e.g. close its output while keeping its input open. Markus, does this seem right? (In reply to comment #6) > The problem seems to be that protocol 2 lacks a way to "half close" a > channel, e.g. close its output while keeping its input open. yes, there is only an 'EOF' message that means: I will not send data over this channel, but there is no way to say: I'm no longer interested in what you want to send to me. A fix to this bug has been committed and, barring any problems, will be in OpenSSH 5.1:
> CVSROOT: /cvs
> Module name: src
> Changes by: markus@cvs.openbsd.org 2008/05/09 10:16:06
>
> Modified files:
> usr.bin/ssh : session.c
>
> Log message:
> re-add the USE_PIPES code and enable it.
> without pipes shutdown-read from the sshd does not trigger
> a SIGPIPE when the forked program does a write.
>
> ok djm@
>
>
> CVSROOT: /cvs
> Module name: src
> Changes by: markus@cvs.openbsd.org 2008/05/09 10:17:51
>
> Modified files:
> usr.bin/ssh : channels.c
>
> Log message:
> error-fd race: don't enable the error fd in the select bitmask
> for channels with both in- and output closed, since the channel
> will go away before we call select();
> report, lots of debugging help and ok djm@
>
>
> CVSROOT: /cvs
> Module name: src
> Changes by: markus@cvs.openbsd.org 2008/05/09 10:21:13
>
> Modified files:
> usr.bin/ssh : channels.h clientloop.c nchan.c serverloop.c
>
> Log message:
> unbreak
> ssh -2 localhost od /bin/ls | true
> ignoring SIGPIPE by adding a new channel message (EOW) that signals
> the peer that we're not interested in any data it might send.
> fixes bz #85; discussion, debugging and ok djm@
Mass update RESOLVED->CLOSED after release of openssh-5.1 |