chiark / gitweb /
logind: ignore non-tty/non-x11 session when checking if there are other sessions...
authorLennart Poettering <lennart@poettering.net>
Mon, 14 Jan 2013 20:40:38 +0000 (21:40 +0100)
committerLennart Poettering <lennart@poettering.net>
Mon, 14 Jan 2013 20:41:41 +0000 (21:41 +0100)
https://bugzilla.redhat.com/show_bug.cgi?id=890827

src/login/logind-dbus.c

index 77a06f2ce4587a6c228ee15b2521d566f8b09f8c..d64debe51f34068ce78111490e0447c8a63b7ed3 100644 (file)
@@ -979,9 +979,12 @@ static int have_multiple_sessions(
 
         assert(m);
 
-        /* Check for other users' sessions. Greeter sessions do not count. */
+        /* Check for other users' sessions. Greeter sessions do not
+         * count, and non-login sessions do not count either. */
         HASHMAP_FOREACH(session, m->sessions, i)
-                if (session->class == SESSION_USER && session->user->uid != uid)
+                if (session->class == SESSION_USER &&
+                    (session->type == SESSION_TTY || session->type == SESSION_X11) &&
+                    session->user->uid != uid)
                         return true;
 
         return false;