From 55efac6cbcea0d8edda9c6820620ceb390009e7a Mon Sep 17 00:00:00 2001 From: Lennart Poettering Date: Tue, 14 Feb 2012 21:33:51 +0100 Subject: login: track login class (i.e. one of "user", "greeter", "lock-screen") for each session This introduces the new PAM environment variable XDG_SESSION_CLASS. If not set, defaults to "user". This is useful for apps that want to distuingish real user logins from "fake" ones which just exist to show a gdm login screen or a lock screen. --- src/login/logind-session.h | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'src/login/logind-session.h') diff --git a/src/login/logind-session.h b/src/login/logind-session.h index 8e394ac0d8..d0b8c87fab 100644 --- a/src/login/logind-session.h +++ b/src/login/logind-session.h @@ -38,6 +38,14 @@ typedef enum SessionType { _SESSION_TYPE_INVALID = -1 } SessionType; +typedef enum SessionClass { + SESSION_USER, + SESSION_GREETER, + SESSION_LOCK_SCREEN, + _SESSION_CLASS_MAX, + _SESSION_CLASS_INVALID = -1 +} SessionClass; + typedef enum KillWho { KILL_LEADER, KILL_ALL, @@ -50,6 +58,7 @@ struct Session { char *id; SessionType type; + SessionClass class; char *state_file; @@ -118,6 +127,9 @@ int session_send_lock(Session *s, bool lock); const char* session_type_to_string(SessionType t); SessionType session_type_from_string(const char *s); +const char* session_class_to_string(SessionClass t); +SessionClass session_class_from_string(const char *s); + const char *kill_who_to_string(KillWho k); KillWho kill_who_from_string(const char *s); -- cgit v1.2.3-54-g00ecf