Răsfoiți Sursa

ssh/tailssh: enable recording of non-pty sessions

Updates tailscale/corp#9967

Signed-off-by: Maisem Ali <[email protected]>
Maisem Ali 3 ani în urmă
părinte
comite
8a246487c2
2 a modificat fișierele cu 3 adăugiri și 5 ștergeri
  1. 1 4
      ssh/tailssh/tailssh.go
  2. 2 1
      ssh/tailssh/tailssh_test.go

+ 1 - 4
ssh/tailssh/tailssh.go

@@ -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
ssh/tailssh/tailssh_test.go

@@ -540,7 +540,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()