2
0
mirror of https://gitlab.com/apparmor/apparmor synced 2025-08-31 14:25:52 +00:00

Merge branch 'cboltz-double-read-inactive' into 'master'

Let read_inactive_profiles() do nothing when calling it the second time

See merge request apparmor/apparmor!17

(cherry picked from commit 794d1c4a07)

b307e535 Let read_inactive_profiles() do nothing when calling it the second time
This commit is contained in:
Christian Boltz
2017-11-28 21:55:17 +00:00
parent 67be2e9e9b
commit b4310a9366

View File

@@ -2226,6 +2226,13 @@ def read_profiles():
read_profile(profile_dir + '/' + file, True)
def read_inactive_profiles():
if hasattr(read_inactive_profiles, 'already_read'):
# each autodep() run calls read_inactive_profiles, but that's a) superfluous and b) triggers a conflict because the inactive profiles are already loaded
# therefore don't do anything if the inactive profiles were already loaded
return
read_inactive_profiles.already_read = True
if not os.path.exists(extra_profile_dir):
return None
try: