d9fb4f7
From 59f883f28a4b176cb821e4ee2aaec4f024e22213 Mon Sep 17 00:00:00 2001
d9fb4f7
From: Ray Strode <rstrode@redhat.com>
d9fb4f7
Date: Mon, 9 Apr 2012 14:01:22 -0400
d9fb4f7
Subject: [PATCH] Only strip CK goo from seat prefix, if there's CK goo in
d9fb4f7
 seat prefix
d9fb4f7
d9fb4f7
Now that we can use logind for seat management, there' may not be
d9fb4f7
/org/freedesktop/ConsoleKit in the seat identifier.
d9fb4f7
d9fb4f7
This commit makes sure the GDM_SEAT_ID environment variable doesn't
d9fb4f7
show gunk in the case the system is configured to use logind.
d9fb4f7
d9fb4f7
Related downstream report:
d9fb4f7
d9fb4f7
http://bugzilla.redhat.com/810451
d9fb4f7
---
d9fb4f7
 daemon/gdm-welcome-session.c |    5 +++--
d9fb4f7
 1 file changed, 3 insertions(+), 2 deletions(-)
d9fb4f7
d9fb4f7
diff --git a/daemon/gdm-welcome-session.c b/daemon/gdm-welcome-session.c
d9fb4f7
index 01df365..d0ca4e6 100644
d9fb4f7
--- a/daemon/gdm-welcome-session.c
d9fb4f7
+++ b/daemon/gdm-welcome-session.c
d9fb4f7
@@ -308,8 +308,9 @@ build_welcome_environment (GdmWelcomeSession *welcome_session,
d9fb4f7
         if (start_session && welcome_session->priv->x11_display_seat_id != NULL) {
d9fb4f7
                 char *seat_id;
d9fb4f7
d9fb4f7
-                seat_id = welcome_session->priv->x11_display_seat_id +
d9fb4f7
-                        strlen ("/org/freedesktop/ConsoleKit/");
d9fb4f7
+                if (g_str_has_prefix (welcome_session->priv->x11_display_seat_id, "/org/freedesktop/ConsoleKit/")) {
d9fb4f7
+                        seat_id = welcome_session->priv->x11_display_seat_id + strlen ("/org/freedesktop/ConsoleKit/");
d9fb4f7
+                }
d9fb4f7
d9fb4f7
                 g_hash_table_insert (hash, g_strdup ("GDM_SEAT_ID"), g_strdup (seat_id));
d9fb4f7
         }
d9fb4f7
--
d9fb4f7
1.7.9.3
750f020
From 4df3dea6b59445be769ae16fef6d206695190b7a Mon Sep 17 00:00:00 2001
750f020
From: Ray Strode <rstrode@redhat.com>
750f020
Date: Mon, 9 Apr 2012 15:40:48 -0400
750f020
Subject: [PATCH] welcome: more seat_id fixes
750f020
750f020
Two commits ago I tried to only strip the consolekit prefix
750f020
off the seat id, if there was a consolekit prefix.  In the
750f020
process I ended up not initializing the seat_id variable
750f020
at all in the non-consolekit case.
750f020
750f020
This commit fixes that.
750f020
---
750f020
 daemon/gdm-welcome-session.c |    5 +++--
750f020
 1 file changed, 3 insertions(+), 2 deletions(-)
750f020
750f020
diff --git a/daemon/gdm-welcome-session.c b/daemon/gdm-welcome-session.c
750f020
index d0ca4e6..778d5dc 100644
750f020
--- a/daemon/gdm-welcome-session.c
750f020
+++ b/daemon/gdm-welcome-session.c
750f020
@@ -308,8 +308,9 @@ build_welcome_environment (GdmWelcomeSession *welcome_session,
750f020
         if (start_session && welcome_session->priv->x11_display_seat_id != NULL) {
750f020
                 char *seat_id;
750f020
 
750f020
-                if (g_str_has_prefix (welcome_session->priv->x11_display_seat_id, "/org/freedesktop/ConsoleKit/")) {
750f020
-                        seat_id = welcome_session->priv->x11_display_seat_id + strlen ("/org/freedesktop/ConsoleKit/");
750f020
+                seat_id = welcome_session->priv->x11_display_seat_id;
750f020
+                if (g_str_has_prefix (seat_id, "/org/freedesktop/ConsoleKit/")) {
750f020
+                        seat_id += strlen ("/org/freedesktop/ConsoleKit/");
750f020
                 }
750f020
 
750f020
                 g_hash_table_insert (hash, g_strdup ("GDM_SEAT_ID"), g_strdup (seat_id));
750f020
-- 
750f020
1.7.9.3
750f020