ssh localhost yes | true (follow up)

Kyle McKay mackyle at gmail.com
Fri Apr 24 05:30:48 EST 2009


On Apr 23, 2009, at 06:43, Markus Friedl wrote:
> On Thu, Apr 23, 2009 at 11:38:03PM +1000, Damien Miller wrote:
>> I think it violates some assumptions we make in channels.c to mix
>> socketpairs and pipes like this, but I have to check.
>
> yes, it violates assumptions.

I'm running with the changes and haven't noticed any problems.

scp is working, X tunnels are working, port forwarding is working,  
bash is happy (ssh localhost printenv shows it's running ~/.bashrc)  
the half-close fix is working (ssh localhost yes | true doesn't hang).

channels.c clearly works with pipes or sockets, it doesn't have any  
tests of USE_PIPES in it, it's not calling fstat and I don't see any  
tests of S_IFSOCK or S_IFIFO so I'm unclear on how it would be able to  
tell the difference between 3 separate pairs of pipes (normal  
USE_PIPES case), 1 shared socket pair + 1 separate socket pair  
(normal !USE_PIPES case) and 1 socket pair + 2 pairs of pipes.

Of course I'm looking at the version of channels.c that Apple's using:

   http://www.opensource.apple.com/darwinsource/10.5.6/OpenSSH-95.1.5/openssh/channels.c

which is "channels.c,v 1.286 2008/07/16 11:52:19 djm" plus an Apple  
patch, so maybe there's newer version of channels.c that Apple's not  
using that is sensitive to the mixed combination?

Is there something else I should be looking at/testing?

Kyle




More information about the openssh-unix-dev mailing list