diff options
| author | Joey Hess <joeyh@joeyh.name> | 2014-12-14 16:14:05 -0400 |
|---|---|---|
| committer | Joey Hess <joeyh@joeyh.name> | 2014-12-14 16:14:05 -0400 |
| commit | 23399416f1ba89894f65f61b436c2b0f8378e6c5 (patch) | |
| tree | 161b0d4bcf18cd7fb9bf58a7a7089b868dad2777 /src/Propellor/Property/User.hs | |
| parent | 71723ca09f369ccf96462cef1e0200e1615677d1 (diff) | |
broke up big function to describe PrivDataField
Diffstat (limited to 'src/Propellor/Property/User.hs')
| -rw-r--r-- | src/Propellor/Property/User.hs | 7 |
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 |
