提交 b5b2557c 编写于 作者: J John Johansen

apparmor: add fn to test if profile supports a given mediation class

Signed-off-by: NJohn Johansen <john.johansen@canonical.com>
上级 1dea3b41
...@@ -222,6 +222,16 @@ void __aa_profile_list_release(struct list_head *head); ...@@ -222,6 +222,16 @@ void __aa_profile_list_release(struct list_head *head);
#define unconfined(X) ((X)->mode == APPARMOR_UNCONFINED) #define unconfined(X) ((X)->mode == APPARMOR_UNCONFINED)
#define PROFILE_MEDIATES(P, T) ((P)->policy.start[(T)])
/* safe version of POLICY_MEDIATES for full range input */
static inline unsigned int PROFILE_MEDIATES_SAFE(struct aa_profile *profile,
unsigned char class)
{
if (profile->policy.dfa)
return aa_dfa_match_len(profile->policy.dfa,
profile->policy.start[0], &class, 1);
return 0;
}
/** /**
* aa_get_profile - increment refcount on profile @p * aa_get_profile - increment refcount on profile @p
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册