core: ignore failure on setting smack process label when allowed

This commit is contained in:
Yu Watanabe
2021-11-01 13:48:32 +09:00
committed by Daan De Meyer
parent 2ad2925de5
commit 29ff62473b

View File

@@ -4613,7 +4613,7 @@ static int exec_child(
* process. This is the latest place before dropping capabilities. Other MAC context are set later. */
if (use_smack) {
r = setup_smack(context, executable_fd);
if (r < 0) {
if (r < 0 && !context->smack_process_label_ignore) {
*exit_status = EXIT_SMACK_PROCESS_LABEL;
return log_unit_error_errno(unit, r, "Failed to set SMACK process label: %m");
}