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 {
|
if err != nil {
|
||||||
l := s.l.WithError(err).WithField("remoteAddress", c.RemoteAddr())
|
l := s.l.WithError(err).WithField("remoteAddress", c.RemoteAddr())
|
||||||
if conn == nil {
|
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 {
|
|
||||||
l = l.WithField("sshUser", conn.User())
|
l = l.WithField("sshUser", conn.User())
|
||||||
conn.Close()
|
conn.Close()
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user