cloudflare / boringtun

Userspace WireGuard® Implementation in Rust
BSD 3-Clause "New" or "Revised" License
5.93k stars 397 forks source link

device: use runtime instead of compile-time environment var for macos drop privileges #297

Closed Noah-Kennedy closed 1 year ago

Noah-Kennedy commented 1 year ago

In #231 we accidentally started using a compile-time environment environment variable instead of a runtime one for dropping privileges on macos. This causes privilege drops to fail when the user who is running the program does not have the same username as the user who compiled the program.

The solution here is to use the runtime variable instead.