From c506027af881a9e4210845a7a8a6ec5910aa0f3b Mon Sep 17 00:00:00 2001 From: David Herrmann Date: Thu, 28 Nov 2013 17:25:25 +0100 Subject: logind: require VTs on seat0 and forbid elsewhere Sessions on seat0 must pass us a vtnr, otherwise, you shouldn't try attaching it to seat0. For seats without VTs, we do the exact opposite: we forbid VTs. There can be odd situations if the session-files contain invalid combinations. However, we try to keep sessions alive and restore state as good as possible. --- src/login/logind-seat.c | 3 +++ 1 file changed, 3 insertions(+) (limited to 'src/login/logind-seat.c') diff --git a/src/login/logind-seat.c b/src/login/logind-seat.c index eac5a5f26b..b1a5ec30ef 100644 --- a/src/login/logind-seat.c +++ b/src/login/logind-seat.c @@ -408,6 +408,9 @@ int seat_attach_session(Seat *s, Session *session) { assert(session); assert(!session->seat); + if (!seat_has_vts(s) != !session->vtnr) + return -EINVAL; + session->seat = s; LIST_PREPEND(sessions_by_seat, s->sessions, session); -- cgit v1.2.3-54-g00ecf