From 2cae0fdb9e12b5a2e247c1f10017746d59c03721 Mon Sep 17 00:00:00 2001 From: Daniel Brooks Date: Thu, 10 Nov 2016 07:46:23 -0800 Subject: add the new shardmasters to iabak You might want to test Group.hasUser; I wasn't actually able to test it. --- src/Propellor/Property/Group.hs | 3 +++ 1 file changed, 3 insertions(+) (limited to 'src/Propellor/Property') diff --git a/src/Propellor/Property/Group.hs b/src/Propellor/Property/Group.hs index 58e49a86..30a9c665 100644 --- a/src/Propellor/Property/Group.hs +++ b/src/Propellor/Property/Group.hs @@ -12,3 +12,6 @@ exists (Group group') mgid = check test (cmdProperty "addgroup" (args mgid)) test = not . elem group' . words <$> readProcess "cut" ["-d:", "-f1", groupFile] args Nothing = [group'] args (Just gid) = ["--gid", show gid, group'] + +hasUser :: Group -> User -> Property DebianLike +hasUser (Group group') (User user) = hasGroup user group' -- cgit v1.3-2-g0d8e From ba7ecada73598674d3d2f411fe7fea05fc7843f8 Mon Sep 17 00:00:00 2001 From: Daniel Brooks Date: Thu, 10 Nov 2016 12:25:57 -0800 Subject: concinnity --- src/Propellor/Property/Group.hs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/Propellor/Property') diff --git a/src/Propellor/Property/Group.hs b/src/Propellor/Property/Group.hs index 30a9c665..b171933a 100644 --- a/src/Propellor/Property/Group.hs +++ b/src/Propellor/Property/Group.hs @@ -14,4 +14,4 @@ exists (Group group') mgid = check test (cmdProperty "addgroup" (args mgid)) args (Just gid) = ["--gid", show gid, group'] hasUser :: Group -> User -> Property DebianLike -hasUser (Group group') (User user) = hasGroup user group' +hasUser = flip hasGroup -- cgit v1.3-2-g0d8e From 16ed29570616359626552327702c8e1e358c430f Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Fri, 11 Nov 2016 14:04:18 -0400 Subject: build fixes --- joeyconfig.hs | 1 + src/Propellor/Property/Group.hs | 1 + 2 files changed, 2 insertions(+) (limited to 'src/Propellor/Property') diff --git a/joeyconfig.hs b/joeyconfig.hs index e7f9d3eb..22744ffc 100644 --- a/joeyconfig.hs +++ b/joeyconfig.hs @@ -12,6 +12,7 @@ import qualified Propellor.Property.Ssh as Ssh import qualified Propellor.Property.Cron as Cron import qualified Propellor.Property.Sudo as Sudo import qualified Propellor.Property.User as User +import qualified Propellor.Property.Group as Group import qualified Propellor.Property.Hostname as Hostname import qualified Propellor.Property.Tor as Tor import qualified Propellor.Property.Dns as Dns diff --git a/src/Propellor/Property/Group.hs b/src/Propellor/Property/Group.hs index b171933a..f47867c1 100644 --- a/src/Propellor/Property/Group.hs +++ b/src/Propellor/Property/Group.hs @@ -1,6 +1,7 @@ module Propellor.Property.Group where import Propellor.Base +import Propellor.Property.User (hasGroup) type GID = Int -- cgit v1.3-2-g0d8e