Avril 4 years ago
parent 55b71a10dc
commit ed097b80cb
Signed by: flanchan
GPG Key ID: 284488987C31F630

@ -126,6 +126,8 @@ async fn main() -> Result<(), Box<dyn std::error::Error>> {
debug!("Logger initialised"); //TODO: Parse config first
print_stats();
debug!("{:?}",sys::user::get_users());
#[cfg(feature="watcher")]
{

@ -39,6 +39,7 @@ pub fn get_users() -> std::vec::Vec<Passwd> {
}
let _lock = MUTEX.lock().expect("poisoned");
let _end = PhantomDrop::new((), |_| endpwent());
loop {
let passwd = getpwent();
@ -55,8 +56,8 @@ pub fn get_users() -> std::vec::Vec<Passwd> {
);
users.push(Passwd{
gid: 1,
uid: 2,
gid: my_passwd.pw_gid,
uid: my_passwd.pw_uid,
home: from_cstr!(
my_passwd.pw_dir,
"User {}'s home ({}) has invalid UTF-8 characters, skipping",
@ -70,7 +71,6 @@ pub fn get_users() -> std::vec::Vec<Passwd> {
name
});
}
endpwent();
}
return users;
}

Loading…
Cancel
Save