From 1e4b2a4612399fd316d057457a877f6379bf4db2 Mon Sep 17 00:00:00 2001 From: Valentin Samir Date: Tue, 21 May 2013 14:24:00 +0200 Subject: [PATCH] =?UTF-8?q?[firewall4]=20Oublis=20lors=20de=20la=20cr?= =?UTF-8?q?=C3=A9ation=20de=20add=5Fports?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- gestion/gen_confs/firewall4.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/gestion/gen_confs/firewall4.py b/gestion/gen_confs/firewall4.py index d85f4252..e1b7409d 100755 --- a/gestion/gen_confs/firewall4.py +++ b/gestion/gen_confs/firewall4.py @@ -852,7 +852,7 @@ class firewall_komaz(firewall_base_routeur): port = '0%s' % port return port - def add_ports(ip, proto, sens): + def add_ports(ip, machine, proto, sens): self.add( table, chain, @@ -860,7 +860,7 @@ class firewall_komaz(firewall_base_routeur): proto, (sens=='out' and 's') or (sens == 'in' and 'd'), ip, - ','.join( format_port(port) for port in machine['portTCP%s' % sens]) + ','.join( format_port(port) for port in machine['port%s%s' % (proto.upper(), sens)]) ) ) @@ -876,13 +876,13 @@ class firewall_komaz(firewall_base_routeur): for machine in self.machines(): for ip in machine['ipHostNumber']: if 'portTCPout' in machine.attrs.keys(): - add_ports(ip,'tcp','out') + add_ports(ip, machine, 'tcp', 'out') if 'portUDPout' in machine.attrs.keys(): - add_ports(ip,'udp','out') + add_ports(ip, machine, 'udp', 'out') if 'portTCPin' in machine.attrs.keys(): - add_ports(ip,'tcp','in') + add_ports(ip, machine, 'tcp', 'in') if 'portUDPin' in machine.attrs.keys(): - add_ports(ip,'udp','in') + add_ports(ip, machine, 'udp', 'in') self.add(table, chain, '-j REJECT') print OK