Commit 480c876b by Serge Hallyn Committed by Stéphane Graber

apparmor: support lxc.aa_profile = unchanged

In which case lxc will not update the apparmor profile at all. Signed-off-by: 's avatarSerge Hallyn <serge.hallyn@ubuntu.com> Acked-by: 's avatarStéphane Graber <stgraber@ubuntu.com>
parent b035f792
...@@ -42,6 +42,7 @@ static int mount_features_enabled = 0; ...@@ -42,6 +42,7 @@ static int mount_features_enabled = 0;
#define AA_DEF_PROFILE "lxc-container-default" #define AA_DEF_PROFILE "lxc-container-default"
#define AA_MOUNT_RESTR "/sys/kernel/security/apparmor/features/mount/mask" #define AA_MOUNT_RESTR "/sys/kernel/security/apparmor/features/mount/mask"
#define AA_ENABLED_FILE "/sys/module/apparmor/parameters/enabled" #define AA_ENABLED_FILE "/sys/module/apparmor/parameters/enabled"
#define AA_UNCHANGED "unchanged"
static bool check_mount_feature_enabled(void) static bool check_mount_feature_enabled(void)
{ {
...@@ -156,6 +157,12 @@ static int apparmor_process_label_set(const char *inlabel, struct lxc_conf *conf ...@@ -156,6 +157,12 @@ static int apparmor_process_label_set(const char *inlabel, struct lxc_conf *conf
if (!aa_enabled) if (!aa_enabled)
return 0; return 0;
/* user may request that we just ignore apparmor */
if (label && strcmp(label, AA_UNCHANGED) == 0) {
INFO("apparmor profile unchanged per user request");
return 0;
}
if (!label) { if (!label) {
if (use_default) if (use_default)
label = AA_DEF_PROFILE; label = AA_DEF_PROFILE;
......
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