[apparmor] [patch] Drop seen_events counter from aa.py
Christian Boltz
apparmor at cboltz.de
Thu Oct 13 22:43:19 UTC 2016
Hello,
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.
[ 01-drop-seen_events.diff ]
=== modified file ./utils/apparmor/aa.py
--- utils/apparmor/aa.py 2016-10-14 00:35:27.514276563 +0200
+++ utils/apparmor/aa.py 2016-10-14 00:34:20.802587963 +0200
@@ -95,7 +95,6 @@
existing_profiles = dict()
-seen_events = 0 # was our
# To store the globs entered by users so they can be provided again
# format: user_globs['/foo*'] = AARE('/foo*')
user_globs = {}
@@ -1056,7 +1055,6 @@
family = None
sock_type = None
protocol = None
- global seen_events
regex_nullcomplain = re.compile('^null(-complain)*-profile$')
for entry in entries:
@@ -1114,8 +1112,6 @@
if aamode == 'PERMITTING':
q.default = 'CMD_ADDHAT'
- seen_events += 1
-
ans = q.promptUser()[0]
if ans == 'CMD_FINISHED':
@@ -1283,9 +1279,6 @@
exec_toggle = False
q.functions += build_x_functions(default, options, exec_toggle)
- # options = '|'.join(options)
- seen_events += 1
-
# ask user about the exec mode to use
ans = ''
# unused: 'CMD_px_safe', 'CMD_cx_safe', 'CMD_nx_safe', 'CMD_pix_safe', 'CMD_cix_safe', 'CMD_nix_safe', 'CMD_ux_safe', 'CMD_EXEC_TOGGLE'
@@ -1525,7 +1518,6 @@
def ask_the_questions():
found = 0
- global seen_events
for aamode in sorted(log_dict.keys()):
# Describe the type of changes
if aamode == 'PERMITTING':
@@ -1580,8 +1572,6 @@
else:
options.append(rule_obj.get_clean())
- seen_events += 1
-
done = False
while not done:
q.options = options
Regards,
Christian Boltz
--
Mach halt nicht. Viel Glueck fuer die naechsten Jahre noch ein System
mit 2.95 zu finden. Sogar debian hat gcc 3 in unstable. Okay, das
dauert noch, ehmm ... 10 Jahre, bis das stable wird, aber immerhin.
[Michael Matz in suse-programming]
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 801 bytes
Desc: This is a digitally signed message part.
URL: <https://lists.ubuntu.com/archives/apparmor/attachments/20161014/e279da75/attachment.pgp>
More information about the AppArmor
mailing list