Check permissions

This commit is contained in:
Owen
2025-12-04 21:39:32 -05:00
parent 4dbf200cca
commit 6d51cbf0c0
5 changed files with 165 additions and 1 deletions

View File

@@ -0,0 +1,18 @@
//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")
}