diff options
author | Lennart Poettering <lennart@poettering.net> | 2011-06-24 23:51:49 +0200 |
---|---|---|
committer | Lennart Poettering <lennart@poettering.net> | 2011-06-24 23:51:49 +0200 |
commit | ee8545b06c2325e5dca7afd9ea8dbc35342a7768 (patch) | |
tree | 599810bf1c245215fee4369df62ae007eb78e69d /src | |
parent | a91e4e5337a46db3f0a4f1415c1b60285e5c33a3 (diff) |
pam: fix up tty if it is actually a display
Diffstat (limited to 'src')
-rw-r--r-- | src/pam-module.c | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/src/pam-module.c b/src/pam-module.c index eba59f65f2..1658348e28 100644 --- a/src/pam-module.c +++ b/src/pam-module.c @@ -382,6 +382,16 @@ _public_ PAM_EXTERN int pam_sm_open_session( remote_host = strempty(remote_host); seat = strempty(seat); + if (strchr(tty, ':')) { + /* A tty with a colon is usually an X11 display, place + * there to show up in utmp. We rearrange things and + * don't pretend that an X display was a tty */ + + if (isempty(display)) + display = tty; + tty = NULL; + } + type = !isempty(display) ? "x11" : !isempty(tty) ? "tty" : "other"; |