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

@ -45,7 +45,8 @@ 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
(Port f, Port t)) = ["--dport", show f ++ ":" ++ show t]
toIpTableArg (IFace iface) = ["-i", iface] toIpTableArg (IFace iface) = ["-i", iface]
toIpTableArg (Ctstate states) = ["-m", "conntrack","--ctstate", concat $ intersperse "," (map show states)] toIpTableArg (Ctstate states) = ["-m", "conntrack","--ctstate", concat $ intersperse "," (map show states)]
toIpTableArg (r :- r') = toIpTableArg r <> toIpTableArg r' toIpTableArg (r :- r') = toIpTableArg r <> toIpTableArg r'