cmd/tailscaled: on darwin, fail early if not root with nicer message

Don't do it on all platforms, as Linux folk might be playing
container + capability games.
pull/1358/head
Brad Fitzpatrick 3 years ago
parent 3e5c3e932c
commit 38629b62fc

@ -131,7 +131,13 @@ func main() {
os.Exit(0)
}
if runtime.GOOS == "darwin" && os.Getuid() != 0 {
log.SetFlags(0)
log.Fatalf("tailscaled requires root; use sudo tailscaled")
}
if args.socketpath == "" && runtime.GOOS != "windows" {
log.SetFlags(0)
log.Fatalf("--socket is required")
}

Loading…
Cancel
Save