mirror of
https://gitlab.com/apparmor/apparmor
synced 2025-08-30 13:58:22 +00:00
Reset aa and original_aa in read_profiles()
TL;DR: aa-genprof crashes with a wrong 'Conflicting profiles' error. aa-genprof uses autodep() to create a basic profile, which is then stored in aa and original_aa. After that, read_profiles() is called, which reads all profiles (including the new one) from disk, causing a (wrong) 'Conflicting profiles' error in attach_profile_data() because the autodep()-generated profile is already there. Therefore this patch resets aa and original_aa in read_profiles() to avoid that problem. Acked-by <timeout>
This commit is contained in:
@@ -2463,6 +2463,12 @@ def is_skippable_dir(path):
|
|||||||
return False
|
return False
|
||||||
|
|
||||||
def read_profiles():
|
def read_profiles():
|
||||||
|
# we'll read all profiles from disk, so reset the storage first (autodep() might have created/stored
|
||||||
|
# a profile already, which would cause a 'Conflicting profile' error in attach_profile_data())
|
||||||
|
global aa, original_aa
|
||||||
|
aa = hasher()
|
||||||
|
original_aa = hasher()
|
||||||
|
|
||||||
try:
|
try:
|
||||||
os.listdir(profile_dir)
|
os.listdir(profile_dir)
|
||||||
except:
|
except:
|
||||||
|
Reference in New Issue
Block a user