mirror of
https://gitlab.com/apparmor/apparmor.git
synced 2025-03-04 16:35:02 +01:00
Fix aa-unconfined to work with profile names that don't start with / or null
Reported by u on the debian pkg-apparmor-team ML. Acked-by: John Johansen <john.johansen@canonical.com>
This commit is contained in:
parent
c51a68eaaf
commit
9aa1efd744
1 changed files with 3 additions and 2 deletions
|
@ -63,8 +63,9 @@ for pid in sorted(pids):
|
|||
if os.path.exists("/proc/%s/attr/current"%pid):
|
||||
with aa.open_file_read("/proc/%s/attr/current"%pid) as current:
|
||||
for line in current:
|
||||
if line.startswith("/") or line.startswith("null"):
|
||||
attr = line.strip()
|
||||
line = line.strip()
|
||||
if line.endswith(' (complain)', 1) or line.endswith(' (enforce)', 1): # enforce at least one char as profile name
|
||||
attr = line
|
||||
|
||||
cmdline = apparmor.common.cmd(["cat", "/proc/%s/cmdline"%pid])[1]
|
||||
pname = cmdline.split("\0")[0]
|
||||
|
|
Loading…
Add table
Reference in a new issue