Commit 48c7d40f authored by Tycho Andersen's avatar Tycho Andersen Committed by Pavel Emelyanov

lsm: report more errors when rendering profile fails

Signed-off-by: 's avatarTycho Andersen <tycho.andersen@canonical.com>
Signed-off-by: 's avatarPavel Emelyanov <xemul@virtuozzo.com>
parent c72f6d58
...@@ -192,6 +192,7 @@ int render_lsm_profile(char *profile, char **val) ...@@ -192,6 +192,7 @@ int render_lsm_profile(char *profile, char **val)
switch (lsmtype) { switch (lsmtype) {
case LSMTYPE__APPARMOR: case LSMTYPE__APPARMOR:
if (strcmp(profile, "unconfined") != 0 && asprintf(val, "changeprofile %s", profile) < 0) { if (strcmp(profile, "unconfined") != 0 && asprintf(val, "changeprofile %s", profile) < 0) {
pr_err("allocating lsm profile failed");
*val = NULL; *val = NULL;
return -1; return -1;
} }
...@@ -203,6 +204,7 @@ int render_lsm_profile(char *profile, char **val) ...@@ -203,6 +204,7 @@ int render_lsm_profile(char *profile, char **val)
} }
break; break;
default: default:
pr_err("can't render profile %s for lsmtype %d\n", profile, LSMTYPE__NO_LSM);
return -1; return -1;
} }
......
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