"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "src/firewall/core/io/zone.py" between
firewalld-1.0.1.tar.gz and firewalld-1.0.2.tar.gz

About: firewalld provides a dynamically managed firewall with support for network/firewall zones to define the trust level of network connections or interfaces.

zone.py  (firewalld-1.0.1):zone.py  (firewalld-1.0.2)
skipping to change at line 177 skipping to change at line 177
def _check_config(self, config, item, all_config): def _check_config(self, config, item, all_config):
common_check_config(self, config, item, all_config) common_check_config(self, config, item, all_config)
if item == "target": if item == "target":
if config not in ZONE_TARGETS: if config not in ZONE_TARGETS:
raise FirewallError(errors.INVALID_TARGET, config) raise FirewallError(errors.INVALID_TARGET, config)
elif item == "interfaces": elif item == "interfaces":
for interface in config: for interface in config:
if not checkInterface(interface): if not checkInterface(interface):
raise FirewallError(errors.INVALID_INTERFACE, interface) raise FirewallError(errors.INVALID_INTERFACE, interface)
if self.fw_config:
for zone in self.fw_config.get_zones():
if zone == self.name:
continue
if interface in self.fw_config.get_zone(zone).interfaces
:
raise FirewallError(errors.INVALID_INTERFACE,
"interface '{}' already bound to zone '{}'".
format(interface, zone))
elif item == "sources": elif item == "sources":
for source in config: for source in config:
if not checkIPnMask(source) and not checkIP6nMask(source) and \ if not checkIPnMask(source) and not checkIP6nMask(source) and \
not check_mac(source) and not source.startswith("ipset:"): not check_mac(source) and not source.startswith("ipset:"):
raise FirewallError(errors.INVALID_ADDR, source) raise FirewallError(errors.INVALID_ADDR, source)
if self.fw_config:
for zone in self.fw_config.get_zones():
if zone == self.name:
continue
if source in self.fw_config.get_zone(zone).sources:
raise FirewallError(errors.INVALID_ADDR,
"source '{}' already bound to zone '{}'".for
mat(source, zone))
def check_name(self, name): def check_name(self, name):
super(Zone, self).check_name(name) super(Zone, self).check_name(name)
if name.startswith('/'): if name.startswith('/'):
raise FirewallError(errors.INVALID_NAME, raise FirewallError(errors.INVALID_NAME,
"'%s' can't start with '/'" % name) "'%s' can't start with '/'" % name)
elif name.endswith('/'): elif name.endswith('/'):
raise FirewallError(errors.INVALID_NAME, raise FirewallError(errors.INVALID_NAME,
"'%s' can't end with '/'" % name) "'%s' can't end with '/'" % name)
elif name.count('/') > 1: elif name.count('/') > 1:
 End of changes. 2 change blocks. 
0 lines changed or deleted 17 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)