diff options
-rwxr-xr-x | where-rs/Cargo.toml | 2 | ||||
-rwxr-xr-x | whered/Cargo.toml | 2 | ||||
-rwxr-xr-x | whrd/Cargo.toml | 2 | ||||
-rwxr-xr-x | whrd/src/lib.rs | 8 |
4 files changed, 10 insertions, 4 deletions
diff --git a/where-rs/Cargo.toml b/where-rs/Cargo.toml index 62bf873..9f4aeaf 100755 --- a/where-rs/Cargo.toml +++ b/where-rs/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "where-rs" -version = "1.0.0" +version = "1.1.0" edition = "2021" description = "A small Rust client for the WHRD/UDP protocol, to access a list of logged in users on multiple systems at once." authors = ["Starscouts", "ryze132"] diff --git a/whered/Cargo.toml b/whered/Cargo.toml index 22a9f62..f29949c 100755 --- a/whered/Cargo.toml +++ b/whered/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "whered" -version = "1.0.0" +version = "1.1.0" edition = "2021" description = "A small Rust server for the WHRD/UDP protocol, to access a list of logged in users on multiple systems at once." authors = ["Starscouts", "ryze132"] diff --git a/whrd/Cargo.toml b/whrd/Cargo.toml index e1855a3..d1602a8 100755 --- a/whrd/Cargo.toml +++ b/whrd/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "whrd" -version = "1.0.0" +version = "1.1.0" edition = "2021" description = "A Rust library to work with the WHRD/UDP protocol, a protocol to access a list of logged in users on multiple systems at once." authors = ["Starscouts", "ryze132"] diff --git a/whrd/src/lib.rs b/whrd/src/lib.rs index 8ff483d..fb45f74 100755 --- a/whrd/src/lib.rs +++ b/whrd/src/lib.rs @@ -1,4 +1,5 @@ use std::io::Cursor; +use std::path::PathBuf; use coreutils_core::os::utmpx::*; use crate::error::{WhereResult, EncodeDecodeResult, EncodeDecodeError}; @@ -192,7 +193,12 @@ impl From<Utmpx> for Session { } else { Some(host) }; - let active = utmpx.entry_type() == UtmpxKind::UserProcess; + + // Work around a bug in Utmpx causing killed sessions to show as + // active when they are not. + let mut path = PathBuf::from("/dev"); + path.push(utmpx.device_name().to_string()); + let active = utmpx.entry_type() == UtmpxKind::UserProcess && path.exists(); let login_time = utmpx.timeval().tv_sec; Self { |