Commit a5b2264d authored by anonym's avatar anonym
Browse files

tor-controlport-filter: fail if multiple filters are matched.

In this ambiguous situation, that is the failsafe approach.
parent 117f17c3
......@@ -193,11 +193,12 @@ def match_and_parse_filter(filters, matchers):
status = 'no matching filter found, using an empty one'
return (status, filter_name, allowed_commands,
allowed_events, restrict_stream_events)
elif len(matched_filters) > 1:
raise RuntimeError('multiple filters matched: ' +
', '.join(matched_filters))
matched_filter = matched_filters[0]
filter_name = matched_filter['name']
status = 'loaded filter: {}'.format(filter_name)
if len(matched_filters) > 1:
status = 'multiple filters matched, ' + status
# Parse `commands`
commands = matched_filter.get('commands', {}) or {}
......
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