diff --git a/utils/apparmor/aa.py b/utils/apparmor/aa.py index 7320a8438..777297592 100644 --- a/utils/apparmor/aa.py +++ b/utils/apparmor/aa.py @@ -511,7 +511,7 @@ def autodep(bin_name, pname=''): if not attachment and pname.startswith('/'): attachment = pname # use name as name and attachment - active_profiles.add_profile(file, pname, attachment) + active_profiles.add_profile(file, pname, attachment, profile_data[pname]) if os.path.isfile(profile_dir + '/abi/4.0'): active_profiles.add_abi(file, AbiRule('abi/4.0', False, True)) @@ -1675,7 +1675,7 @@ def read_profile(file, active_profile, read_error_fatal=False): if not attachment and profile.startswith('/'): attachment = profile # use profile as name and attachment - active_profiles.add_profile(filename, profile, attachment) + active_profiles.add_profile(filename, profile, attachment, profile_data[profile]) else: for profile in profile_data: diff --git a/utils/apparmor/profile_list.py b/utils/apparmor/profile_list.py index dcc42ec0b..8e119688e 100644 --- a/utils/apparmor/profile_list.py +++ b/utils/apparmor/profile_list.py @@ -63,7 +63,7 @@ class ProfileList: for rule in preamble_ruletypes: self.files[filename][rule] = preamble_ruletypes[rule]['ruleset']() - def add_profile(self, filename, profile_name, attachment, prof_storage=None): + def add_profile(self, filename, profile_name, attachment, prof_storage): """Add the given profile and attachment to the list""" if not filename: @@ -72,7 +72,7 @@ class ProfileList: if not profile_name and not attachment: raise AppArmorBug('Neither profile name or attachment given') - if type(prof_storage) is not ProfileStorage and prof_storage is not None: + if type(prof_storage) is not ProfileStorage: raise AppArmorBug('Invalid profile type: %s' % type(prof_storage)) if profile_name in self.profile_names: