[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
01/08: services: openssh: Collect all keys for all users.
From: |
guix-commits |
Subject: |
01/08: services: openssh: Collect all keys for all users. |
Date: |
Tue, 16 Nov 2021 08:38:53 -0500 (EST) |
civodul pushed a commit to branch master
in repository guix.
commit b4b2bbf4fb74c9f3e93d64863ab9b38957494b49
Author: Vivien Kraus <vivien@planete-kraus.eu>
AuthorDate: Fri Oct 29 18:25:24 2021 +0200
services: openssh: Collect all keys for all users.
Fixes <https://issues.guix.gnu.org/51487>
* gnu/services/ssh.scm (extend-openssh-authorized-keys): ensure that no key
is forgotten.
Co-authored-by: Ludovic Courtès <ludo@gnu.org>
---
gnu/services/ssh.scm | 11 ++++++++++-
1 file changed, 10 insertions(+), 1 deletion(-)
diff --git a/gnu/services/ssh.scm b/gnu/services/ssh.scm
index a018052..e7bc610 100644
--- a/gnu/services/ssh.scm
+++ b/gnu/services/ssh.scm
@@ -39,6 +39,7 @@
#:use-module (srfi srfi-1)
#:use-module (srfi srfi-26)
#:use-module (ice-9 match)
+ #:use-module (ice-9 vlist)
#:export (lsh-configuration
lsh-configuration?
lsh-service
@@ -535,7 +536,15 @@ of user-name/file-like tuples."
(openssh-configuration
(inherit config)
(authorized-keys
- (append (openssh-authorized-keys config) keys))))
+ (match (openssh-authorized-keys config)
+ (((users _ ...) ...)
+ ;; Build a user/key-list mapping.
+ (let ((user-keys (alist->vhash (openssh-authorized-keys config))))
+ ;; Coalesce the key lists associated with each user.
+ (map (lambda (user)
+ `(,user
+ ,@(concatenate (vhash-fold* cons '() user user-keys))))
+ users)))))))
(define openssh-service-type
(service-type (name 'openssh)
- branch master updated (b2f8186 -> 9bbbac6), guix-commits, 2021/11/16
- 07/08: gnu: Add texlive-translator., guix-commits, 2021/11/16
- 01/08: services: openssh: Collect all keys for all users.,
guix-commits <=
- 03/08: daemon: Do not deduplicate files smaller than 8 KiB., guix-commits, 2021/11/16
- 05/08: home: services: bash: Emit 'extra-content' first again., guix-commits, 2021/11/16
- 08/08: gnu: Add texlive-latex-textpos., guix-commits, 2021/11/16
- 02/08: tests: Factorize 'file=?'., guix-commits, 2021/11/16
- 04/08: home: services: Fix typo., guix-commits, 2021/11/16
- 06/08: home: Adjust 'guix home import' test for shell aliases., guix-commits, 2021/11/16