ssh/tailssh, go.mod: fix Plan 9 interactive SSH sessions

Bump plan9netshell for go4org/plan9netshell@f7dfc18b3a,
which fixes interactive shells (broken since Go 1.25 by syscall.Exec),
^C, and hangup on disconnect.

Also stop creating the Plan 9 incubator with exec.CommandContext, which
killed it on any disconnect, unlike the graceful disconnect semantics
the Unix monitor path now has. For PTY sessions that orphaned the shell
and its foreground job. Now closing its stdio makes netshell hang up
the shell instead.

Updates #5794

Change-Id: I95cbca4997a6700c14d022fbf0d0c42486840782
Signed-off-by: Brad Fitzpatrick <[email protected]>
This commit is contained in:
Brad Fitzpatrick authored and Brad Fitzpatrick committed 2026-11-30 17:28:47 -08:00
1 parent 65114d4eba
commit 7ece75e422
6 files changed
+16 -10

No files matched your search

+1 -1
View File
@@ -172,4 +172,4 @@
});
};
}
# nix-direnv cache busting line: sha256-QsllX5yUsJznAf3niq8aKwbDO6Rut8Yyjl6FyCO7Kiw=
# nix-direnv cache busting line: sha256-UhlYeMCFqSuP6aLG3D9PFyjXf8ff68HO6MBvu/DDAOQ=
+2 -2
View File
@@ -4,7 +4,7 @@
"sri": "sha256-Qmy06FkeFkjqCo1FLSD9dO7hTvdo/gC2VACJniuiQBU="
},
"vendor": {
"goModSum": "sha256-CQqT0MmBtyeIL6IdNcZWFaUDFU9z2IR7LKhTCmhrNl0=",
"sri": "sha256-QsllX5yUsJznAf3niq8aKwbDO6Rut8Yyjl6FyCO7Kiw="
"goModSum": "sha256-8YZZZ5wSyCtYJiG3zRtOSYPBqDGW/Vbo2pIRFJROU+I=",
"sri": "sha256-UhlYeMCFqSuP6aLG3D9PFyjXf8ff68HO6MBvu/DDAOQ="
}
}
+1 -1
View File
@@ -54,7 +54,7 @@ require (
github.com/go-logr/zapr v1.3.0
github.com/go-ole/go-ole v1.3.0
github.com/go4org/hashtriemap v0.0.0-20260925222741-44e5305f85d9
github.com/go4org/plan9netshell v0.0.0-20250324183649-788daa080737
github.com/go4org/plan9netshell v0.0.0-20261130214832-f7dfc18b3ab6
github.com/godbus/dbus/v5 v5.2.2
github.com/gokrazy/breakglass v0.0.0-20261129143625-dde5ec3a2b06
github.com/gokrazy/firmware v0.0.0-20261126122533-fe094a467208
+2 -2
View File
@@ -493,8 +493,8 @@ github.com/go-xmlfmt/xmlfmt v1.1.3 h1:t8Ey3Uy7jDSEisW2K3somuMKIpzktkWptA0iFCnRUW
github.com/go-xmlfmt/xmlfmt v1.1.3/go.mod h1:aUCEOzzezBEjDBbFBoSiya/gduyIiWYRP6CnSFIV8AM=
github.com/go4org/hashtriemap v0.0.0-20260925222741-44e5305f85d9 h1:J8S+Ms89nvHX1F9Ma2m3KhdTl41ZhbFKMyAJqvDA+iE=
github.com/go4org/hashtriemap v0.0.0-20260925222741-44e5305f85d9/go.mod h1:OGmRfY/9QEK2P5zCRtmqfbCF283xPkU2dvVA4MvbvpI=
github.com/go4org/plan9netshell v0.0.0-20250324183649-788daa080737 h1:cf60tHxREO3g1nroKr2osU3JWZsJzkfi7rEg+oAB0Lo=
github.com/go4org/plan9netshell v0.0.0-20250324183649-788daa080737/go.mod h1:MIS0jDzbU/vuM9MC4YnBITCv+RYuTRq8dJzmCrFsK9g=
github.com/go4org/plan9netshell v0.0.0-20261130214832-f7dfc18b3ab6 h1:CMyTWglRVWGWh9q2kNEm84/DewiLMsMQtcMmOjxbS0Q=
github.com/go4org/plan9netshell v0.0.0-20261130214832-f7dfc18b3ab6/go.mod h1:MIS0jDzbU/vuM9MC4YnBITCv+RYuTRq8dJzmCrFsK9g=
github.com/gobuffalo/flect v1.0.3 h1:xeWBM2nui+qnVvNM4S3foBhCAL2XgPU+a7FdpelbTq4=
github.com/gobuffalo/flect v1.0.3/go.mod h1:A5msMlrHtLqh9umBSnvabjsMrCcCpAyzglnDvkbYKHs=
github.com/gobwas/glob v0.2.3 h1:A4xDbljILXROh+kObIiy5kIaPYD8e96x1tgBhUI5J+Y=
+1 -1
View File
@@ -16,4 +16,4 @@
) {
src = ./.;
}).shellNix
# nix-direnv cache busting line: sha256-QsllX5yUsJznAf3niq8aKwbDO6Rut8Yyjl6FyCO7Kiw=
# nix-direnv cache busting line: sha256-UhlYeMCFqSuP6aLG3D9PFyjXf8ff68HO6MBvu/DDAOQ=
+9 -3
View File
@@ -43,7 +43,13 @@ func registerIncubator() {
// `tailscaled be-child ssh` as the entrypoint.
//
// If ss.srv.tailscaledPath is empty, this method is equivalent to
// exec.CommandContext.
// exec.Command.
//
// The command is not tied to ss.ctx: canceling the session must not kill
// the child. A disconnect closes the child's stdio, which makes netshell
// hang up the shell's note group the way closing a PTY master signals
// the foreground process group on Unix. Mandated terminations signal the
// child explicitly in [sshSession.hangupProcess].
//
// It also returns forwardedEnv, the client-forwarded environment variables
// accepted by the acceptEnv policy. These may contain secrets, so the caller
@@ -77,7 +83,7 @@ func (ss *sshSession) newIncubatorCommand(logf logger.Logf) (cmd *exec.Cmd, forw
loginShell := ss.conn.localUser.LoginShell()
logf("directly running /bin/rc -c %q", ss.RawCommand())
return exec.CommandContext(ss.ctx, loginShell, "-c", ss.RawCommand()), nil, nil
return exec.Command(loginShell, "-c", ss.RawCommand()), nil, nil
}
lu := ss.conn.localUser
@@ -140,7 +146,7 @@ func (ss *sshSession) newIncubatorCommand(logf logger.Logf) (cmd *exec.Cmd, forw
}
}
return exec.CommandContext(ss.ctx, ss.conn.srv.tailscaledPath, incubatorArgs...), forwardedEnv, nil
return exec.Command(ss.conn.srv.tailscaledPath, incubatorArgs...), forwardedEnv, nil
}
var debugTest atomic.Bool