ssh: send exit-status request for successful commands

The crypto/ssh client library requires this.
This commit is contained in:
Michael Stapelberg 2018-06-23 15:42:41 +02:00
parent 6184621747
commit 0d8462cfe7

4
ssh.go
View File

@ -161,6 +161,10 @@ func (s *session) request(req *ssh.Request) error {
return err
}
// See https://tools.ietf.org/html/rfc4254#section-6.10
if _, err := s.channel.SendRequest("exit-status", false /* wantReply */, []byte("\x00\x00\x00\x00")); err != nil {
return err
}
s.channel.Close()
return nil
}