mirror of
https://github.com/tailscale/tailscale.git
synced 2025-04-21 06:01:42 +00:00
ssh/tailssh: fix /usr/bin/login args on macOS
Fixes #4931 Signed-off-by: Adam Eijdenberg <adam@continusec.com> (cherry picked from commit 7f807fef6cfde123ae987cc659a7e89dc74b84c1)
This commit is contained in:
parent
5b81baa7d3
commit
0f8e4b22b1
@ -206,7 +206,7 @@ func beIncubator(args []string) error {
|
|||||||
// If we are trying to launch a login shell, just exec into login
|
// 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
|
// instead. We can only do this if a TTY was requested, otherwise login
|
||||||
// exits immediately, which breaks things likes mosh and VSCode.
|
// 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())
|
return unix.Exec(ia.loginCmdPath, ia.loginArgs(), os.Environ())
|
||||||
}
|
}
|
||||||
|
|
||||||
// Inform the system that we are about to log someone in.
|
// Inform the system that we are about to log someone in.
|
||||||
|
9
ssh/tailssh/incubator_darwin.go
Normal file
9
ssh/tailssh/incubator_darwin.go
Normal file
@ -0,0 +1,9 @@
|
|||||||
|
// Copyright (c) 2022 Tailscale Inc & AUTHORS All rights reserved.
|
||||||
|
// Use of this source code is governed by a BSD-style
|
||||||
|
// license that can be found in the LICENSE file.
|
||||||
|
|
||||||
|
package tailssh
|
||||||
|
|
||||||
|
func (ia *incubatorArgs) loginArgs() []string {
|
||||||
|
return []string{ia.loginCmdPath, "-fp", "-h", ia.remoteIP, ia.localUser}
|
||||||
|
}
|
@ -173,3 +173,7 @@ func maybeStartLoginSessionLinux(logf logger.Logf, ia incubatorArgs) (func() err
|
|||||||
}
|
}
|
||||||
return nil, nil
|
return nil, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func (ia *incubatorArgs) loginArgs() []string {
|
||||||
|
return []string{ia.loginCmdPath, "-f", ia.localUser, "-h", ia.remoteIP, "-p"}
|
||||||
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user