cmd/tailscale/cli: disable 'tailscale ssh' on sandboxed macOS

Updates #3802
Updates #4518
Fixes #4628

Change-Id: I194d2cc30fc8e38b66d4910787efbce14317b0ff
Signed-off-by: Brad Fitzpatrick <bradfitz@tailscale.com>
pull/4796/head
Brad Fitzpatrick 3 years ago committed by Brad Fitzpatrick
parent 0df3b76c25
commit 0d972678e7

@ -22,6 +22,7 @@ import (
"tailscale.com/envknob" "tailscale.com/envknob"
"tailscale.com/ipn/ipnstate" "tailscale.com/ipn/ipnstate"
"tailscale.com/net/tsaddr" "tailscale.com/net/tsaddr"
"tailscale.com/version"
) )
var sshCmd = &ffcli.Command{ var sshCmd = &ffcli.Command{
@ -32,6 +33,9 @@ var sshCmd = &ffcli.Command{
} }
func runSSH(ctx context.Context, args []string) error { func runSSH(ctx context.Context, args []string) error {
if runtime.GOOS == "darwin" && version.IsSandboxedMacOS() && !envknob.UseWIPCode() {
return errors.New("The 'tailscale ssh' subcommand is not available on sandboxed macOS builds.\nUse the regular 'ssh' client instead.")
}
if len(args) == 0 { if len(args) == 0 {
return errors.New("usage: ssh [user@]<host>") return errors.New("usage: ssh [user@]<host>")
} }

Loading…
Cancel
Save