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

Signed-off-by: Maisem Ali <maisem@tailscale.com>
pull/4496/head
Maisem Ali 3 years ago committed by Maisem Ali
parent 37c94c07cd
commit db70774685

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

Loading…
Cancel
Save