diff --git a/utils/aa-mergeprof b/utils/aa-mergeprof index e1be53cb2..0e18806f9 100755 --- a/utils/aa-mergeprof +++ b/utils/aa-mergeprof @@ -1,7 +1,7 @@ #! /usr/bin/env python # ---------------------------------------------------------------------- # Copyright (C) 2013 Kshitij Gupta -# Copyright (C) 2014-2015 Christian Boltz +# Copyright (C) 2014-2016 Christian Boltz # # This program is free software; you can redistribute it and/or # modify it under the terms of version 2 of the GNU General Public @@ -18,7 +18,7 @@ import re import os import apparmor.aa -from apparmor.aa import available_buttons, combine_name, delete_duplicates, is_known_rule, match_includes +from apparmor.aa import available_buttons, combine_name, delete_duplicates, get_profile_filename, is_known_rule, match_includes import apparmor.aamode from apparmor.common import AppArmorException from apparmor.regex import re_match_include @@ -284,6 +284,9 @@ class Merge(object): if not sev_db: sev_db = apparmor.severity.Severity(apparmor.aa.CONFDIR + '/severity.db', _('unknown')) + sev_db.unload_variables() + sev_db.load_variables(get_profile_filename(profile)) + for hat in sorted(other.aa[profile].keys()): #Add the includes from the other profile to the user profile done = False diff --git a/utils/apparmor/aa.py b/utils/apparmor/aa.py index 73922037a..d40cd292f 100644 --- a/utils/apparmor/aa.py +++ b/utils/apparmor/aa.py @@ -1,6 +1,6 @@ # ---------------------------------------------------------------------- # Copyright (C) 2013 Kshitij Gupta -# Copyright (C) 2014-2015 Christian Boltz +# Copyright (C) 2014-2016 Christian Boltz # # This program is free software; you can redistribute it and/or # modify it under the terms of version 2 of the GNU General Public @@ -1607,6 +1607,10 @@ def ask_the_questions(): UI_SelectUpdatedRepoProfile(profile, p) found += 1 + + sev_db.unload_variables() + sev_db.load_variables(get_profile_filename(profile)) + # Sorted list of hats with the profile name coming first hats = list(filter(lambda key: key != profile, sorted(log_dict[aamode][profile].keys()))) if log_dict[aamode][profile].get(profile, False):