mirror of
https://github.com/tailscale/tailscale.git
synced 2025-02-27 10:47:35 +00:00
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.
This commit is contained in:
parent
3e5c3e932c
commit
38629b62fc
@ -131,7 +131,13 @@ func main() {
|
|||||||
os.Exit(0)
|
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" {
|
if args.socketpath == "" && runtime.GOOS != "windows" {
|
||||||
|
log.SetFlags(0)
|
||||||
log.Fatalf("--socket is required")
|
log.Fatalf("--socket is required")
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user