summaryrefslogtreecommitdiff
path: root/Propellor/Property/Sudo.hs
diff options
context:
space:
mode:
Diffstat (limited to 'Propellor/Property/Sudo.hs')
-rw-r--r--Propellor/Property/Sudo.hs8
1 files changed, 3 insertions, 5 deletions
diff --git a/Propellor/Property/Sudo.hs b/Propellor/Property/Sudo.hs
index dbb3e460..68b8d056 100644
--- a/Propellor/Property/Sudo.hs
+++ b/Propellor/Property/Sudo.hs
@@ -7,11 +7,8 @@ import Propellor.Property.File
import qualified Propellor.Property.Apt as Apt
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.
- -
- - TOOD: Full sudoers file format parse..
- -}
+-- | 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 :: UserName -> Property
enabledFor user = Property desc go `requires` Apt.installed ["sudo"]
where
@@ -26,6 +23,7 @@ enabledFor user = Property desc go `requires` Apt.installed ["sudo"]
sudoline True = sudobaseline ++ " NOPASSWD:ALL"
sudoline False = sudobaseline ++ " ALL"
wanted locked l
+ -- TOOD: Full sudoers file format parse..
| not (sudobaseline `isPrefixOf` l) = True
| "NOPASSWD" `isInfixOf` l = locked
| otherwise = True