2
0
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:
Christian Boltz
2015-10-11 20:28:17 +02:00
parent ea9f9aeff2
commit 06885e9377

View File

@@ -2463,6 +2463,12 @@ def is_skippable_dir(path):
return False
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:
os.listdir(profile_dir)
except: