cmd/tailscale/cli: do not use syscall.Exec from macOS sandbox

Signed-off-by: Maisem Ali <maisem@tailscale.com>
This commit is contained in:
Maisem Ali 2022-04-21 16:37:41 -07:00 committed by Maisem Ali
parent 37c94c07cd
commit db70774685
1 changed files with 3 additions and 2 deletions

View File

@ -24,6 +24,7 @@ import (
"tailscale.com/client/tailscale"
"tailscale.com/envknob"
"tailscale.com/ipn/ipnstate"
"tailscale.com/version"
)
var sshCmd = &ffcli.Command{
@ -104,8 +105,8 @@ func runSSH(ctx context.Context, args []string) error {
username + "@" + hostForSSH,
}, argRest...)
if runtime.GOOS == "windows" {
// Don't use syscall.Exec on Windows.
if runtime.GOOS == "windows" || version.IsSandboxedMacOS() {
// Don't use syscall.Exec on Windows or in the macOS sandbox.
cmd := exec.Command(ssh, argv[1:]...)
cmd.Stderr = os.Stderr
cmd.Stdout = os.Stdout