diff options
author | Lennart Poettering <lennart@poettering.net> | 2012-10-01 14:50:00 -0400 |
---|---|---|
committer | Lennart Poettering <lennart@poettering.net> | 2012-10-01 14:50:05 -0400 |
commit | a8573ccc35a4efe8900be5d48c6c803670540c2b (patch) | |
tree | f2efe319d8c5d8a13a1c197c159735250adc25f9 /src | |
parent | d67227c8b963a4f5ec1472ffc5ff2f5bf04deeed (diff) |
pam: check environ[] for XDG_SEAT as fallback
This is useful for systems such as kmscon which want to invoke classic
/sbin/login but use it on multiple seats.
Diffstat (limited to 'src')
-rw-r--r-- | src/login/pam-module.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/src/login/pam-module.c b/src/login/pam-module.c index 0d387918c7..af108c46d5 100644 --- a/src/login/pam-module.c +++ b/src/login/pam-module.c @@ -428,8 +428,14 @@ _public_ PAM_EXTERN int pam_sm_open_session( pam_get_item(handle, PAM_TTY, (const void**) &tty); pam_get_item(handle, PAM_RUSER, (const void**) &remote_user); pam_get_item(handle, PAM_RHOST, (const void**) &remote_host); + seat = pam_getenv(handle, "XDG_SEAT"); + if (isempty(seat)) + seat = getenv("XDG_SEAT"); + cvtnr = pam_getenv(handle, "XDG_VTNR"); + if (isempty(cvtnr)) + cvtnr = getenv("XDG_VTNR"); service = strempty(service); tty = strempty(tty); @@ -468,6 +474,8 @@ _public_ PAM_EXTERN int pam_sm_open_session( class = pam_getenv(handle, "XDG_SESSION_CLASS"); if (isempty(class)) + class = getenv("XDG_SESSION_CLASS"); + if (isempty(class)) class = "user"; remote = !isempty(remote_host) && |