Commit 6b13c981 authored by intrigeri's avatar intrigeri
Browse files

Onion Grater: adjust parsing of /proc/pid/attr/current to support named...

Onion Grater: adjust parsing of /proc/pid/attr/current to support named AppArmor profiles (refs: #14572)

Without this changes, passing 'torbrowser_firefox' to the exe-paths setting
is not effective.
parent 62ada7e8
......@@ -172,7 +172,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.
enabled_aa_profile_re = r'^(/.+) \((?:complain|enforce)\)$'
enabled_aa_profile_re = r'^(.+) \((?:complain|enforce)\)$'
with open('/proc/{}/attr/current'.format(str(pid)), "rb") as fh:
aa_profile_status = str(, '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