chiark / gitweb /
Prep v235: Fix pam_elogind
authorSven Eden <yamakuzure@gmx.net>
Fri, 1 Sep 2017 11:22:46 +0000 (13:22 +0200)
committerSven Eden <yamakuzure@gmx.net>
Fri, 1 Sep 2017 11:22:46 +0000 (13:22 +0200)
src/basic/login-util.h
src/login/pam_elogind.c

index b01ee25c884cee292d2d826fc2c7f57a515e5018..a71ebd4ef4734a8f7779208aa2ef860095676d9b 100644 (file)
@@ -24,6 +24,8 @@
 
 bool session_id_valid(const char *id);
 
+#if 0 /// UNNEEDED by elogind
 static inline bool logind_running(void) {
         return access("/run/systemd/seats/", F_OK) >= 0;
 }
+#endif // 0
index 5300e218b8a21d652ce9a0eb48154a5367a94ce5..221badce616df567f3b773284218b928cd0ed59d 100644 (file)
@@ -234,9 +234,11 @@ _public_ PAM_EXTERN int pam_sm_open_session(
 
         assert(handle);
 
+#if 0 /// with elogind, it is always a "logind system".
         /* Make this a NOP on non-logind systems */
         if (!logind_running())
                 return PAM_SUCCESS;
+#endif // 0
 
         if (parse_argv(handle,
                        argc, argv,
@@ -249,7 +251,7 @@ _public_ PAM_EXTERN int pam_sm_open_session(
 #if 0 /// This is pam-elogind, not pam-systemd
                 pam_syslog(handle, LOG_DEBUG, "pam-systemd initializing");
 #else
-                pam_syslog(handle, LOG_DEBUG, "pam-systemd initializing");
+                pam_syslog(handle, LOG_DEBUG, "pam-elogind initializing");
 #endif // 0
 
         r = get_user_data(handle, &username, &pw);
@@ -265,7 +267,11 @@ _public_ PAM_EXTERN int pam_sm_open_session(
          * leave. */
 
         pam_get_item(handle, PAM_SERVICE, (const void**) &service);
+#if 0 /// Actually it is elogind-user with elogind.
         if (streq_ptr(service, "systemd-user")) {
+#else
+        if (streq_ptr(service, "elogind-user")) {
+#endif // 0
                 _cleanup_free_ char *rt = NULL;
 
                 if (asprintf(&rt, "/run/user/"UID_FMT, pw->pw_uid) < 0)