We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent d9b04c5 commit f1e4c85Copy full SHA for f1e4c85
src/shadow.rs
@@ -101,6 +101,13 @@ impl From<&libc::spwd> for Shadow {
101
102
impl Shadow {
103
/// Gets a [`Shadow`] entry for the given username, or returns [`None`].
104
+ ///
105
+ /// # Safety
106
+ /// Care should be taken when this function is used in different threads
107
+ /// without synchronization. This is because the underlying function used
108
+ /// ([`getspnam()`][1]) is not thread safe.
109
110
+ /// [1]: http://man7.org/linux/man-pages/man3/shadow.3.html
111
pub fn from_name(user: &str) -> Option<Shadow> {
112
let c_user = CString::new(user).unwrap();
113
0 commit comments