ssh/tailssh: close sshContext on context cancellation

This was preventing tailscaled from shutting down properly if there were
active sessions in certain states (e.g. waiting in check mode).

Signed-off-by: Maisem Ali <maisem@tailscale.com>
This commit is contained in:
Maisem Ali
2022-10-09 14:17:38 -07:00
committed by Maisem Ali
parent 8fe04b035c
commit f172fc42f7
2 changed files with 13 additions and 10 deletions

View File

@@ -770,7 +770,7 @@ func (c *conn) newSSHSession(s ssh.Session) *sshSession {
return &sshSession{
Session: s,
sharedID: sharedID,
ctx: newSSHContext(),
ctx: newSSHContext(s.Context()),
conn: c,
logf: logger.WithPrefix(c.srv.logf, "ssh-session("+sharedID+"): "),
}