[apparmor] [PATCH 03/27] apparmor: refactor profile mode macros

Steve Beattie steve at nxnw.org
Wed Nov 21 14:47:53 UTC 2012


On Tue, Nov 20, 2012 at 08:39:43PM -0800, John Johansen wrote:
> Signed-off-by: John Johansen <john.johansen at canonical.com>
Acked-by: Steve Beattie <sbeattie at ubuntu.com>

> ---
>  security/apparmor/include/policy.h |   12 ++++++------
>  1 file changed, 6 insertions(+), 6 deletions(-)
> 
> diff --git a/security/apparmor/include/policy.h b/security/apparmor/include/policy.h
> index bda4569..95979c4 100644
> --- a/security/apparmor/include/policy.h
> +++ b/security/apparmor/include/policy.h
> @@ -32,13 +32,13 @@
>  extern const char *const profile_mode_names[];
>  #define APPARMOR_NAMES_MAX_INDEX 3
>  
> -#define COMPLAIN_MODE(_profile)	\
> -	((aa_g_profile_mode == APPARMOR_COMPLAIN) || \
> -	 ((_profile)->mode == APPARMOR_COMPLAIN))
> +#define PROFILE_MODE(_profile, _mode)		\
> +	((aa_g_profile_mode == (_mode)) ||	\
> +	 ((_profile)->mode == (_mode)))
>  
> -#define KILL_MODE(_profile) \
> -	((aa_g_profile_mode == APPARMOR_KILL) || \
> -	 ((_profile)->mode == APPARMOR_KILL))
> +#define COMPLAIN_MODE(_profile)	PROFILE_MODE((_profile), APPARMOR_COMPLAIN)
> +
> +#define KILL_MODE(_profile) PROFILE_MODE((_profile), APPARMOR_KILL)
>  
>  #define PROFILE_IS_HAT(_profile) ((_profile)->flags & PFLAG_HAT)
>  

-- 
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: 836 bytes
Desc: Digital signature
URL: <https://lists.ubuntu.com/archives/apparmor/attachments/20121121/2eab8f5e/attachment.pgp>


More information about the AppArmor mailing list