diff options
author | Lennart Poettering <lennart@poettering.net> | 2018-08-07 13:49:34 +0200 |
---|---|---|
committer | Sven Eden <sven.eden@prydeworx.com> | 2018-10-29 10:18:37 +0100 |
commit | 7c7734999ea003d756f8c0b6268bc374a1214e34 (patch) | |
tree | 0c560372db82c61d5c7f67b7b757af567c636b84 /src/login/logind-session.h | |
parent | 729a2fa913640bea3376d9afc73a9b4bff371085 (diff) |
logind: optionally watch utmp for login data
This allows us to determine the TTY an ssh session is for, which is
useful to to proper idle detection for ssh sessions.
Fixes: #9622
(cherry picked from commit 3d0ef5c7e00155bc74f6f71c34cad518a4ff56ba)
Diffstat (limited to 'src/login/logind-session.h')
-rw-r--r-- | src/login/logind-session.h | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/src/login/logind-session.h b/src/login/logind-session.h index 74cda3c57..0bca7683a 100644 --- a/src/login/logind-session.h +++ b/src/login/logind-session.h @@ -46,6 +46,14 @@ enum KillWho { _KILL_WHO_INVALID = -1 }; +typedef enum TTYValidity { + TTY_FROM_PAM, + TTY_FROM_UTMP, + TTY_UTMP_INCONSISTENT, /* may happen on ssh sessions with multiplexed TTYs */ + _TTY_VALIDITY_MAX, + _TTY_VALIDITY_INVALID = -1, +} TTYValidity; + struct Session { Manager *manager; @@ -60,8 +68,9 @@ struct Session { dual_timestamp timestamp; - char *tty; char *display; + char *tty; + TTYValidity tty_validity; bool remote; char *remote_user; @@ -162,6 +171,9 @@ SessionClass session_class_from_string(const char *s) _pure_; const char *kill_who_to_string(KillWho k) _const_; KillWho kill_who_from_string(const char *s) _pure_; +const char* tty_validity_to_string(TTYValidity t) _const_; +TTYValidity tty_validity_from_string(const char *s) _pure_; + int session_prepare_vt(Session *s); void session_restore_vt(Session *s); void session_leave_vt(Session *s); |