From 32646105196ed7a687f3684b69ea544dd01d2ade Mon Sep 17 00:00:00 2001 From: Benjamin Berg Date: Thu, 23 Jan 2020 14:32:38 +0100 Subject: 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 --- libgdm/gdm-user-switching.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'libgdm') 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; -- cgit v1.2.1