Propellor.Property.Firewall: coding style

This commit is contained in:
Antoine Eiche 2015-08-13 01:21:23 +02:00 committed by Joey Hess
parent ea2fbd01fe
commit f4abc3c1cb
2 changed files with 8 additions and 7 deletions

2
debian/changelog vendored
View File

@ -1,7 +1,7 @@
propellor (2.7.1) UNRELEASED; urgency=medium propellor (2.7.1) UNRELEASED; urgency=medium
* Make sure that make is installed when bootstrapping propellor. * 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. Thanks, Antoine Eiche.
-- Joey Hess <id@joeyh.name> Wed, 12 Aug 2015 19:19:28 -0400 -- Joey Hess <id@joeyh.name> Wed, 12 Aug 2015 19:19:28 -0400

View File

@ -42,13 +42,14 @@ toIpTable r = map Param $
(toIpTableArg (ruleRules r)) ++ [ "-j" , show $ ruleTarget r ] (toIpTableArg (ruleRules r)) ++ [ "-j" , show $ ruleTarget r ]
toIpTableArg :: Rules -> [String] toIpTableArg :: Rules -> [String]
toIpTableArg Everything = [] toIpTableArg Everything = []
toIpTableArg (Proto proto) = ["-p", map toLower $ show proto] toIpTableArg (Proto proto) = ["-p", map toLower $ show proto]
toIpTableArg (DPort (Port port)) = ["--dport", show port] toIpTableArg (DPort (Port port)) = ["--dport", show port]
toIpTableArg (DPortRange (Port f, Port t)) = ["--dport", show f ++ ":" ++ show t] toIpTableArg (DPortRange
toIpTableArg (IFace iface) = ["-i", iface] (Port f, Port t)) = ["--dport", show f ++ ":" ++ show t]
toIpTableArg (Ctstate states) = ["-m", "conntrack","--ctstate", concat $ intersperse "," (map show states)] toIpTableArg (IFace iface) = ["-i", iface]
toIpTableArg (r :- r') = toIpTableArg r <> toIpTableArg r' toIpTableArg (Ctstate states) = ["-m", "conntrack","--ctstate", concat $ intersperse "," (map show states)]
toIpTableArg (r :- r') = toIpTableArg r <> toIpTableArg r'
data Rule = Rule data Rule = Rule
{ ruleChain :: Chain { ruleChain :: Chain