summaryrefslogtreecommitdiff
path: root/libgdm
diff options
context:
space:
mode:
authorBenjamin Berg <bberg@redhat.com>2020-01-23 14:32:38 +0100
committerBenjamin Berg <benjamin@sipsolutions.net>2020-04-22 18:23:38 +0000
commit32646105196ed7a687f3684b69ea544dd01d2ade (patch)
tree533efaf263b7447174f1ffa4d380b16994d18815 /libgdm
parent2090685406c775d734d57b40f84bd0876a9e829e (diff)
downloadgdm-32646105196ed7a687f3684b69ea544dd01d2ade.tar.gz
manager: Try looking up session based on PID first
Unfortunately, GDM may be running multiple greeters, and each greeter is currently using the same user. So while in a lot of setups each user should only have one graphical session and also only one DBus session bus, this is not true for the gdm greeter. Lacking another solution (e.g. separate users), we need to be able to correctly lookup the session information for all greeter instances. We can do so by using sd_pid_get_session and using this information is safe if it does return something. See: #526
Diffstat (limited to 'libgdm')
-rw-r--r--libgdm/gdm-user-switching.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/libgdm/gdm-user-switching.c b/libgdm/gdm-user-switching.c
index 3a33fcbb..20235fd8 100644
--- a/libgdm/gdm-user-switching.c
+++ b/libgdm/gdm-user-switching.c
@@ -203,7 +203,7 @@ goto_login_session (GDBusConnection *connection,
/* Note that we mostly use free () here, instead of g_free ()
* since the data allocated is from libsystemd-logind, which
* does not use GLib's g_malloc (). */
- if (!gdm_find_display_session_for_uid (getuid (), &our_session, &local_error)) {
+ if (!gdm_find_display_session (0, getuid (), &our_session, &local_error)) {
g_propagate_prefixed_error (error, local_error, _("Could not identify the current session: "));
return FALSE;