|
|
1aae35 |
From 0317fe746acc1f14bcb64d740de813f9ca8f4e70 Mon Sep 17 00:00:00 2001
|
|
|
1aae35 |
From: Ray Strode <rstrode@redhat.com>
|
|
|
1aae35 |
Date: Wed, 23 Aug 2017 09:26:11 -0400
|
|
|
1aae35 |
Subject: [PATCH] manager: fix dangling pointer free
|
|
|
1aae35 |
|
|
|
1aae35 |
When reauthenticating, we can crash if no login screen
|
|
|
1aae35 |
is running on the seat (for instance, when building
|
|
|
1aae35 |
with --disable-user-display-server, and not user
|
|
|
1aae35 |
switching). The crash is due to a dangling
|
|
|
1aae35 |
pointer.
|
|
|
1aae35 |
|
|
|
1aae35 |
This commit fixes that.
|
|
|
1aae35 |
|
|
|
1aae35 |
https://bugzilla.gnome.org/show_bug.cgi?id=786656
|
|
|
1aae35 |
---
|
|
|
1aae35 |
daemon/gdm-manager.c | 2 +-
|
|
|
1aae35 |
1 file changed, 1 insertion(+), 1 deletion(-)
|
|
|
1aae35 |
|
|
|
1aae35 |
diff --git a/daemon/gdm-manager.c b/daemon/gdm-manager.c
|
|
|
1aae35 |
index 3eef745f..f001a36e 100644
|
|
|
1aae35 |
--- a/daemon/gdm-manager.c
|
|
|
1aae35 |
+++ b/daemon/gdm-manager.c
|
|
|
1aae35 |
@@ -2003,62 +2003,62 @@ on_user_session_died (GdmSession *session,
|
|
|
1aae35 |
static char *
|
|
|
1aae35 |
get_display_device (GdmManager *manager,
|
|
|
1aae35 |
GdmDisplay *display)
|
|
|
1aae35 |
{
|
|
|
1aae35 |
/* systemd finds the display device out on its own based on the display */
|
|
|
1aae35 |
return NULL;
|
|
|
1aae35 |
}
|
|
|
1aae35 |
|
|
|
1aae35 |
static void
|
|
|
1aae35 |
on_session_reauthenticated (GdmSession *session,
|
|
|
1aae35 |
const char *service_name,
|
|
|
1aae35 |
GdmManager *manager)
|
|
|
1aae35 |
{
|
|
|
1aae35 |
gboolean fail_if_already_switched = FALSE;
|
|
|
1aae35 |
|
|
|
1aae35 |
if (gdm_session_get_display_mode (session) == GDM_SESSION_DISPLAY_MODE_REUSE_VT) {
|
|
|
1aae35 |
const char *seat_id;
|
|
|
1aae35 |
char *session_id;
|
|
|
1aae35 |
|
|
|
1aae35 |
seat_id = gdm_session_get_display_seat_id (session);
|
|
|
1aae35 |
if (get_login_window_session_id (seat_id, &session_id)) {
|
|
|
1aae35 |
GdmDisplay *display = gdm_display_store_find (manager->priv->display_store,
|
|
|
1aae35 |
lookup_by_session_id,
|
|
|
1aae35 |
(gpointer) session_id);
|
|
|
1aae35 |
|
|
|
1aae35 |
if (display != NULL) {
|
|
|
1aae35 |
gdm_display_stop_greeter_session (display);
|
|
|
1aae35 |
gdm_display_unmanage (display);
|
|
|
1aae35 |
gdm_display_finish (display);
|
|
|
1aae35 |
}
|
|
|
1aae35 |
+ g_free (session_id);
|
|
|
1aae35 |
}
|
|
|
1aae35 |
- g_free (session_id);
|
|
|
1aae35 |
}
|
|
|
1aae35 |
|
|
|
1aae35 |
/* There should already be a session running, so jump to its
|
|
|
1aae35 |
* VT. In the event we're already on the right VT, (i.e. user
|
|
|
1aae35 |
* used an unlock screen instead of a user switched login screen),
|
|
|
1aae35 |
* then silently succeed and unlock the session.
|
|
|
1aae35 |
*/
|
|
|
1aae35 |
switch_to_compatible_user_session (manager, session, fail_if_already_switched);
|
|
|
1aae35 |
}
|
|
|
1aae35 |
|
|
|
1aae35 |
static void
|
|
|
1aae35 |
on_session_client_ready_for_session_to_start (GdmSession *session,
|
|
|
1aae35 |
const char *service_name,
|
|
|
1aae35 |
gboolean client_is_ready,
|
|
|
1aae35 |
GdmManager *manager)
|
|
|
1aae35 |
{
|
|
|
1aae35 |
gboolean waiting_to_start_user_session;
|
|
|
1aae35 |
|
|
|
1aae35 |
if (client_is_ready) {
|
|
|
1aae35 |
g_debug ("GdmManager: Will start session when ready");
|
|
|
1aae35 |
} else {
|
|
|
1aae35 |
g_debug ("GdmManager: Will start session when ready and told");
|
|
|
1aae35 |
}
|
|
|
1aae35 |
|
|
|
1aae35 |
waiting_to_start_user_session = GPOINTER_TO_INT (g_object_get_data (G_OBJECT (session),
|
|
|
1aae35 |
"waiting-to-start"));
|
|
|
1aae35 |
|
|
|
1aae35 |
g_object_set_data (G_OBJECT (session),
|
|
|
1aae35 |
"start-when-ready",
|
|
|
1aae35 |
GINT_TO_POINTER (client_is_ready));
|
|
|
1aae35 |
--
|
|
|
1aae35 |
2.14.3
|
|
|
1aae35 |
|