From e9e74f28d783a052dce7edfa94d7918bb591ba7a Mon Sep 17 00:00:00 2001 From: Lennart Poettering Date: Thu, 14 Aug 2014 02:59:02 +0200 Subject: logind: add new session type "web" for PAM web clients, such as cockpit On request of Stef Walter. --- src/login/logind-user.c | 21 +++++++++++++++++---- 1 file changed, 17 insertions(+), 4 deletions(-) (limited to 'src/login/logind-user.c') diff --git a/src/login/logind-user.c b/src/login/logind-user.c index fdbccb364c..d48eca47f0 100644 --- a/src/login/logind-user.c +++ b/src/login/logind-user.c @@ -714,7 +714,7 @@ int user_kill(User *u, int signo) { } void user_elect_display(User *u) { - Session *graphical = NULL, *text = NULL, *s; + Session *graphical = NULL, *text = NULL, *other = NULL, *s; assert(u); @@ -732,22 +732,35 @@ void user_elect_display(User *u) { if (SESSION_TYPE_IS_GRAPHICAL(s->type)) graphical = s; - else + else if (s->type == SESSION_TTY) text = s; + else + other = s; } if (graphical && (!u->display || u->display->class != SESSION_USER || u->display->stopping || - !SESSION_TYPE_IS_GRAPHICAL(u->display->type))) + !SESSION_TYPE_IS_GRAPHICAL(u->display->type))) { u->display = graphical; + return; + } if (text && (!u->display || u->display->class != SESSION_USER || - u->display->stopping)) + u->display->stopping || + u->display->type != SESSION_TTY)) { u->display = text; + return; + } + + if (other && + (!u->display || + u->display->class != SESSION_USER || + u->display->stopping)) + u->display = other; } static const char* const user_state_table[_USER_STATE_MAX] = { -- cgit v1.2.3-54-g00ecf