diff --git a/utils/apparmor/aa.py b/utils/apparmor/aa.py index 815e691f3..e67de5321 100644 --- a/utils/apparmor/aa.py +++ b/utils/apparmor/aa.py @@ -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 diff --git a/utils/apparmor/common.py b/utils/apparmor/common.py index a94b78780..208589fc0 100644 --- a/utils/apparmor/common.py +++ b/utils/apparmor/common.py @@ -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):