Make ssh sockets close on exit

This commit is contained in:
Bernd Schoolmann 2024-02-04 01:28:43 +01:00
parent f5c20905a9
commit 4afd6ef9b1
No known key found for this signature in database
2 changed files with 2 additions and 0 deletions

View File

@ -22,6 +22,7 @@ func (v SSHAgentServer) Serve() {
if err != nil { if err != nil {
panic(err) panic(err)
} }
defer listener.Close()
log.Info("SSH Agent listening on %s", path) log.Info("SSH Agent listening on %s", path)

View File

@ -294,6 +294,7 @@ func StartUnixAgent(path string, runtimeConfig config.RuntimeConfig) error {
println("listen error", err.Error()) println("listen error", err.Error())
return err return err
} }
defer l.Close()
log.Info("Agent listening on %s...", path) log.Info("Agent listening on %s...", path)
go func() { go func() {