ssh/tailssh: enable recording of non-pty sessions

Updates tailscale/corp#9967

Signed-off-by: Maisem Ali <[email protected]>
(cherry picked from commit 8a246487c2)
This commit is contained in:
Maisem Ali authored and Denton Gentry committed 2023-03-31 17:00:28 -07:00
1 parent 0651c1a069
commit 8414c591e5
2 files changed
+3 -5

No files matched your search

+1 -4
View File
@@ -1130,10 +1130,7 @@ func (ss *sshSession) recorders() []netip.AddrPort {
}
func (ss *sshSession) shouldRecord() bool {
// for now only record pty sessions
// TODO(bradfitz,maisem): support recording non-pty stuff too.
_, _, isPtyReq := ss.Pty()
return isPtyReq && len(ss.recorders()) > 0
return len(ss.recorders()) > 0
}
type sshConnInfo struct {
+2 -1
View File
@@ -539,7 +539,8 @@ func TestSSH(t *testing.T) {
node: &tailcfg.Node{},
uprof: tailcfg.UserProfile{},
}
sc.finalAction = &tailcfg.SSHAction{Accept: true}
sc.action0 = &tailcfg.SSHAction{Accept: true}
sc.finalAction = sc.action0
sc.Handler = func(s ssh.Session) {
sc.newSSHSession(s).run()