diff options
| author | Félix Sipma <felix.sipma@no-log.org> | 2016-02-04 14:09:32 +0100 |
|---|---|---|
| committer | Joey Hess <joeyh@joeyh.name> | 2016-02-25 17:19:52 -0400 |
| commit | c6fcacb6e41f678757599b00eb653b3df489f19a (patch) | |
| tree | c6b59c2db26294c67fe6ba0323b2c3aa6b51f0b4 /src/Propellor | |
| parent | 39825733d28dc9ea59386073879ba0e754c42028 (diff) | |
Firewall: minor hlint fixes
(cherry picked from commit d4653a2c4683ff3eeb4decbb3c61bb9e9cef2c64)
Diffstat (limited to 'src/Propellor')
| -rw-r--r-- | src/Propellor/Property/Firewall.hs | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/src/Propellor/Property/Firewall.hs b/src/Propellor/Property/Firewall.hs index 13db38df..2dff2953 100644 --- a/src/Propellor/Property/Firewall.hs +++ b/src/Propellor/Property/Firewall.hs @@ -33,13 +33,13 @@ rule c t rs = property ("firewall rule: " <> show r) addIpTable if exist then return NoChange else toResult <$> boolSystem "iptables" (add args) - add params = (Param "-A") : params - chk params = (Param "-C") : params + add params = Param "-A" : params + chk params = Param "-C" : params toIpTable :: Rule -> [CommandParam] toIpTable r = map Param $ - (show $ ruleChain r) : - (toIpTableArg (ruleRules r)) ++ [ "-j" , show $ ruleTarget r ] + show (ruleChain r) : + toIpTableArg (ruleRules r) ++ [ "-j" , show $ ruleTarget r ] toIpTableArg :: Rules -> [String] toIpTableArg Everything = [] @@ -52,15 +52,15 @@ toIpTableArg (OutIFace iface) = ["-o", iface] toIpTableArg (Ctstate states) = [ "-m" , "conntrack" - , "--ctstate", concat $ intersperse "," (map show states) + , "--ctstate", intercalate "," (map show states) ] toIpTableArg (Source ipwm) = [ "-s" - , concat $ intersperse "," (map fromIPWithMask ipwm) + , intercalate "," (map fromIPWithMask ipwm) ] toIpTableArg (Destination ipwm) = [ "-d" - , concat $ intersperse "," (map fromIPWithMask ipwm) + , intercalate "," (map fromIPWithMask ipwm) ] toIpTableArg (r :- r') = toIpTableArg r <> toIpTableArg r' |
