|
|
45bd986 |
From 83c0105b2972ff68b50a24101755b5e72a11872b Mon Sep 17 00:00:00 2001
|
|
|
45bd986 |
From: Ray Strode <rstrode@redhat.com>
|
|
|
45bd986 |
Date: Tue, 20 Oct 2015 16:48:17 -0400
|
|
|
45bd986 |
Subject: [PATCH 1/3] gdm-session: emit verification-complete even for logins
|
|
|
45bd986 |
|
|
|
45bd986 |
Right now we only emit verification-complete when the a user
|
|
|
45bd986 |
successfully reauthenticates. We should also do it when they
|
|
|
45bd986 |
successfully initially authenticate.
|
|
|
45bd986 |
|
|
|
45bd986 |
This commit fixes that.
|
|
|
45bd986 |
|
|
|
45bd986 |
https://bugzilla.gnome.org/show_bug.cgi?id=754814
|
|
|
45bd986 |
---
|
|
|
45bd986 |
daemon/gdm-session.c | 15 +++++++--------
|
|
|
45bd986 |
1 file changed, 7 insertions(+), 8 deletions(-)
|
|
|
45bd986 |
|
|
|
45bd986 |
diff --git a/daemon/gdm-session.c b/daemon/gdm-session.c
|
|
|
45bd986 |
index 6faa7cd..0fedb7b 100644
|
|
|
45bd986 |
--- a/daemon/gdm-session.c
|
|
|
45bd986 |
+++ b/daemon/gdm-session.c
|
|
|
45bd986 |
@@ -280,73 +280,72 @@ on_authorize_cb (GdmDBusWorker *proxy,
|
|
|
45bd986 |
|
|
|
45bd986 |
if (worked) {
|
|
|
45bd986 |
gdm_session_accredit (self, service_name);
|
|
|
45bd986 |
} else {
|
|
|
45bd986 |
report_and_stop_conversation (self, service_name, error);
|
|
|
45bd986 |
}
|
|
|
45bd986 |
}
|
|
|
45bd986 |
|
|
|
45bd986 |
static void
|
|
|
45bd986 |
on_establish_credentials_cb (GdmDBusWorker *proxy,
|
|
|
45bd986 |
GAsyncResult *res,
|
|
|
45bd986 |
gpointer user_data)
|
|
|
45bd986 |
{
|
|
|
45bd986 |
GdmSessionConversation *conversation = user_data;
|
|
|
45bd986 |
GdmSession *self;
|
|
|
45bd986 |
char *service_name;
|
|
|
45bd986 |
|
|
|
45bd986 |
GError *error = NULL;
|
|
|
45bd986 |
gboolean worked;
|
|
|
45bd986 |
|
|
|
45bd986 |
worked = gdm_dbus_worker_call_establish_credentials_finish (proxy, res, &error);
|
|
|
45bd986 |
|
|
|
45bd986 |
if (g_error_matches (error, G_IO_ERROR, G_IO_ERROR_CLOSED) ||
|
|
|
45bd986 |
g_error_matches (error, G_IO_ERROR, G_IO_ERROR_CANCELLED))
|
|
|
45bd986 |
return;
|
|
|
45bd986 |
|
|
|
45bd986 |
self = conversation->session;
|
|
|
45bd986 |
service_name = conversation->service_name;
|
|
|
45bd986 |
|
|
|
45bd986 |
if (worked) {
|
|
|
45bd986 |
- switch (self->priv->verification_mode) {
|
|
|
45bd986 |
- case GDM_SESSION_VERIFICATION_MODE_REAUTHENTICATE:
|
|
|
45bd986 |
- if (self->priv->user_verifier_interface != NULL) {
|
|
|
45bd986 |
- gdm_dbus_user_verifier_emit_verification_complete (self->priv->user_verifier_interface,
|
|
|
45bd986 |
- service_name);
|
|
|
45bd986 |
- g_signal_emit (self, signals[VERIFICATION_COMPLETE], 0, service_name);
|
|
|
45bd986 |
- }
|
|
|
45bd986 |
- break;
|
|
|
45bd986 |
+ if (self->priv->user_verifier_interface != NULL) {
|
|
|
45bd986 |
+ gdm_dbus_user_verifier_emit_verification_complete (self->priv->user_verifier_interface,
|
|
|
45bd986 |
+ service_name);
|
|
|
45bd986 |
+ g_signal_emit (self, signals[VERIFICATION_COMPLETE], 0, service_name);
|
|
|
45bd986 |
+ }
|
|
|
45bd986 |
|
|
|
45bd986 |
+ switch (self->priv->verification_mode) {
|
|
|
45bd986 |
case GDM_SESSION_VERIFICATION_MODE_LOGIN:
|
|
|
45bd986 |
case GDM_SESSION_VERIFICATION_MODE_CHOOSER:
|
|
|
45bd986 |
gdm_session_open_session (self, service_name);
|
|
|
45bd986 |
break;
|
|
|
45bd986 |
+ case GDM_SESSION_VERIFICATION_MODE_REAUTHENTICATE:
|
|
|
45bd986 |
default:
|
|
|
45bd986 |
break;
|
|
|
45bd986 |
}
|
|
|
45bd986 |
} else {
|
|
|
45bd986 |
report_and_stop_conversation (self, service_name, error);
|
|
|
45bd986 |
}
|
|
|
45bd986 |
}
|
|
|
45bd986 |
|
|
|
45bd986 |
static const char **
|
|
|
45bd986 |
get_system_session_dirs (void)
|
|
|
45bd986 |
{
|
|
|
45bd986 |
static const char *search_dirs[] = {
|
|
|
45bd986 |
"/etc/X11/sessions/",
|
|
|
45bd986 |
DMCONFDIR "/Sessions/",
|
|
|
45bd986 |
DATADIR "/gdm/BuiltInSessions/",
|
|
|
45bd986 |
DATADIR "/xsessions/",
|
|
|
45bd986 |
#ifdef ENABLE_WAYLAND_SUPPORT
|
|
|
45bd986 |
DATADIR "/wayland-sessions/",
|
|
|
45bd986 |
#endif
|
|
|
45bd986 |
NULL
|
|
|
45bd986 |
};
|
|
|
45bd986 |
|
|
|
45bd986 |
return search_dirs;
|
|
|
45bd986 |
}
|
|
|
45bd986 |
|
|
|
45bd986 |
static gboolean
|
|
|
45bd986 |
is_prog_in_path (const char *prog)
|
|
|
45bd986 |
{
|
|
|
45bd986 |
char *f;
|
|
|
45bd986 |
gboolean ret;
|
|
|
45bd986 |
--
|
|
|
45bd986 |
2.7.0
|
|
|
45bd986 |
|
|
|
45bd986 |
|
|
|
45bd986 |
From 34a302282a323820f83e76978cd0a07b2ee0304b Mon Sep 17 00:00:00 2001
|
|
|
45bd986 |
From: Ray Strode <rstrode@redhat.com>
|
|
|
45bd986 |
Date: Fri, 22 Jan 2016 15:59:00 -0500
|
|
|
45bd986 |
Subject: [PATCH 2/3] session: keep session object alive while establishing
|
|
|
45bd986 |
credentials
|
|
|
45bd986 |
|
|
|
45bd986 |
The only reference to session objects gets cleaned up when
|
|
|
45bd986 |
verification-complete is emitted, which happens in the middle
|
|
|
45bd986 |
of the establish_credentials handler.
|
|
|
45bd986 |
|
|
|
45bd986 |
This commit makes sure the session object stays alive until the
|
|
|
45bd986 |
handler completes to prevent a crash.
|
|
|
45bd986 |
|
|
|
45bd986 |
https://bugzilla.gnome.org/show_bug.cgi?id=754814
|
|
|
45bd986 |
---
|
|
|
45bd986 |
daemon/gdm-session.c | 7 +++++--
|
|
|
45bd986 |
1 file changed, 5 insertions(+), 2 deletions(-)
|
|
|
45bd986 |
|
|
|
45bd986 |
diff --git a/daemon/gdm-session.c b/daemon/gdm-session.c
|
|
|
45bd986 |
index 0fedb7b..dbd4ba6 100644
|
|
|
45bd986 |
--- a/daemon/gdm-session.c
|
|
|
45bd986 |
+++ b/daemon/gdm-session.c
|
|
|
45bd986 |
@@ -276,82 +276,85 @@ on_authorize_cb (GdmDBusWorker *proxy,
|
|
|
45bd986 |
return;
|
|
|
45bd986 |
|
|
|
45bd986 |
self = conversation->session;
|
|
|
45bd986 |
service_name = conversation->service_name;
|
|
|
45bd986 |
|
|
|
45bd986 |
if (worked) {
|
|
|
45bd986 |
gdm_session_accredit (self, service_name);
|
|
|
45bd986 |
} else {
|
|
|
45bd986 |
report_and_stop_conversation (self, service_name, error);
|
|
|
45bd986 |
}
|
|
|
45bd986 |
}
|
|
|
45bd986 |
|
|
|
45bd986 |
static void
|
|
|
45bd986 |
on_establish_credentials_cb (GdmDBusWorker *proxy,
|
|
|
45bd986 |
GAsyncResult *res,
|
|
|
45bd986 |
gpointer user_data)
|
|
|
45bd986 |
{
|
|
|
45bd986 |
GdmSessionConversation *conversation = user_data;
|
|
|
45bd986 |
GdmSession *self;
|
|
|
45bd986 |
char *service_name;
|
|
|
45bd986 |
|
|
|
45bd986 |
GError *error = NULL;
|
|
|
45bd986 |
gboolean worked;
|
|
|
45bd986 |
|
|
|
45bd986 |
worked = gdm_dbus_worker_call_establish_credentials_finish (proxy, res, &error);
|
|
|
45bd986 |
|
|
|
45bd986 |
if (g_error_matches (error, G_IO_ERROR, G_IO_ERROR_CLOSED) ||
|
|
|
45bd986 |
g_error_matches (error, G_IO_ERROR, G_IO_ERROR_CANCELLED))
|
|
|
45bd986 |
return;
|
|
|
45bd986 |
|
|
|
45bd986 |
- self = conversation->session;
|
|
|
45bd986 |
- service_name = conversation->service_name;
|
|
|
45bd986 |
+ self = g_object_ref (conversation->session);
|
|
|
45bd986 |
+ service_name = g_strdup (conversation->service_name);
|
|
|
45bd986 |
|
|
|
45bd986 |
if (worked) {
|
|
|
45bd986 |
if (self->priv->user_verifier_interface != NULL) {
|
|
|
45bd986 |
gdm_dbus_user_verifier_emit_verification_complete (self->priv->user_verifier_interface,
|
|
|
45bd986 |
service_name);
|
|
|
45bd986 |
g_signal_emit (self, signals[VERIFICATION_COMPLETE], 0, service_name);
|
|
|
45bd986 |
}
|
|
|
45bd986 |
|
|
|
45bd986 |
switch (self->priv->verification_mode) {
|
|
|
45bd986 |
case GDM_SESSION_VERIFICATION_MODE_LOGIN:
|
|
|
45bd986 |
case GDM_SESSION_VERIFICATION_MODE_CHOOSER:
|
|
|
45bd986 |
gdm_session_open_session (self, service_name);
|
|
|
45bd986 |
break;
|
|
|
45bd986 |
case GDM_SESSION_VERIFICATION_MODE_REAUTHENTICATE:
|
|
|
45bd986 |
default:
|
|
|
45bd986 |
break;
|
|
|
45bd986 |
}
|
|
|
45bd986 |
} else {
|
|
|
45bd986 |
report_and_stop_conversation (self, service_name, error);
|
|
|
45bd986 |
}
|
|
|
45bd986 |
+
|
|
|
45bd986 |
+ g_free (service_name);
|
|
|
45bd986 |
+ g_object_unref (self);
|
|
|
45bd986 |
}
|
|
|
45bd986 |
|
|
|
45bd986 |
static const char **
|
|
|
45bd986 |
get_system_session_dirs (void)
|
|
|
45bd986 |
{
|
|
|
45bd986 |
static const char *search_dirs[] = {
|
|
|
45bd986 |
"/etc/X11/sessions/",
|
|
|
45bd986 |
DMCONFDIR "/Sessions/",
|
|
|
45bd986 |
DATADIR "/gdm/BuiltInSessions/",
|
|
|
45bd986 |
DATADIR "/xsessions/",
|
|
|
45bd986 |
#ifdef ENABLE_WAYLAND_SUPPORT
|
|
|
45bd986 |
DATADIR "/wayland-sessions/",
|
|
|
45bd986 |
#endif
|
|
|
45bd986 |
NULL
|
|
|
45bd986 |
};
|
|
|
45bd986 |
|
|
|
45bd986 |
return search_dirs;
|
|
|
45bd986 |
}
|
|
|
45bd986 |
|
|
|
45bd986 |
static gboolean
|
|
|
45bd986 |
is_prog_in_path (const char *prog)
|
|
|
45bd986 |
{
|
|
|
45bd986 |
char *f;
|
|
|
45bd986 |
gboolean ret;
|
|
|
45bd986 |
|
|
|
45bd986 |
f = g_find_program_in_path (prog);
|
|
|
45bd986 |
ret = (f != NULL);
|
|
|
45bd986 |
g_free (f);
|
|
|
45bd986 |
return ret;
|
|
|
45bd986 |
}
|
|
|
45bd986 |
--
|
|
|
45bd986 |
2.7.0
|
|
|
45bd986 |
|
|
|
45bd986 |
|
|
|
45bd986 |
From 48e264a2e3fbb5854125fc03a9ea3822abb68b94 Mon Sep 17 00:00:00 2001
|
|
|
45bd986 |
From: Ray Strode <rstrode@redhat.com>
|
|
|
45bd986 |
Date: Fri, 22 Jan 2016 16:01:20 -0500
|
|
|
45bd986 |
Subject: [PATCH 3/3] session: free conversation hash when disposing session
|
|
|
45bd986 |
|
|
|
45bd986 |
We're currently leaking the hash table when disposing the
|
|
|
45bd986 |
session, this commit fixes that.
|
|
|
45bd986 |
|
|
|
45bd986 |
https://bugzilla.gnome.org/show_bug.cgi?id=754814
|
|
|
45bd986 |
---
|
|
|
45bd986 |
daemon/gdm-session.c | 3 +++
|
|
|
45bd986 |
1 file changed, 3 insertions(+)
|
|
|
45bd986 |
|
|
|
45bd986 |
diff --git a/daemon/gdm-session.c b/daemon/gdm-session.c
|
|
|
45bd986 |
index dbd4ba6..09e6a48 100644
|
|
|
45bd986 |
--- a/daemon/gdm-session.c
|
|
|
45bd986 |
+++ b/daemon/gdm-session.c
|
|
|
45bd986 |
@@ -3296,60 +3296,63 @@ gdm_session_get_property (GObject *object,
|
|
|
45bd986 |
break;
|
|
|
45bd986 |
case PROP_DISPLAY_IS_INITIAL:
|
|
|
45bd986 |
g_value_set_boolean (value, self->priv->display_is_initial);
|
|
|
45bd986 |
break;
|
|
|
45bd986 |
case PROP_VERIFICATION_MODE:
|
|
|
45bd986 |
g_value_set_enum (value, self->priv->verification_mode);
|
|
|
45bd986 |
break;
|
|
|
45bd986 |
case PROP_ALLOWED_USER:
|
|
|
45bd986 |
g_value_set_uint (value, self->priv->allowed_user);
|
|
|
45bd986 |
break;
|
|
|
45bd986 |
case PROP_CONVERSATION_ENVIRONMENT:
|
|
|
45bd986 |
g_value_set_pointer (value, self->priv->environment);
|
|
|
45bd986 |
break;
|
|
|
45bd986 |
default:
|
|
|
45bd986 |
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
|
|
|
45bd986 |
break;
|
|
|
45bd986 |
}
|
|
|
45bd986 |
}
|
|
|
45bd986 |
|
|
|
45bd986 |
static void
|
|
|
45bd986 |
gdm_session_dispose (GObject *object)
|
|
|
45bd986 |
{
|
|
|
45bd986 |
GdmSession *self;
|
|
|
45bd986 |
|
|
|
45bd986 |
self = GDM_SESSION (object);
|
|
|
45bd986 |
|
|
|
45bd986 |
g_debug ("GdmSession: Disposing session");
|
|
|
45bd986 |
|
|
|
45bd986 |
gdm_session_close (self);
|
|
|
45bd986 |
|
|
|
45bd986 |
+ g_clear_pointer (&self->priv->conversations,
|
|
|
45bd986 |
+ g_hash_table_unref);
|
|
|
45bd986 |
+
|
|
|
45bd986 |
g_clear_object (&self->priv->user_verifier_interface);
|
|
|
45bd986 |
g_clear_object (&self->priv->greeter_interface);
|
|
|
45bd986 |
g_clear_object (&self->priv->chooser_interface);
|
|
|
45bd986 |
|
|
|
45bd986 |
g_free (self->priv->display_name);
|
|
|
45bd986 |
self->priv->display_name = NULL;
|
|
|
45bd986 |
|
|
|
45bd986 |
g_free (self->priv->display_hostname);
|
|
|
45bd986 |
self->priv->display_hostname = NULL;
|
|
|
45bd986 |
|
|
|
45bd986 |
g_free (self->priv->display_device);
|
|
|
45bd986 |
self->priv->display_device = NULL;
|
|
|
45bd986 |
|
|
|
45bd986 |
g_free (self->priv->display_seat_id);
|
|
|
45bd986 |
self->priv->display_seat_id = NULL;
|
|
|
45bd986 |
|
|
|
45bd986 |
g_free (self->priv->display_x11_authority_file);
|
|
|
45bd986 |
self->priv->display_x11_authority_file = NULL;
|
|
|
45bd986 |
|
|
|
45bd986 |
g_strfreev (self->priv->conversation_environment);
|
|
|
45bd986 |
self->priv->conversation_environment = NULL;
|
|
|
45bd986 |
|
|
|
45bd986 |
if (self->priv->worker_server != NULL) {
|
|
|
45bd986 |
g_dbus_server_stop (self->priv->worker_server);
|
|
|
45bd986 |
g_clear_object (&self->priv->worker_server);
|
|
|
45bd986 |
}
|
|
|
45bd986 |
|
|
|
45bd986 |
if (self->priv->outside_server != NULL) {
|
|
|
45bd986 |
g_dbus_server_stop (self->priv->outside_server);
|
|
|
45bd986 |
g_clear_object (&self->priv->outside_server);
|
|
|
45bd986 |
--
|
|
|
45bd986 |
2.7.0
|
|
|
45bd986 |
|