Commit 29dee257 authored by anonym's avatar anonym
Browse files

tor-controlport-filter: deal with bad YAML.

parent cad3d9aa
......@@ -438,6 +438,7 @@ class FilteredControlPortProxyHandler(socketserver.StreamRequestHandler):
super(type(self), self).setup()
self.filters = []
for filter_file in glob.glob('/etc/tor-controlport-filter.d/*.yml'):
with open(filter_file, "rb") as fh:
filters = yaml.load(
name = re.sub(r'\.yml$', '', os.path.basename(filter_file))
......@@ -445,6 +446,9 @@ class FilteredControlPortProxyHandler(socketserver.StreamRequestHandler):
if name not in filter_:
filter_['name'] = name
self.filters += filters
except (yaml.parser.ParserError, yaml.scanner.ScannerError):
log("filter '{}' has bad YAML and was not loaded!"
def connect_to_real_control_port(self):
with open(global_args.control_cookie_path, "rb") as f:
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment