From 2db3d94ce23e2b035a8e9e62b5c09a7b04575a4f Mon Sep 17 00:00:00 2001 From: Christian Boltz Date: Sun, 8 Nov 2020 14:41:33 +0100 Subject: [PATCH] aa-autodep: load abstractions on start So far, aa-autodep "accidently" loaded the abstractions when parsing the existing profiles. Obviously, this only worked if there is at least one profile in the active or extra profile directory. Without any existing profiles, aa-autodep crashed with KeyError: '/tmp/apparmor.d/abstractions/base' Prevent this crash by explicitely loading the abstractions on start. Fixes: https://bugzilla.opensuse.org/show_bug.cgi?id=1178527#c1 [1] MR: https://gitlab.com/apparmor/apparmor/-/merge_requests/682 (cherry picked from commit f6b3de71161f9acfa177e879017560000b7ffde8) Signed-off-by: John Johansen --- utils/apparmor/tools.py | 1 + 1 file changed, 1 insertion(+) diff --git a/utils/apparmor/tools.py b/utils/apparmor/tools.py index 2d07c3ecb..0887ceb65 100644 --- a/utils/apparmor/tools.py +++ b/utils/apparmor/tools.py @@ -177,6 +177,7 @@ class aa_tools: def cmd_autodep(self): apparmor.read_profiles() + apparmor.loadincludes() for (program, profile) in self.get_next_to_profile(): if not program: