ssh host echo bla | echo bla

Nicolas Williams Nicolas.Williams at ubsw.com
Wed Dec 19 09:56:31 EST 2001


On Tue, Dec 18, 2001 at 11:11:56PM +0100, Markus Friedl wrote:
> On Wed, Dec 19, 2001 at 12:16:55AM +0300, Michael Tokarev wrote:
> > But ssh should do what it has been asked to, or attempt to
> > do that --
> 
> sure.
> 
> > it should NEVER try to "optimize" it's work by e.g. eliminating
> > connection attempt if e.g. stdout is closed.
> 
> yes, this was never considered. ssh will always connect
> since it will not try to write to stdout before authentication
> succeeds.

Right. See my other post from the last few minutes. Ssh does find that
stdout is broken when there's output from the remote command and then
simply closes stdout.

> > That to say -- I think that
> > ssh should "reinvent" the -1 behaviour (correct from my view) to -2 variant
> > (i.e. do what it was asked for and print any error message), but NOT the
> > reverse.
> 
> yes, where's a patch :) ?

The patch should be to nchan.c:chan_write_failed2() - it should check
whether the fildes being closed is stdout (or stderr), and if so, print
an error / log an error and then call fatal().

Simple enough, yes? Correct? I think so.

Caveat emptor: ssh will not find out about stdout/stderr being broken
pipes until it has reason to write to stdout/stderr.

Cheers,

Nico
--
-DISCLAIMER: an automatically appended disclaimer may follow. By posting-
-to a public e-mail mailing list I hereby grant permission to distribute-
-and copy this message.-

Visit our website at http://www.ubswarburg.com

This message contains confidential information and is intended only 
for the individual named.  If you are not the named addressee you 
should not disseminate, distribute or copy this e-mail.  Please 
notify the sender immediately by e-mail if you have received this 
e-mail by mistake and delete this e-mail from your system.

E-mail transmission cannot be guaranteed to be secure or error-free 
as information could be intercepted, corrupted, lost, destroyed, 
arrive late or incomplete, or contain viruses.  The sender therefore 
does not accept liability for any errors or omissions in the contents 
of this message which arise as a result of e-mail transmission.  If 
verification is required please request a hard-copy version.  This 
message is provided for informational purposes and should not be 
construed as a solicitation or offer to buy or sell any securities or 
related financial instruments.




More information about the openssh-unix-dev mailing list