all messages for Guix-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Andy Wingo <wingo@pobox.com>
To: guix-devel@gnu.org
Subject: [PATCH v2 3/7] gnu: Allow OS configurations to add PAM session modules
Date: Tue, 18 Aug 2015 10:22:16 +0200	[thread overview]
Message-ID: <cf1bad9ef9ae8f18951796fe96b33384a789dcc5.1440062095.git.wingo@pobox.com> (raw)
In-Reply-To: <95cd06d0b1639449fffa2ded823e54d0f26afbb6.1440062095.git.wingo@pobox.com>

* gnu/services/base.scm (mingetty-service):
* gnu/services/xorg.scm (slim-service):
* gnu/services/ssh.scm (lsh-service):
* gnu/system/linux.scm (unix-pam-service, base-pam-services): Add
  #:additional-session-modules keyword argument.
---
 gnu/services/base.scm |  6 ++++--
 gnu/services/ssh.scm  |  6 ++++--
 gnu/services/xorg.scm |  6 ++++--
 gnu/system/linux.scm  | 27 ++++++++++++++++-----------
 4 files changed, 28 insertions(+), 17 deletions(-)

diff --git a/gnu/services/base.scm b/gnu/services/base.scm
index 888e446..60dc93b 100644
--- a/gnu/services/base.scm
+++ b/gnu/services/base.scm
@@ -364,7 +364,8 @@ stopped before 'kill' is called."
                            ;; Allow empty passwords by default so that
                            ;; first-time users can log in when the 'root'
                            ;; account has just been created.
-                           (allow-empty-passwords? #t))
+                           (allow-empty-passwords? #t)
+                           (additional-session-modules '()))
   "Return a service to run mingetty on @var{tty}.
 
 When @var{allow-empty-passwords?} is true, allow empty log-in password.  When
@@ -416,7 +417,8 @@ the ``message of the day''."
        ;; duplicates are removed.
        (list (unix-pam-service "login"
                                #:allow-empty-passwords? allow-empty-passwords?
-                               #:motd motd)))))))
+                               #:motd motd
+                               #:additional-session-modules additional-session-modules)))))))
 
 (define-record-type* <nscd-configuration> nscd-configuration
   make-nscd-configuration
diff --git a/gnu/services/ssh.scm b/gnu/services/ssh.scm
index e2f8542..15e4052 100644
--- a/gnu/services/ssh.scm
+++ b/gnu/services/ssh.scm
@@ -86,7 +86,8 @@
                       (tcp/ip-forwarding? #t)
                       (password-authentication? #t)
                       (public-key-authentication? #t)
-                      (initialize? #t))
+                      (initialize? #t)
+                      (additional-session-modules '()))
   "Run the @command{lshd} program from @var{lsh} to listen on port @var{port-number}.
 @var{host-key} must designate a file containing the host key, and readable
 only by root.
@@ -162,7 +163,8 @@ The other options should be self-descriptive."
              (pam-services
               (list (unix-pam-service
                      "lshd"
-                     #:allow-empty-passwords? allow-empty-passwords?)))
+                     #:allow-empty-passwords? allow-empty-passwords?
+                     #:additional-session-modules additional-session-modules)))
              (activate #~(begin
                            (use-modules (guix build utils))
                            (mkdir-p "/var/spool/lsh")
diff --git a/gnu/services/xorg.scm b/gnu/services/xorg.scm
index 9ee8817..71bbb32 100644
--- a/gnu/services/xorg.scm
+++ b/gnu/services/xorg.scm
@@ -224,7 +224,8 @@ which should be passed to this script as the first argument.  If not, the
                        (xauth xauth) (dmd dmd) (bash bash)
                        (auto-login-session #~(string-append #$windowmaker
                                                             "/bin/wmaker"))
-                       startx)
+                       startx
+                       (additional-session-modules '()))
   "Return a service that spawns the SLiM graphical login manager, which in
 turn starts the X display server with @var{startx}, a command as returned by
 @code{xorg-start-command}.
@@ -305,6 +306,7 @@ reboot_cmd " dmd "/sbin/reboot
        ;; Tell PAM about 'slim'.
        (list (unix-pam-service
               "slim"
-              #:allow-empty-passwords? allow-empty-passwords?)))))))
+              #:allow-empty-passwords? allow-empty-passwords?
+              #:additional-session-modules additional-session-modules)))))))
 
 ;;; xorg.scm ends here
diff --git a/gnu/system/linux.scm b/gnu/system/linux.scm
index aaaa8c6..d6a9959 100644
--- a/gnu/system/linux.scm
+++ b/gnu/system/linux.scm
@@ -133,7 +133,8 @@ dumped in /etc/pam.d/NAME, where NAME is the name of SERVICE."
   (let ((unix (pam-entry
                (control "required")
                (module "pam_unix.so"))))
-    (lambda* (name #:key allow-empty-passwords? motd)
+    (lambda* (name #:key allow-empty-passwords? motd
+                   (additional-session-modules '()))
       "Return a standard Unix-style PAM service for NAME.  When
 ALLOW-EMPTY-PASSWORDS? is true, allow empty passwords.  When MOTD is true, it
 should be the name of a file used as the message-of-the-day."
@@ -149,14 +150,16 @@ should be the name of a file used as the message-of-the-day."
                           (arguments '("nullok")))
                          unix)))
          (password (list unix))
-         (session (if motd
-                      (list unix
-                            (pam-entry
-                             (control "optional")
-                             (module "pam_motd.so")
-                             (arguments
-                              (list #~(string-append "motd=" #$motd)))))
-                      (list unix))))))))
+         (session (append
+                   (if motd
+                       (list unix
+                             (pam-entry
+                              (control "optional")
+                              (module "pam_motd.so")
+                              (arguments
+                               (list #~(string-append "motd=" #$motd)))))
+                       (list unix))
+                   additional-session-modules)))))))
 
 (define (rootok-pam-service command)
   "Return a PAM service for COMMAND such that 'root' does not need to
@@ -173,14 +176,16 @@ authenticate to run COMMAND."
      (password (list unix))
      (session (list unix)))))
 
-(define* (base-pam-services #:key allow-empty-passwords?)
+(define* (base-pam-services #:key allow-empty-passwords?
+                            (additional-session-modules '()))
   "Return the list of basic PAM services everyone would want."
   ;; TODO: Add other Shadow programs?
   (append (list %pam-other-services)
 
           ;; These programs are setuid-root.
           (map (cut unix-pam-service <>
-                    #:allow-empty-passwords? allow-empty-passwords?)
+                    #:allow-empty-passwords? allow-empty-passwords?
+                    #:additional-session-modules additional-session-modules)
                '("su" "passwd" "sudo"
                  "xlock" "xscreensaver"))
 
-- 
2.4.3

  parent reply	other threads:[~2015-08-20  9:20 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-08-18  8:03 [PATCH v2 1/7] guix: git: Support shallow git clones if a tag is available Andy Wingo
2015-08-18  8:05 ` [PATCH v2 2/7] gnu: elogind: Update to version 219.5 Andy Wingo
2015-08-25 14:46   ` Ludovic Courtès
2015-08-18  8:22 ` Andy Wingo [this message]
2015-08-25 14:55   ` [PATCH v2 3/7] gnu: Allow OS configurations to add PAM session modules Ludovic Courtès
2015-08-25 16:00     ` Andy Wingo
2015-08-25 21:39       ` Ludovic Courtès
2015-08-26  7:21         ` Andy Wingo
2015-08-26  7:36           ` 宋文武
2015-08-28  9:04           ` Ludovic Courtès
2015-08-18  9:39 ` [PATCH v2 4/7] gnu: polkit: Use elogind for seat management Andy Wingo
2015-08-25 14:56   ` Ludovic Courtès
2015-08-25 16:00     ` Andy Wingo
2015-08-18  9:54 ` [PATCH v2 5/7] gnu: colord: Add libcap input Andy Wingo
2015-08-25 15:03   ` Ludovic Courtès
2015-08-25 16:01     ` Andy Wingo
2015-08-25 21:40       ` Ludovic Courtès
2015-08-18  9:56 ` [PATCH v2 6/7] gnu: Add elogind service Andy Wingo
2015-08-25 15:04   ` Ludovic Courtès
2015-08-18  9:57 ` [PATCH v2 7/7] gnu: Add polkit service Andy Wingo
2015-08-25 15:05   ` Ludovic Courtès

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=cf1bad9ef9ae8f18951796fe96b33384a789dcc5.1440062095.git.wingo@pobox.com \
    --to=wingo@pobox.com \
    --cc=guix-devel@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/guix.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.