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

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

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

Loading…
Cancel
Save