Propellor.Property.Firewall: coding style
This commit is contained in:
parent
ea2fbd01fe
commit
f4abc3c1cb
|
@ -1,7 +1,7 @@
|
|||
propellor (2.7.1) UNRELEASED; urgency=medium
|
||||
|
||||
* Make sure that make is installed when bootstrapping propellor.
|
||||
* Fix bug in Firewall.toIpTableArg.
|
||||
* Fix bug in Firewall's Port datatype to iptable parameter translation code.
|
||||
Thanks, Antoine Eiche.
|
||||
|
||||
-- Joey Hess <id@joeyh.name> Wed, 12 Aug 2015 19:19:28 -0400
|
||||
|
|
|
@ -42,13 +42,14 @@ toIpTable r = map Param $
|
|||
(toIpTableArg (ruleRules r)) ++ [ "-j" , show $ ruleTarget r ]
|
||||
|
||||
toIpTableArg :: Rules -> [String]
|
||||
toIpTableArg Everything = []
|
||||
toIpTableArg (Proto proto) = ["-p", map toLower $ show proto]
|
||||
toIpTableArg Everything = []
|
||||
toIpTableArg (Proto proto) = ["-p", map toLower $ show proto]
|
||||
toIpTableArg (DPort (Port port)) = ["--dport", show port]
|
||||
toIpTableArg (DPortRange (Port f, Port t)) = ["--dport", show f ++ ":" ++ show t]
|
||||
toIpTableArg (IFace iface) = ["-i", iface]
|
||||
toIpTableArg (Ctstate states) = ["-m", "conntrack","--ctstate", concat $ intersperse "," (map show states)]
|
||||
toIpTableArg (r :- r') = toIpTableArg r <> toIpTableArg r'
|
||||
toIpTableArg (DPortRange
|
||||
(Port f, Port t)) = ["--dport", show f ++ ":" ++ show t]
|
||||
toIpTableArg (IFace iface) = ["-i", iface]
|
||||
toIpTableArg (Ctstate states) = ["-m", "conntrack","--ctstate", concat $ intersperse "," (map show states)]
|
||||
toIpTableArg (r :- r') = toIpTableArg r <> toIpTableArg r'
|
||||
|
||||
data Rule = Rule
|
||||
{ ruleChain :: Chain
|
||||
|
|
Loading…
Reference in New Issue