275528d
From cc85d56245a21e458dbc955fbf94fa9b3bfb9e33 Mon Sep 17 00:00:00 2001
275528d
From: David Herrmann <dh.herrmann@gmail.com>
275528d
Date: Fri, 10 Jul 2015 14:53:08 +0200
275528d
Subject: [PATCH 033/261] logind: allow greeters to take over VTs
275528d
275528d
Make sure a greeter can forcefully spawn a session on a VT that is
275528d
in-use. A recent patch prevented this (this used to be possible for all
275528d
session types) as it is highly fragile. However, as it turns out,
275528d
greeters seem to rely on that feature. Therefore, make sure we allow it
275528d
explicitly for greeters.
275528d
---
275528d
 src/login/logind-dbus.c | 7 +++++--
275528d
 1 file changed, 5 insertions(+), 2 deletions(-)
275528d
275528d
diff --git a/src/login/logind-dbus.c b/src/login/logind-dbus.c
275528d
index cd9cab7..ca435df 100644
275528d
--- a/src/login/logind-dbus.c
275528d
+++ b/src/login/logind-dbus.c
275528d
@@ -699,9 +699,12 @@ static int method_create_session(sd_bus_message *message, void *userdata, sd_bus
275528d
          * after the user-session and want the user-session to take
275528d
          * over the VT. We need to support this for
275528d
          * backwards-compatibility, so make sure we allow new sessions
275528d
-         * on a VT that a greeter is running on.
275528d
+         * on a VT that a greeter is running on. Furthermore, to allow
275528d
+         * re-logins, we have to allow a greeter to take over a used VT for
275528d
+         * the exact same reasons.
275528d
          */
275528d
-        if (vtnr > 0 &&
275528d
+        if (c != SESSION_GREETER &&
275528d
+            vtnr > 0 &&
275528d
             vtnr < m->seat0->position_count &&
275528d
             m->seat0->positions[vtnr] &&
275528d
             m->seat0->positions[vtnr]->class != SESSION_GREETER)
275528d
-- 
275528d
2.4.3
275528d