libsmack: change semantics of rule allow_code and deny_code
authorRafal Krypa <r.krypa@samsung.com>
Thu, 13 Feb 2014 13:22:19 +0000 (14:22 +0100)
committerRafal Krypa <r.krypa@samsung.com>
Thu, 13 Feb 2014 16:31:52 +0000 (17:31 +0100)
commitb7ba239e723680ab9c86fd5564d4464e48fa154d
tree90b1ccb44ecdbd0b13eef95d08a73afb776e5f3c
parentc3bbbfddb7f630d44cad6eb9dc64dfc59640f5de
libsmack: change semantics of rule allow_code and deny_code

Fields in struct smack_rule are used to store either set or modify rule.
Set rules used to be distinguished by having deny_code = -1.
It is more convenient to have it differently: allow_code describing bits
that are to be set, deny_code describing bits that are to be cleared.
With that semantics access_code = ~deny_code for set rules. This enables
easy replacement of change rules that can be simplified to a set rule.
Thanks José Bollo for original idea about simplifying modify rules.

Signed-off-by: Rafal Krypa <r.krypa@samsung.com>
libsmack/libsmack.c