mirror of
https://github.com/slackhq/nebula.git
synced 2026-04-01 05:15:19 +02:00
ssh package handles closing the underlying tcp socket
This commit is contained in:
@@ -181,11 +181,7 @@ func (s *SSHServer) run() {
|
||||
|
||||
if err != nil {
|
||||
l := s.l.WithError(err).WithField("remoteAddress", c.RemoteAddr())
|
||||
if conn == nil {
|
||||
// conn is nil when the handshake failed before authentication
|
||||
// close the raw TCP connection to avoid leaking the file descriptor.
|
||||
c.Close()
|
||||
} else {
|
||||
if conn != nil {
|
||||
l = l.WithField("sshUser", conn.User())
|
||||
conn.Close()
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user