ssh host echo bla | echo bla

Markus Friedl markus at openbsd.org
Thu Dec 20 03:26:39 EST 2001


On Tue, Dec 18, 2001 at 05:56:31PM -0500, Nicolas Williams wrote:
> 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.

i think the ssh client should close the 'channel' when both the local
read and write FDs are closed.

-m



More information about the openssh-unix-dev mailing list