[apparmor] [patch] Drop seen_events counter from aa.py
Seth Arnold
seth.arnold at canonical.com
Thu Oct 13 22:56:58 UTC 2016
On Fri, Oct 14, 2016 at 12:43:19AM +0200, Christian Boltz wrote:
> 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.
>
Acked-by: Seth Arnold <seth.arnold at canonical.com>
Thanks
>
> [ 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
>
>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 473 bytes
Desc: not available
URL: <https://lists.ubuntu.com/archives/apparmor/attachments/20161013/f846bc69/attachment.pgp>
More information about the AppArmor
mailing list