utils/aa-unconfined: Let aa-unconfined screen out prompt and mixed modes

The prompt/user upcall mode shows up as a mode of (user). And for
stacked policy with different modes (mixed) is used. Add these to the
list of modes to screen.

Signed-off-by: John Johansen <john.johansen@canonical.com>
This commit is contained in:
John Johansen 2024-07-07 05:07:37 -07:00
parent e67a5ae05c
commit 5e349dbe69

View file

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