aa-unconfined: add support for 'kill' profile mode

... when reading /proc/$pid/attr/{apparmor/,}current

Also add a comment about _not_ adding support for the 'unconfined'
profile mode, because that would give a quite confusing output.
This commit is contained in:
Christian Boltz 2020-09-18 13:34:37 +02:00
parent 5a31e94394
commit f0c27b57b0
Failed to generate hash of commit

View file

@ -106,7 +106,8 @@ def read_proc_current(filename):
with apparmor.common.open_file_read(filename) as current:
for line in current:
line = line.strip()
if line.endswith(' (complain)', 1) or line.endswith(' (enforce)', 1): # enforce at least one char as profile name
if line.endswith(' (complain)', 1) or line.endswith(' (enforce)', 1) or line.endswith(' (kill)', 1): # enforce at least one char as profile name
# intentionally not checking for '(unconfined)', because $binary confined by $profile (unconfined) would look very confusing
attr = line
return attr