🛂 Check for required permissions

On Linux, checks for the `CAP_NET_ADMIN` capability.
On macOS, checks for root.
This commit is contained in:
Malted 2023-06-10 17:25:08 +01:00 committed by Ben
parent 6bd8051c78
commit 40cc0ba049
7 changed files with 60 additions and 5 deletions

View file

@ -10,3 +10,9 @@ crate-type = ["lib", "staticlib"]
tokio = { version = "1.21", features = ["rt", "macros"] }
tun = { version = "0.1", path = "../tun" }
clap = { version = "4.3.2", features = ["derive"] }
[target.'cfg(target_os = "linux")'.dependencies]
caps = "0.5.5"
[target.'cfg(target_os = "macos")'.dependencies]
nix = { version = "0.26.2" }