safesocket: support connecting to Mac TCP server from within App Sandbox

This commit is contained in:
Brad Fitzpatrick
2020-07-20 14:23:50 -07:00
parent f267a7396f
commit f562c35c0d
2 changed files with 67 additions and 22 deletions

View File

@@ -28,17 +28,16 @@ import (
// (pty, parent PID), etc.
func ActLikeCLI() bool {
if len(os.Args) < 2 {
// TODO: on Windows & Mac, show usage if we're being run with a pty.
return false
}
switch os.Args[1] {
case "up", "status", "netcheck":
case "up", "status", "netcheck", "-h", "--help":
return true
}
return false
}
// Run runs the CLI. The args do npot include the binary name.
// Run runs the CLI. The args do not include the binary name.
func Run(args []string) error {
rootfs := flag.NewFlagSet("tailscale", flag.ExitOnError)
rootfs.StringVar(&rootArgs.socket, "socket", paths.DefaultTailscaledSocket(), "path to tailscaled's unix socket")