mirror of
https://gitlab.com/apparmor/apparmor
synced 2025-08-30 13:58:22 +00:00
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.
This commit is contained in:
parent
f7b5d0e783
commit
c10b39f3fe
@ -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})
|
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):
|
def build_x_functions(default, options, exec_toggle):
|
||||||
ret_list = []
|
ret_list = []
|
||||||
fallback_toggle = False
|
fallback_toggle = False
|
||||||
|
Loading…
x
Reference in New Issue
Block a user