Signed-off-by: Serge Hallyn <serge.hallyn@ubuntu.com>
static bool in_aa_confined_container(void) {
char *p = apparmor_process_label_get(getpid());
bool ret = false;
- if (p && strcmp(p, "/usr/bin/lxc-start") != 0)
+ if (p && strcmp(p, "/usr/bin/lxc-start") != 0 && strcmp(p, "unconfined") != 0) {
+ INFO("Already apparmor-confined under %s", p);
ret = true;
+ }
free(p);
return ret;
}
ERROR("already apparmor confined, but new label requested.");
return -1;
}
- INFO("Already apparmor-confined");
return 0;
}