Commit e732a712 authored by anonym's avatar anonym
Browse files

tor-controlport-filter: combine regex.

parent 4f5fc157
......@@ -11,18 +11,14 @@
GETCONF:
- 'UseBridges'
- 'Bridge'
- 'Socks4Proxy'
- 'Socks5Proxy'
- 'Socks(4|5)Proxy'
- 'HTTPSProxy'
SETCONF:
- 'UseBridges(=.*)?'
- 'Bridge(=.*)?'
- 'Socks4Proxy(=.*)?'
- 'Socks5Proxy(=.*)?'
- 'Socks5ProxyUsername(=.*)?'
- 'Socks5ProxyPassword(=.*)?'
- 'HTTPSProxy(=.*)?'
- 'HTTPSProxyAuthenticator(=.*)?'
- 'Socks(4|5)Proxy(=.*)?'
- 'Socks5Proxy(Username|Password)(=.*)?'
- 'HTTPSProxy(Authenticator)?(=.*)?'
- 'ReachableAddresses(=.*)?'
- 'DisableNetwork=0'
events:
......
......@@ -97,8 +97,7 @@ def exe_path_of_pid(pid):
# using one of its profiles. However, we fallback to /proc/pid/exe
# in case there is no AppArmor profile, so the only unsupported
# mode here is unconfined scripts.
aa_mode_re = r'(?:complain|enforce)'
enabled_aa_profile_re = r'^(/.+) \({}\)$'.format(aa_mode_re)
enabled_aa_profile_re = r'^(/.+) \((?:complain|enforce)\)$'
with open('/proc/{}/attr/current'.format(str(pid)), "rb") as fh:
aa_profile_status = str(fh.read().strip(), 'UTF-8')
exe_path_match = re.match(enabled_aa_profile_re, aa_profile_status)
......
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