context->protect_home,
context->protect_system,
context->mount_flags);
- if (err < 0) {
+
+ if (err == -EPERM)
+ log_warning_unit(params->unit_id, "Failed to set up file system namespace due to lack of privileges. Execution sandbox will not be in effect: %s", strerror(-err));
+ else if (err < 0) {
*error = EXIT_NAMESPACE;
return err;
}
err = aa_change_onexec(context->apparmor_profile);
if (err < 0 && !context->apparmor_profile_ignore) {
*error = EXIT_APPARMOR_PROFILE;
- return err;
+ return -errno;
}
}
#endif