From 73b33bdf366340f8a0578c506fdbbebe0bb395ef Mon Sep 17 00:00:00 2001 From: Christian Boltz Date: Tue, 3 Jul 2018 18:34:23 +0200 Subject: [PATCH] Fix unsetting filename in get_profile() When creating a new profile with aa-genprof, get_profile() searches for an inactive ("extra") profile and, if it finds one, removes the filename from that profile so that it gets stored in /etc/apparmor.d/ later. However, it used .pop() to remove the filename, which explodes since ProfileStorage is a class now. This patch fixes this (tested manually). --- utils/apparmor/aa.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/utils/apparmor/aa.py b/utils/apparmor/aa.py index ccc81ea27..4a4ffa2aa 100644 --- a/utils/apparmor/aa.py +++ b/utils/apparmor/aa.py @@ -498,7 +498,7 @@ def get_profile(prof_name): if inactive_profile: uname = 'Inactive local profile for %s' % prof_name inactive_profile[prof_name][prof_name]['flags'] = 'complain' - inactive_profile[prof_name][prof_name].pop('filename') + inactive_profile[prof_name][prof_name]['filename'] = '' profile_hash[uname]['username'] = uname profile_hash[uname]['profile_type'] = 'INACTIVE_LOCAL' profile_hash[uname]['profile'] = serialize_profile(inactive_profile[prof_name], prof_name, {})