summaryrefslogtreecommitdiff
path: root/src/Propellor/Property/User.hs
diff options
context:
space:
mode:
authorJoey Hess <joeyh@joeyh.name>2014-12-17 16:31:09 -0400
committerJoey Hess <joeyh@joeyh.name>2014-12-17 16:31:09 -0400
commit8cc691dc868f1f43d985fea012dc84183b70341d (patch)
treeab8485a66aa75c15e7dfdd2f00ab6011786e6b2d /src/Propellor/Property/User.hs
parentdb3f9050d6f4a098b82ae014a6a6e5e96a3067f6 (diff)
parentddeee3ceb8ef5aa94ffc0696bff085eb031309d6 (diff)
Merge branch 'joeyconfig'
Conflicts: privdata.joey/privdata.gpg
Diffstat (limited to 'src/Propellor/Property/User.hs')
-rw-r--r--src/Propellor/Property/User.hs7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/Propellor/Property/User.hs b/src/Propellor/Property/User.hs
index 549aa07f..f79ede63 100644
--- a/src/Propellor/Property/User.hs
+++ b/src/Propellor/Property/User.hs
@@ -46,8 +46,13 @@ hasPassword user = hasPassword' user hostContext
hasPassword' :: IsContext c => UserName -> c -> Property
hasPassword' user context = go `requires` shadowConfig True
where
- go = withSomePrivData [CryptPassword user, Password user] context $
+ go = withSomePrivData srcs context $
property (user ++ " has password") . setPassword
+ srcs =
+ [ PrivDataSource (CryptPassword user)
+ "a crypt(3)ed password, which can be generated by, for example: perl -e 'print crypt(shift, q{$6$}.shift)' 'somepassword' 'somesalt'"
+ , PrivDataSource (Password user) ("a password for " ++ user)
+ ]
setPassword :: (((PrivDataField, PrivData) -> Propellor Result) -> Propellor Result) -> Propellor Result
setPassword getpassword = getpassword $ go