mirror of
https://gitlab.com/apparmor/apparmor.git
synced 2025-03-04 08:24:42 +01:00
ProfileList addProfile(): always hand over ProfileStorage
... and make it non-optional Note that read_profile() in aa.py skips child profiles and hats, therefore active_profiles for now only contains the main profiles.
This commit is contained in:
parent
b2f713dd83
commit
792d1a5568
2 changed files with 4 additions and 4 deletions
|
@ -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:
|
||||
|
|
|
@ -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:
|
||||
|
|
Loading…
Add table
Reference in a new issue