diff --git a/src/firewall/core/io/ifcfg.py b/src/firewall/core/io/ifcfg.py index 0fecee74c..324f18e3c 100644 --- a/src/firewall/core/io/ifcfg.py +++ b/src/firewall/core/io/ifcfg.py @@ -81,7 +81,10 @@ def read(self): pair = [ x.strip() for x in line.split("=", 1) ] if len(pair) != 2: continue - elif pair[1] == '': + if len(pair[1]) >= 2 and \ + pair[1].startswith('"') and pair[1].endswith('"'): + pair[1] = pair[1][1:-1] + if pair[1] == '': continue elif self._config.get(pair[0]) is not None: log.warning("%s: Duplicate option definition: '%s'", self.filename, line.strip()) @@ -142,6 +145,9 @@ def write(self): continue key = p[0].strip() value = p[1].strip() + if len(value) >= 2 and \ + value.startswith('"') and value.endswith('"'): + value = value[1:-1] # check for modified key/value pairs if key not in done: if key in self._config and self._config[key] != value: