Only listen to removal signal for own session (#182)

This commit is contained in:
Chandler Newman 2020-04-12 16:00:19 +01:00 committed by GitHub
parent f966e28fe5
commit d92aa6dafe
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 3 additions and 0 deletions

View File

@ -59,6 +59,7 @@ use calloop::{
}; };
struct LogindSessionImpl { struct LogindSessionImpl {
session_id: String,
conn: RefCell<Connection>, conn: RefCell<Connection>,
session_path: DbusPath<'static>, session_path: DbusPath<'static>,
active: AtomicBool, active: AtomicBool,
@ -171,6 +172,7 @@ impl LogindSession {
let conn = RefCell::new(conn); let conn = RefCell::new(conn);
let internal = Rc::new(LogindSessionImpl { let internal = Rc::new(LogindSessionImpl {
session_id: session_id.clone(),
conn, conn,
session_path, session_path,
active: AtomicBool::new(true), active: AtomicBool::new(true),
@ -260,6 +262,7 @@ impl LogindSessionImpl {
}; };
if &*message.interface().unwrap() == "org.freedesktop.login1.Manager" if &*message.interface().unwrap() == "org.freedesktop.login1.Manager"
&& &*message.member().unwrap() == "SessionRemoved" && &*message.member().unwrap() == "SessionRemoved"
&& message.get1::<String>().unwrap() == self.session_id
{ {
error!(self.logger, "Session got closed by logind"); error!(self.logger, "Session got closed by logind");
//Ok... now what? //Ok... now what?