Details
-
Bug
-
Status: Resolved
-
Major
-
Resolution: Fixed
-
0.7.0, 0.8.0, 0.9.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:
- https://code.google.com/p/tortoisegit/issues/detail?id=1880
- https://jira.atlassian.com/browse/STASH-3824
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
Attachments
Issue Links
- links to