services: openssh: Fix computation of the authorized-key directory.

Fixes a bug introduced in 1f29ed4a81,
whereby 'authorized-key-directory' would end up creating empty files for
authorized keys passed as an extension.

See <https://issues.guix.gnu.org/55359>.

* gnu/services/ssh.scm (extend-openssh-authorized-keys): Call
'alist->vhash' on the alist resulting from the 'append' call.
This commit is contained in:
Ludovic Courtès 2022-05-26 16:38:51 +02:00
parent 2b8d715da5
commit 0dc63ce519
No known key found for this signature in database
GPG key ID: 090B11993D9AEBB5

View file

@ -572,10 +572,9 @@ (define (extend-openssh-authorized-keys config keys)
(inherit config)
(authorized-keys
(match (append (openssh-configuration-authorized-keys config) keys)
(((users _ ...) ...)
((and alist ((users _ ...) ...))
;; Build a user/key-list mapping.
(let ((user-keys (alist->vhash
(openssh-configuration-authorized-keys config))))
(let ((user-keys (alist->vhash alist)))
;; Coalesce the key lists associated with each user.
(map (lambda (user)
`(,user