mirror of
https://github.com/fosrl/newt.git
synced 2026-02-08 05:56:40 +00:00
19 lines
419 B
Go
19 lines
419 B
Go
//go:build darwin
|
|
|
|
package permissions
|
|
|
|
import (
|
|
"fmt"
|
|
"os"
|
|
)
|
|
|
|
// CheckNativeInterfacePermissions checks if the process has sufficient
|
|
// permissions to create a native TUN interface on macOS.
|
|
// This typically requires root privileges.
|
|
func CheckNativeInterfacePermissions() error {
|
|
if os.Geteuid() == 0 {
|
|
return nil
|
|
}
|
|
return fmt.Errorf("insufficient permissions: need root to create TUN interface on macOS")
|
|
}
|