mirror of
https://gitlab.com/apparmor/apparmor
synced 2025-09-03 07:45:50 +00:00
Drop seen_events counter from aa.py
seen_events is a global variable in aa.py that gets increased at several places, but isn't used (read or printed) anywhere. Since I can't imagine how it could become useful, simply drop it. Also drop an outdated comment in handle_children that lived next to a seen_events line. Acked-by: Seth Arnold <seth.arnold@canonical.com>
This commit is contained in:
@@ -95,7 +95,6 @@ include = dict()
|
|||||||
|
|
||||||
existing_profiles = dict()
|
existing_profiles = dict()
|
||||||
|
|
||||||
seen_events = 0 # was our
|
|
||||||
# To store the globs entered by users so they can be provided again
|
# To store the globs entered by users so they can be provided again
|
||||||
# format: user_globs['/foo*'] = AARE('/foo*')
|
# format: user_globs['/foo*'] = AARE('/foo*')
|
||||||
user_globs = {}
|
user_globs = {}
|
||||||
@@ -1030,7 +1029,6 @@ def handle_children(profile, hat, root):
|
|||||||
family = None
|
family = None
|
||||||
sock_type = None
|
sock_type = None
|
||||||
protocol = None
|
protocol = None
|
||||||
global seen_events
|
|
||||||
regex_nullcomplain = re.compile('^null(-complain)*-profile$')
|
regex_nullcomplain = re.compile('^null(-complain)*-profile$')
|
||||||
|
|
||||||
for entry in entries:
|
for entry in entries:
|
||||||
@@ -1088,8 +1086,6 @@ def handle_children(profile, hat, root):
|
|||||||
if aamode == 'PERMITTING':
|
if aamode == 'PERMITTING':
|
||||||
q.default = 'CMD_ADDHAT'
|
q.default = 'CMD_ADDHAT'
|
||||||
|
|
||||||
seen_events += 1
|
|
||||||
|
|
||||||
ans = q.promptUser()[0]
|
ans = q.promptUser()[0]
|
||||||
|
|
||||||
if ans == 'CMD_FINISHED':
|
if ans == 'CMD_FINISHED':
|
||||||
@@ -1257,9 +1253,6 @@ def handle_children(profile, hat, root):
|
|||||||
exec_toggle = False
|
exec_toggle = False
|
||||||
q.functions += build_x_functions(default, options, exec_toggle)
|
q.functions += build_x_functions(default, options, exec_toggle)
|
||||||
|
|
||||||
# options = '|'.join(options)
|
|
||||||
seen_events += 1
|
|
||||||
|
|
||||||
# ask user about the exec mode to use
|
# ask user about the exec mode to use
|
||||||
ans = ''
|
ans = ''
|
||||||
while ans not in ['CMD_ix', 'CMD_px', 'CMD_cx', 'CMD_nx', 'CMD_pix', 'CMD_cix', 'CMD_nix', 'CMD_ux', 'CMD_DENY']: # add '(I)gnore'? (hotkey conflict with '(i)x'!)
|
while ans not in ['CMD_ix', 'CMD_px', 'CMD_cx', 'CMD_nx', 'CMD_pix', 'CMD_cix', 'CMD_nix', 'CMD_ux', 'CMD_DENY']: # add '(I)gnore'? (hotkey conflict with '(i)x'!)
|
||||||
@@ -1495,7 +1488,6 @@ def order_globs(globs, original_path):
|
|||||||
|
|
||||||
def ask_the_questions():
|
def ask_the_questions():
|
||||||
found = 0
|
found = 0
|
||||||
global seen_events
|
|
||||||
for aamode in sorted(log_dict.keys()):
|
for aamode in sorted(log_dict.keys()):
|
||||||
# Describe the type of changes
|
# Describe the type of changes
|
||||||
if aamode == 'PERMITTING':
|
if aamode == 'PERMITTING':
|
||||||
@@ -1550,8 +1542,6 @@ def ask_the_questions():
|
|||||||
else:
|
else:
|
||||||
options.append(rule_obj.get_clean())
|
options.append(rule_obj.get_clean())
|
||||||
|
|
||||||
seen_events += 1
|
|
||||||
|
|
||||||
done = False
|
done = False
|
||||||
while not done:
|
while not done:
|
||||||
q.options = options
|
q.options = options
|
||||||
|
Reference in New Issue
Block a user