From f35ef9d6975710f2d77c2ea708c66500861d92d1 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Wed, 22 Apr 2015 13:04:39 -0400 Subject: API change: Added User and Group newtypes, and Properties that used to use the type UserName = String were changed to use them. Note that UserName is kept and PrivData still uses it in its sum type. This is to avoid breaking PrivData serialization. --- src/Propellor/Property/Sudo.hs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'src/Propellor/Property/Sudo.hs') diff --git a/src/Propellor/Property/Sudo.hs b/src/Propellor/Property/Sudo.hs index c183a8a3..0257f3f1 100644 --- a/src/Propellor/Property/Sudo.hs +++ b/src/Propellor/Property/Sudo.hs @@ -9,8 +9,8 @@ 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 :: UserName -> Property NoInfo -enabledFor user = property desc go `requires` Apt.installed ["sudo"] +enabledFor :: User -> Property NoInfo +enabledFor user@(User u) = property desc go `requires` Apt.installed ["sudo"] where go = do locked <- liftIO $ isLockedPassword user @@ -18,8 +18,8 @@ enabledFor user = property desc go `requires` Apt.installed ["sudo"] fileProperty desc (modify locked . filter (wanted locked)) "/etc/sudoers" - desc = user ++ " is sudoer" - sudobaseline = user ++ " ALL=(ALL:ALL)" + desc = u ++ " is sudoer" + sudobaseline = u ++ " ALL=(ALL:ALL)" sudoline True = sudobaseline ++ " NOPASSWD:ALL" sudoline False = sudobaseline ++ " ALL" wanted locked l -- cgit v1.2.3