diff options
author | Lennart Poettering <lennart@poettering.net> | 2012-02-14 21:33:51 +0100 |
---|---|---|
committer | Lennart Poettering <lennart@poettering.net> | 2012-02-14 21:37:49 +0100 |
commit | 55efac6cbcea0d8edda9c6820620ceb390009e7a (patch) | |
tree | 4cd4a938607d1ee6b8fd20e40d49d441bf134117 /src/login/loginctl.c | |
parent | 6edd7ca1624f89c9a36067b721a0280e748acb17 (diff) |
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.
Diffstat (limited to 'src/login/loginctl.c')
-rw-r--r-- | src/login/loginctl.c | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/src/login/loginctl.c b/src/login/loginctl.c index 7e0056c589..30e97e352a 100644 --- a/src/login/loginctl.c +++ b/src/login/loginctl.c @@ -349,6 +349,7 @@ typedef struct SessionStatusInfo { const char *service; pid_t leader; const char *type; + const char *class; bool active; } SessionStatusInfo; @@ -431,10 +432,19 @@ static void print_session_status_info(SessionStatusInfo *i) { if (i->type) printf("; type %s", i->type); + if (i->class) + printf("; class %s", i->class); + printf("\n"); - } else if (i->type) + } else if (i->type) { printf("\t Type: %s\n", i->type); + if (i->class) + printf("; class %s", i->class); + } else if (i->class) + printf("\t Class: %s\n", i->class); + + printf("\t Active: %s\n", yes_no(i->active)); if (i->control_group) { @@ -571,6 +581,8 @@ static int status_property_session(const char *name, DBusMessageIter *iter, Sess i->service = s; else if (streq(name, "Type")) i->type = s; + else if (streq(name, "Class")) + i->class = s; } break; } |