From c10b39f3fe14f61c866bb6d7f8498bca829f72f5 Mon Sep 17 00:00:00 2001 From: Christian Boltz Date: Sun, 3 Nov 2024 21:06:27 +0100 Subject: [PATCH] aa.py: drop unused function profile_exists() I don't know when (or even: if) this function was in use. A quick look at the git history of aa.py shows that the function was (blindly?) updated a few times. However, I didn't find a commit that uses or stops using profile_exists(), so maybe it was never used at all. --- utils/apparmor/aa.py | 17 ----------------- 1 file changed, 17 deletions(-) diff --git a/utils/apparmor/aa.py b/utils/apparmor/aa.py index 7b27af1b8..8c9f97d70 100644 --- a/utils/apparmor/aa.py +++ b/utils/apparmor/aa.py @@ -601,23 +601,6 @@ def change_profile_flags(prof_filename, program, flag, set_flag): raise AppArmorException("%(file)s doesn't contain a valid profile for %(profile)s (syntax error?)" % {'file': prof_filename, 'profile': program}) -def profile_exists(program): - """Returns True if profile exists, False otherwise""" - # Check cache of profiles - - if active_profiles.filename_from_attachment(program): - return True - # Check the disk for profile - prof_path = get_profile_filename_from_attachment(program, True) - # print(prof_path) - if os.path.isfile(prof_path): - # Add to cache of profile - raise AppArmorBug('Reached strange condition in profile_exists(), please open a bugreport!') - # active_profiles[program] = prof_path - # return True - return False - - def build_x_functions(default, options, exec_toggle): ret_list = [] fallback_toggle = False