mirror of
https://gitlab.com/apparmor/apparmor.git
synced 2025-03-04 08:24:42 +01:00
Merge aa-unconfined: Improve fallback handling to attr/current
If /proc/*/attr/apparmor/current exists, only read that - instead of falling back to /proc/*/attr/current if a process is for example unconfined so that read_proc_current returns None. Fixes: https://gitlab.com/apparmor/apparmor/-/issues/199 MR: https://gitlab.com/apparmor/apparmor/-/merge_requests/801 Acked-by: John Johansen <john.johansen@canonical.com>
This commit is contained in:
commit
0700b47df8
1 changed files with 4 additions and 2 deletions
|
@ -129,8 +129,10 @@ for pid in sorted(map(int, pids)):
|
|||
except OSError:
|
||||
continue
|
||||
|
||||
attr = read_proc_current("/proc/%s/attr/apparmor/current" % pid)
|
||||
if not attr:
|
||||
if os.path.exists("/proc/%s/attr/apparmor/current" % pid):
|
||||
attr = read_proc_current("/proc/%s/attr/apparmor/current" % pid)
|
||||
else:
|
||||
# fallback to shared attr/current if attr/apparmor/current doesn't exist
|
||||
attr = read_proc_current("/proc/%s/attr/current" % pid)
|
||||
|
||||
pname = None
|
||||
|
|
Loading…
Add table
Reference in a new issue