[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
03/03: services: elogind: Extend PAM to use 'pam_elogind.so'.
From: |
Ludovic Courtès |
Subject: |
03/03: services: elogind: Extend PAM to use 'pam_elogind.so'. |
Date: |
Sat, 06 Feb 2016 11:02:09 +0000 |
civodul pushed a commit to branch master
in repository guix.
commit e7ad0d586251383a4c8b00222e8dec61d491f03b
Author: Ludovic Courtès <address@hidden>
Date: Sat Feb 6 11:57:54 2016 +0100
services: elogind: Extend PAM to use 'pam_elogind.so'.
Thanks to Andy Wingo <address@hidden> for explaining this at
<https://lists.gnu.org/archive/html/guix-devel/2015-08/msg00439.html>.
* gnu/services/desktop.scm (pam-extension-procedure): New procedure.
(elogind-service-type): Extend PAM-ROOT-SERVICE-TYPE.
---
gnu/services/desktop.scm | 21 +++++++++++++++++++--
1 files changed, 19 insertions(+), 2 deletions(-)
diff --git a/gnu/services/desktop.scm b/gnu/services/desktop.scm
index 36e336f..e4f0736 100644
--- a/gnu/services/desktop.scm
+++ b/gnu/services/desktop.scm
@@ -664,6 +664,22 @@ include the @command{udisksctl} command, part of UDisks,
and GNOME Disks."
(list (string-append "ELOGIND_CONF_FILE="
#$config-file))))
(stop #~(make-kill-destructor))))))
+(define (pam-extension-procedure config)
+ "Return an extension for PAM-ROOT-SERVICE-TYPE that ensures that all the PAM
+services use 'pam_elogind.so', a module that allows elogind to keep track of
+logged-in users (run 'loginctl' to see elogind's world view of users and
+seats.)"
+ (define pam-elogind
+ (pam-entry
+ (control "required")
+ (module #~(string-append #$(elogind-package config)
+ "/lib/security/pam_elogind.so"))))
+
+ (list (lambda (pam)
+ (pam-service
+ (inherit pam)
+ (session (cons pam-elogind (pam-service-session pam)))))))
+
(define elogind-service-type
(service-type (name 'elogind)
(extensions
@@ -680,8 +696,9 @@ include the @command{udisksctl} command, part of UDisks,
and GNOME Disks."
(service-extension profile-service-type
(compose list elogind-package))
- ;; TODO: Extend PAM with pam_elogind.so.
- ))))
+ ;; Extend PAM with pam_elogind.so.
+ (service-extension pam-root-service-type
+ pam-extension-procedure)))))
(define* (elogind-service #:key (config (elogind-configuration)))
"Return a service that runs the @command{elogind} login and seat management