diff options
| author | Joey Hess <id@joeyh.name> | 2014-12-04 17:11:15 -0400 |
|---|---|---|
| committer | Joey Hess <id@joeyh.name> | 2014-12-04 17:11:15 -0400 |
| commit | f1fd75c9ecee5f398a25488c73a541d4135887da (patch) | |
| tree | 9801546d9d8960e7019c9cdc05624189bb5f2353 /src/Propellor/Property/User.hs | |
| parent | f78c2f16d1c93ee6fe2620916b7584d91d116723 (diff) | |
more work on OS takeover
Diffstat (limited to 'src/Propellor/Property/User.hs')
| -rw-r--r-- | src/Propellor/Property/User.hs | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/src/Propellor/Property/User.hs b/src/Propellor/Property/User.hs index 434a92a3..ccb69b24 100644 --- a/src/Propellor/Property/User.hs +++ b/src/Propellor/Property/User.hs @@ -84,3 +84,15 @@ hasGroup user group' = check test $ cmdProperty "adduser" `describe` unwords ["user", user, "in group", group'] where test = not . elem group' . words <$> readProcess "groups" [user] + +-- | Controls whether shadow passwords are enabled or not. +shadowConfig :: Bool -> Property +shadowConfig True = check (not <$> shadowExists) $ + cmdProperty "shadowconfig" ["on"] + `describe` "shadow passwords enabled" +shadowConfig False = check shadowExists $ + cmdProperty "shadowconfig" ["off"] + `describe` "shadow passwords disabled" + +shadowExists :: IO Bool +shadowExists = doesFileExist "/etc/shadow" |
