summaryrefslogtreecommitdiff
path: root/src/login
diff options
context:
space:
mode:
authorPhilip Withnall <philip.withnall@collabora.co.uk>2015-06-02 14:17:10 +0100
committerSven Eden <yamakuzure@gmx.net>2017-03-14 10:01:41 +0100
commitaf750a80c7d0ae8259588f77e14e04cfce824081 (patch)
tree925f26e5cc74c13e0f18c6509b569c3b2613de3b /src/login
parent165d7d44bd29a34a0bc598314884e3204d8f753d (diff)
logind: Save the user’s state when a session enters SESSION_ACTIVE
When (for example) switching from X11 to a new VT and logging in there, creating a new session, the user state file (/run/systemd/users/$uid) is not updated after the session becomes active. The latest time it is saved is when the session is in SESSION_OPENING. This results in a /run/systemd/users/$uid file which contains STATE=online for the current user on the current active VT, which is obviously wrong. As functions like sd_uid_get_state() use this file to get the user’s state, this could result in things like PolicyKit making incorrect decisions about the user’s state. (See https://bugs.freedesktop.org/show_bug.cgi?id=76358.) Fix this by re-saving the state for a session’s user after completing the state_job for that session. https://bugs.freedesktop.org/show_bug.cgi?id=90818
Diffstat (limited to 'src/login')
-rw-r--r--src/login/logind-dbus.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/src/login/logind-dbus.c b/src/login/logind-dbus.c
index 10a9df096..b272401e5 100644
--- a/src/login/logind-dbus.c
+++ b/src/login/logind-dbus.c
@@ -2522,6 +2522,7 @@ int match_job_removed(sd_bus_message *message, void *userdata, sd_bus_error *err
session_jobs_reply(session, unit, result);
session_save(session);
+ user_save(session->user);
session_add_to_gc_queue(session);
}