Commit 02302a480d98d4625f4bf9bf2807508d5f2c3120

Thomas de Grivel 2018-07-26T14:33:42

fix ssh authorized_keys

diff --git a/unix/ssh.lisp b/unix/ssh.lisp
index 1494a97..f6c3c0a 100644
--- a/unix/ssh.lisp
+++ b/unix/ssh.lisp
@@ -77,14 +77,23 @@
 
 (defmethod resource-additional-specs ((res ssh-authorized-key)
                                       (os os-unix))
+  (format t "~& PARENT RESOURCE ~S~%" *parent-resource*)
+  (format t "~& HOME ~S~%" (get-specified *parent-resource* :home))
+  (force-output)
   (let* ((user *parent-resource*)
-         (home (resource-id (get-specified user :home)))
+         (home (get-specified user :home))
          (ssh-dir (str home "/.ssh"))
-         (ak (str dot-ssh "/authorized_keys")))
+         (ak (str ssh-dir "/authorized_keys"))
+         (owner (resource-id user))
+         (gid (get-probed user :gid)))
     (with-parent-resource *host*
       (resource 'directory ssh-dir
                 :ensure :present
+                :owner owner
+                :gid gid
                 :mode #o700)
       (resource 'file ak
                 :ensure :present
+                :owner owner
+                :gid gid
                 :mode #o600))))