2
0
mirror of https://gitlab.com/apparmor/apparmor synced 2025-08-30 13:58:22 +00:00

Fix "Invalid mode found: /usr/lib64/firefox/firefox.sh"

After several hours of debugging on IRC and flooding paste.opensuse.org ;-)
I finally found the reason - reading(!) from log_dict with a wrong 
key caused the creation of that strange mode in log_dict.keys().

While finding that bug was very hard, the fix is easy - just replace 
"profile" with "aamode". (That probably makes one char per hour of 
debugging...)

To improve that ratio, also add a warning to common.py so that this 
interesting[tm] behaviour of hasher() is at least documented.


Acked-by: Steve Beattie <steve@nxnw.org>
This commit is contained in:
Christian Boltz
2014-10-14 12:54:39 +02:00
parent 7e84f4efe9
commit d11055aa0c
2 changed files with 3 additions and 1 deletions

View File

@@ -1938,7 +1938,7 @@ def ask_the_questions():
#
for family in sorted(log_dict[aamode][profile][hat]['netdomain'].keys()):
# severity handling for net toggles goes here
for sock_type in sorted(log_dict[profile][profile][hat]['netdomain'][family].keys()):
for sock_type in sorted(log_dict[aamode][profile][hat]['netdomain'][family].keys()):
if profile_known_network(aa[profile][hat], family, sock_type):
continue
default_option = 1

View File

@@ -200,6 +200,8 @@ def readkey():
def hasher():
'''A neat alternative to perl's hash reference'''
# Creates a dictionary for any depth and returns empty dictionary otherwise
# WARNING: when reading non-existing sub-dicts, empty dicts will be added.
# This might cause strange effects when using .keys()
return collections.defaultdict(hasher)
def convert_regexp(regexp):