diff --git a/src/login/logind-utmp.c b/src/login/logind-utmp.c index 8f6914f725..26ebb35c64 100644 --- a/src/login/logind-utmp.c +++ b/src/login/logind-utmp.c @@ -59,6 +59,9 @@ int manager_read_utmp(Manager *m) { if (manager_get_session_by_pidref(m, &PIDREF_MAKE_FROM_PID(u->ut_pid), &s) <= 0) continue; + if (s->type != SESSION_TTY) + continue; + if (s->tty_validity == TTY_FROM_UTMP && !streq_ptr(s->tty, t)) { /* This may happen on multiplexed SSH connection (i.e. 'SSH connection sharing'). In * this case PAM and utmp sessions don't match. In such a case let's invalidate the TTY