summaryrefslogtreecommitdiff
path: root/src/Propellor/Property/Sudo.hs
diff options
context:
space:
mode:
authorJoey Hess2016-04-02 15:33:48 -0400
committerJoey Hess2016-04-02 15:33:48 -0400
commitdce7e7bd72fa82ef7461535288b53d89db807566 (patch)
treecf97100b90cddfd988d069059222df4bb8459bc5 /src/Propellor/Property/Sudo.hs
parentbeba93baede04835687e1caeefead24f173d9048 (diff)
parent48608a48bd91743776cf3d4abb2172b806d4b917 (diff)
Merge branch 'joeyconfig'
Diffstat (limited to 'src/Propellor/Property/Sudo.hs')
-rw-r--r--src/Propellor/Property/Sudo.hs9
1 files changed, 5 insertions, 4 deletions
diff --git a/src/Propellor/Property/Sudo.hs b/src/Propellor/Property/Sudo.hs
index ed6ba2d5..45ab8af2 100644
--- a/src/Propellor/Property/Sudo.hs
+++ b/src/Propellor/Property/Sudo.hs
@@ -9,12 +9,13 @@ import Propellor.Property.User
-- | Allows a user to sudo. If the user has a password, sudo is configured
-- to require it. If not, NOPASSWORD is enabled for the user.
-enabledFor :: User -> Property NoInfo
-enabledFor user@(User u) = property desc go `requires` Apt.installed ["sudo"]
+enabledFor :: User -> Property DebianLike
+enabledFor user@(User u) = go `requires` Apt.installed ["sudo"]
where
- go = do
+ go :: Property UnixLike
+ go = property' desc $ \w -> do
locked <- liftIO $ isLockedPassword user
- ensureProperty $
+ ensureProperty w $
fileProperty desc
(modify locked . filter (wanted locked))
"/etc/sudoers"