[apparmor] [patch] [09/38] Drop contains() in aamode.py
Seth Arnold
seth.arnold at canonical.com
Wed Sep 14 07:28:46 UTC 2016
On Fri, Aug 12, 2016 at 10:48:45PM +0200, Christian Boltz wrote:
> Hello,
>
> after dropping the dead code in handle_children(), there's only one use
> of contains() left in log_str_to_mode().
>
> This patch changes log_str_to_mode to use mode_contains() and drops the
> now unused contains() function.
>
>
> [ 09-aamode-drop-contains.diff ]
Acked-by: Seth Arnold <seth.arnold at canonical.com>
Thanks
>
> === modified file 'utils/apparmor/aamode.py'
> --- utils/apparmor/aamode.py 2015-02-03 11:47:36 +0000
> +++ utils/apparmor/aamode.py 2016-02-03 23:45:39 +0000
> @@ -123,9 +123,6 @@
>
> return (mode & subset) == subset
>
> -def contains(mode, string):
> - return mode_contains(mode, str_to_mode(string))
> -
> def validate_log_mode(mode):
> if LOG_MODE_RE.search(mode):
> return True
> @@ -249,7 +246,7 @@
> mode = str_to_mode(string)
> # If contains nx and nix
> #print (profile, string, nt_name)
> - if contains(mode, 'Nx'):
> + if mode_contains(mode, str_to_mode('Nx')):
> # Transform to px, cx
> match = re.search('(.+?)//(.+?)', nt_name)
> if match:
>
>
-------------- 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/20160914/533dbea3/attachment.pgp>
More information about the AppArmor
mailing list