[gnome-session/gnome-3-6] systemd: check for greeter by looking at class not service
- From: Ray Strode <halfline src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-session/gnome-3-6] systemd: check for greeter by looking at class not service
- Date: Tue, 16 Oct 2012 01:47:40 +0000 (UTC)
commit cbafefe942c2a2bdbcfbc1cd6a6cc1480c363f26
Author: Ray Strode <rstrode redhat com>
Date: Fri Sep 21 16:51:22 2012 -0400
systemd: check for greeter by looking at class not service
GDM calls its pam service file gdm-launch-environment not gdm-welcome,
so the current login session detection code is broken. It's fragile anyway.
A much better approach is to query if the session class is "greeter".
This commit does that.
https://bugzilla.gnome.org/show_bug.cgi?id=684585
(cherry picked from commit c8253d1094b5ede0b3f23a59b3567193c7039341)
gnome-session/gsm-systemd.c | 10 +++++-----
1 files changed, 5 insertions(+), 5 deletions(-)
---
diff --git a/gnome-session/gsm-systemd.c b/gnome-session/gsm-systemd.c
index 6844aad..a8597b2 100644
--- a/gnome-session/gsm-systemd.c
+++ b/gnome-session/gsm-systemd.c
@@ -364,7 +364,7 @@ gsm_systemd_is_login_session (GsmSystem *system)
GsmSystemd *manager = GSM_SYSTEMD (system);
int res;
gboolean ret;
- gchar *service = NULL;
+ gchar *session_class = NULL;
ret = FALSE;
@@ -372,13 +372,13 @@ gsm_systemd_is_login_session (GsmSystem *system)
return ret;
}
- res = sd_session_get_service (manager->priv->session_id, &service);
+ res = sd_session_get_class (manager->priv->session_id, &session_class);
if (res < 0) {
- g_warning ("could not get pam service: %s", strerror (-res));
+ g_warning ("could not get session class: %s", strerror (-res));
return FALSE;
}
- ret = (g_strcmp0 (service, "gdm-welcome") == 0);
- free (service);
+ ret = (g_strcmp0 (session_class, "greeter") == 0);
+ free (session_class);
return ret;
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]