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

Fix missing profile init in create_new_profile()

create_new_profile() didn't init missing required_hats as
profile_storage(), which might lead to crashes when creating a profile
for an application listed in the required_hats config option (= in very
rare cases).

This patch adds the missing profile_storage() call.


Acked-by: Kshitij Gupta <kgupta8592@gmail.com>
This commit is contained in:
Christian Boltz
2015-10-18 22:24:15 +02:00
parent cdc6f74f7e
commit 0dc861ef6d

View File

@@ -470,6 +470,8 @@ def create_new_profile(localfile, is_stub=False):
for hatglob in cfg['required_hats'].keys():
if re.search(hatglob, localfile):
for hat in sorted(cfg['required_hats'][hatglob].split()):
if not local_profile.get(hat, False):
local_profile[hat] = profile_storage()
local_profile[hat]['flags'] = 'complain'
if not is_stub: