Uploaded image for project: 'MINA SSHD'
  1. MINA SSHD
  2. SSHD-256

Consistent handling of SSH_MSG_CHANNEL_REQUEST messages

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • 0.7.0, 0.8.0, 0.9.0
    • 0.10.0
    • None

    Description

      Symptom:

      SSH connection is kept open after the command completes when using Putty, Plink or TortoisePlink, or rather Putty does not finish.

      See:

      Cause:
      ChannelSession has special handling for SSH_MSG_CHANNEL_REQUEST messages that are sent by Putty:

      if (type != null && type.endsWith("@putty.projects.tartarus.org"))

      { // Ignore but accept, more doc at // http://tartarus.org/~simon/putty-snapshots/htmldoc/AppendixF.html return true; }

      There are really two problems with this workaround that was introduced in SSHD-77:

      1) This code ignores the "want reply" flag on the field and simply ignores the request. According to the SSH protocol specification, the server MUST send back a reply (success or failure) if the "want reply" flag is set to true.
      2) Putty intentionally sends an invalid request and expects to receive a SSH_MSG_CHANNEL_FAILURE response (see http://tartarus.org/~simon/putty-snapshots/htmldoc/AppendixF.html), which is the default behaviour of ChannelSession.

      I don't know whether changes in Putty or changes in MinaSSHD have made the workaround obsolete, but it is obsolete. I've verified that without the bit of code I quoted above, the Putty terminates normally.

      Attachments

        Issue Links

          Activity

            People

              gnodet Guillaume Nodet
              mheemskerk Michael Heemskerk
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: