🛂 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

12
Cargo.lock generated
View file

@ -141,7 +141,9 @@ checksum = "3c6ed94e98ecff0c12dd1b04c15ec0d7d9458ca8fe806cea6f12954efe74c63b"
name = "burrow"
version = "0.1.0"
dependencies = [
"caps",
"clap",
"nix",
"tokio",
"tun",
]
@ -179,6 +181,16 @@ dependencies = [
"pkg-config",
]
[[package]]
name = "caps"
version = "0.5.5"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "190baaad529bcfbde9e1a19022c42781bdb6ff9de25721abdb8fd98c0807730b"
dependencies = [
"libc",
"thiserror",
]
[[package]]
name = "cc"
version = "1.0.79"