[apparmor] [patch] split off _is_covered_*() helper functions
Steve Beattie
steve at nxnw.org
Mon Jan 25 21:25:47 UTC 2016
On Mon, Dec 21, 2015 at 12:45:18AM +0100, Christian Boltz wrote:
> is_covered_localvars() in the rule classes need the same set of checks
> again and again. This patch adds the helper functions _is_covered_list(),
> _is_covered_aare() and _is_covered_plain() to check against lists, AARE
> and plain variables like str.
>
> The helpers check if the values from the other rule are valid (either
> ALL or the value need to be set) and then checks if the value is covered
> by the other rule's values.
>
> This results in replacing 7 lines with 2 in the rule classes and avoids
> repeating code over and over.
>
> Note that the helper functions depend on the *Rule.rule_name variable in
> the exception message, therefore rule_name gets added to all rule
> classes.
>
>
> [ 40-split-off-_is_covered-helpers.diff ]
(The beginning of this patch got munged a bit in transit.)
Acked-by: Steve Beattie <steve at nxnw.org>. Thanks!
--
Steve Beattie
<sbeattie at ubuntu.com>
http://NxNW.org/~steve/
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: Digital signature
URL: <https://lists.ubuntu.com/archives/apparmor/attachments/20160125/af180b45/attachment.pgp>
More information about the AppArmor
mailing list