IETF-SSH archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: Channel close logic, needs clarification?



Markus Friedl, on March 11. 2001, wrote:
  : On Thu, Mar 08, 2001 at 05:31:58PM +0100, Niels Möller wrote:
  : > For instance, I have heard reports that when logging in with the
  : > openssh client to a recent lshd, the client will hang after logout.
  : 
  : Yes, I can reproduce this problem. Do other SSH client implementations
  : hang, too?

I can reproduce this with our client and lshd version 1.1.7.

  : > I'll describe the logic that lsh and lshd uses. The basic rules are as
  : > follows:
  : > 
  : > 1. When SSH_MSG_CHANNEL_CLOSE is both sent and received, the channel
  : >    is killed. This is unconditionally required by the spec.
  : 
  : So does OpenSSH.

So does ssh2.

  : > What happens at the client? When the lsh client receives
  : > an SSH_MSG_CHANNEL_REQUEST "exit-status" message, it decides that it's
  : > time to stop talking, and it sends an SSH_MSG_CHANNEL_EOF. Now rule 2
  : > applies, and the channel gets closed properly.
  : 
  : The OpenSSH client considers the "exit-status" message just informational
  : and does _not_ send an EOF message back.

ssh2 doesn't send an EOF message, either.

  : > But appearantly, this logic doesn't work right when talking to the
  : > openssh client. It doesn't send any SSH_MSG_CHANNEL_EOF, and to the
  : > user it appears that the system just hangs.
  : 
  : The OpenSSH server does not wait for the EOF message from the client.
  : However, since the servers' child process is dead, the server decides
  : that it will not write to more data to the 'stdin' handle and does _not_
  : wait for the EOF message from the client.  This way the the channel is
  : correctly closed.

sshd2 sends an SSH_MSG_CHANNEL_CLOSE when the shell exists for session
channels.

Cheers,
-- 
[sjl%ssh.com@localhost          --  Sami J. Lehtinen  --           sjl%iki.fi@localhost]
[work:+358 9 85657425][gsm:+358 50 5170 258][http://www.iki.fi/~sjl]
[SSH Communications Security Corp               http://www.ssh.com/]



Home | Main Index | Thread Index | Old Index