[systemd-commits] src/login

Lennart Poettering lennart at kemper.freedesktop.org
Mon Oct 1 11:50:55 PDT 2012


 src/login/pam-module.c |    8 ++++++++
 1 file changed, 8 insertions(+)

New commits:
commit a8573ccc35a4efe8900be5d48c6c803670540c2b
Author: Lennart Poettering <lennart at poettering.net>
Date:   Mon Oct 1 14:50:00 2012 -0400

    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.

diff --git a/src/login/pam-module.c b/src/login/pam-module.c
index 0d38791..af108c4 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) &&



More information about the systemd-commits mailing list