{
char *p = apparmor_process_label_get(ops, lxc_raw_getpid());
bool ret = false;
- if (!p || strcmp(p, "unconfined") == 0)
+ if (!p || strequal(p, "unconfined"))
ret = true;
free(p);
return ret;
{
if (!curlabel)
return false;
- if (strcmp(curlabel, "unconfined") == 0)
+ if (strequal(curlabel, "unconfined"))
return false;
- if (strcmp(curlabel, "/usr/bin/lxc-start") == 0)
+ if (strequal(curlabel, "/usr/bin/lxc-start"))
return false;
return true;
}
label = conf->lsm_aa_profile;
/* user may request that we just ignore apparmor */
- if (label && strcmp(label, AA_UNCHANGED) == 0) {
+ if (label && strequal(label, AA_UNCHANGED)) {
INFO("AppArmor profile unchanged per user request");
conf->lsm_aa_profile_computed = must_copy_string(label);
return 0;
}
- if (label && strcmp(label, AA_GENERATED) == 0) {
+ if (label && strequal(label, AA_GENERATED)) {
if (!check_apparmor_parser_version(ops)) {
ERROR("Cannot use generated profile: apparmor_parser not available");
goto out;
if (!ops->aa_can_stack && aa_needs_transition(curlabel)) {
/* we're already confined, and stacking isn't supported */
- if (!label || strcmp(curlabel, label) == 0) {
+ if (!label || strequal(curlabel, label)) {
/* no change requested */
ret = 0;
goto out;
label = AA_DEF_PROFILE;
}
- if (!ops->aa_mount_features_enabled && strcmp(label, "unconfined") != 0) {
+ if (!ops->aa_mount_features_enabled && !strequal(label, "unconfined")) {
WARN("Incomplete AppArmor support in your kernel");
if (!conf->lsm_aa_allow_incomplete) {
ERROR("If you really want to start this container, set");
return log_error_errno(-EINVAL, EINVAL, "LSM wasn't prepared");
/* user may request that we just ignore apparmor */
- if (strcmp(label, AA_UNCHANGED) == 0)
+ if (strequal(label, AA_UNCHANGED))
return log_info(0, "AppArmor profile unchanged per user request");
- if (strcmp(label, "unconfined") == 0 && apparmor_am_unconfined(ops))
+ if (strequal(label, "unconfined") && apparmor_am_unconfined(ops))
return log_info(0, "AppArmor profile unchanged");
label_fd = apparmor_process_label_fd_get(ops, lxc_raw_gettid(), on_exec);