mirror of
https://github.com/tailscale/tailscale.git
synced 2024-11-25 19:15:34 +00:00
ssh/tailssh: only use login
with TTY sessions
Otherwise, the shell exits immediately causing applications like mosh and VSCode to fail. Signed-off-by: Maisem Ali <maisem@tailscale.com>
This commit is contained in:
parent
02e580c1d2
commit
760740905e
@ -202,8 +202,10 @@ func beIncubator(args []string) error {
|
||||
|
||||
euid := uint64(os.Geteuid())
|
||||
runningAsRoot := euid == 0
|
||||
if runningAsRoot && ia.isShell && ia.loginCmdPath != "" {
|
||||
// If we are trying to launch a login shell, just exec into login instead.
|
||||
if runningAsRoot && ia.isShell && ia.loginCmdPath != "" && ia.hasTTY {
|
||||
// If we are trying to launch a login shell, just exec into login
|
||||
// instead. We can only do this if a TTY was requested, otherwise login
|
||||
// exits immediately, which breaks things likes mosh and VSCode.
|
||||
return unix.Exec(ia.loginCmdPath, []string{ia.loginCmdPath, "-f", ia.localUser, "-h", ia.remoteIP, "-p"}, os.Environ())
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user