mirror of
https://github.com/systemd/systemd-stable.git
synced 2025-02-04 17:47:03 +03:00
logind: ignore non-tty/non-x11 session when checking if there are other sessions before shutting down
https://bugzilla.redhat.com/show_bug.cgi?id=890827
This commit is contained in:
parent
aca26b5220
commit
1ca04b8797
@ -979,9 +979,12 @@ static int have_multiple_sessions(
|
||||
|
||||
assert(m);
|
||||
|
||||
/* Check for other users' sessions. Greeter sessions do not count. */
|
||||
/* Check for other users' sessions. Greeter sessions do not
|
||||
* count, and non-login sessions do not count either. */
|
||||
HASHMAP_FOREACH(session, m->sessions, i)
|
||||
if (session->class == SESSION_USER && session->user->uid != uid)
|
||||
if (session->class == SESSION_USER &&
|
||||
(session->type == SESSION_TTY || session->type == SESSION_X11) &&
|
||||
session->user->uid != uid)
|
||||
return true;
|
||||
|
||||
return false;
|
||||
|
Loading…
x
Reference in New Issue
Block a user