Commit 5ebfb128 authored by John Johansen's avatar John Johansen

apparmor: add support for force complain flag to support learning mode

Signed-off-by: default avatarJohn Johansen <john.johansen@canonical.com>
parent abbf8734
...@@ -29,6 +29,8 @@ ...@@ -29,6 +29,8 @@
#include "include/policy.h" #include "include/policy.h"
#include "include/policy_unpack.h" #include "include/policy_unpack.h"
#define FORCE_COMPLAIN_FLAG 0x800
/* /*
* The AppArmor interface treats data as a type byte followed by the * The AppArmor interface treats data as a type byte followed by the
* actual data. The interface has the notion of a a named entry * actual data. The interface has the notion of a a named entry
...@@ -514,7 +516,7 @@ static struct aa_profile *unpack_profile(struct aa_ext *e) ...@@ -514,7 +516,7 @@ static struct aa_profile *unpack_profile(struct aa_ext *e)
profile->flags |= PFLAG_HAT; profile->flags |= PFLAG_HAT;
if (!unpack_u32(e, &tmp, NULL)) if (!unpack_u32(e, &tmp, NULL))
goto fail; goto fail;
if (tmp == PACKED_MODE_COMPLAIN) if (tmp == PACKED_MODE_COMPLAIN || (e->version & FORCE_COMPLAIN_FLAG))
profile->mode = APPARMOR_COMPLAIN; profile->mode = APPARMOR_COMPLAIN;
else if (tmp == PACKED_MODE_KILL) else if (tmp == PACKED_MODE_KILL)
profile->mode = APPARMOR_KILL; profile->mode = APPARMOR_KILL;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment