chiark / gitweb /
logind: ignore non-tty/non-x11 session when checking if there are other sessions...
[elogind.git] / 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;