ogham / rust-users

Library for Unix users and groups in Rust.
https://crates.io/crates/users
MIT License
99 stars 37 forks source link

Problems with switch_user_group when multi-threaded #47

Open ChrisGreenaway opened 3 years ago

ChrisGreenaway commented 3 years ago

If one thread calls switch_user_group and gets a guard, a simple assumption about the API would be that the user / group will be set to the values given in the switch_user_group call whilst the guard is in scope. However, that's not true because another thread could call switch_user_group.