summaryrefslogtreecommitdiff
path: root/src/Propellor/Property/Ssh.hs
diff options
context:
space:
mode:
authorJoey Hess2015-10-16 19:23:00 -0400
committerJoey Hess2015-10-16 19:23:00 -0400
commit2815e00bf87b3a2743b32110a36930c649eab569 (patch)
tree35c4a0ddcfc8f43045f1df5d171a429637d4e036 /src/Propellor/Property/Ssh.hs
parent09ee4073f28f6453ec78b2b2b02dd1fd23da33b2 (diff)
propellor spin
Diffstat (limited to 'src/Propellor/Property/Ssh.hs')
-rw-r--r--src/Propellor/Property/Ssh.hs12
1 files changed, 7 insertions, 5 deletions
diff --git a/src/Propellor/Property/Ssh.hs b/src/Propellor/Property/Ssh.hs
index 61a1fb23..fc3e0d10 100644
--- a/src/Propellor/Property/Ssh.hs
+++ b/src/Propellor/Property/Ssh.hs
@@ -279,7 +279,7 @@ userKeyAt dest user@(User u) context (keytype, pubkeytext) =
install File.hasContentProtected "" . privDataLines
install writer ext key = do
f <- liftIO $ keyfile ext
- ensureProperties
+ ensureProperty $ combineProperties desc
[ writer f (keyFileContent key)
, File.ownerGroup f user (userGroup user)
, File.ownerGroup (takeDirectory f) user (userGroup user)
@@ -339,13 +339,15 @@ localuser@(User ln) `authorizedKeysFrom` (remoteuser@(User rn), remotehost) =
-- This removes any other lines from the file.
authorizedKeys :: IsContext c => User -> c -> Property HasInfo
authorizedKeys user@(User u) context = withPrivData (SshAuthorizedKeys u) context $ \get ->
- property (u ++ " has authorized_keys") $ get $ \v -> do
+ property desc $ get $ \v -> do
f <- liftIO $ dotFile "authorized_keys" user
- ensureProperties
+ ensureProperty $ combineProperties desc
[ File.hasContentProtected f (keyFileContent (privDataLines v))
, File.ownerGroup f user (userGroup user)
, File.ownerGroup (takeDirectory f) user (userGroup user)
- ]
+ ]
+ where
+ desc = u ++ " has authorized_keys"
-- | Ensures that a user's authorized_keys contains a line.
-- Any other lines in the file are preserved as-is.
@@ -360,4 +362,4 @@ authorizedKey user@(User u) l = property desc $ do
, File.ownerGroup (takeDirectory f) user (userGroup user)
]
where
- desc = u ++ " has autorized_keys"
+ desc = u ++ " has authorized_keys"