mirror of
https://gitlab.com/apparmor/apparmor.git
synced 2025-03-05 17:01:00 +01:00
Fix aa-logprof "add hat" endless loop
This turned out to be a simple case of misinterpreting the promptUser() result - it returns the answer and the selected option, and "surprisingly" something like ('CMD_ADDHAT', 0) never matched 'CMD_ADDHAT' ;-) I also noticed that the new hat doesn't get initialized as profile_storage(), and that the changed profile doesn't get marked as changed. This is also fixed by this patch. References: https://bugs.launchpad.net/apparmor/+bug/1538306 Acked-by: Steve Beattie <steve@nxnw.org> for trunk, 2.10 and 2.9
This commit is contained in:
parent
4ad98a8302
commit
791d40aa9d
1 changed files with 3 additions and 1 deletions
|
@ -1095,7 +1095,7 @@ def handle_children(profile, hat, root):
|
|||
|
||||
seen_events += 1
|
||||
|
||||
ans = q.promptUser()
|
||||
ans = q.promptUser()[0]
|
||||
|
||||
if ans == 'CMD_FINISHED':
|
||||
save_profiles()
|
||||
|
@ -1105,7 +1105,9 @@ def handle_children(profile, hat, root):
|
|||
|
||||
if ans == 'CMD_ADDHAT':
|
||||
hat = uhat
|
||||
aa[profile][hat] = profile_storage(profile, hat, 'handle_children addhat')
|
||||
aa[profile][hat]['flags'] = aa[profile][profile]['flags']
|
||||
changed[profile] = True
|
||||
elif ans == 'CMD_USEDEFAULT':
|
||||
hat = default_hat
|
||||
elif ans == 'CMD_DENY':
|
||||
|
|
Loading…
Add table
Reference in a new issue