execute: respect selinux_context_ignore
authorTopi Miettinen <toiwoton@gmail.com>
Sat, 30 Oct 2021 16:58:41 +0000 (19:58 +0300)
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Wed, 10 Nov 2021 14:01:30 +0000 (15:01 +0100)
commit38d0d41e0fc5d559cff5a1bcf46482aec9d6f5ef
tree4f3b38909867016b329e5770a0e5347b3f5adc3d
parent08693ce568f0967046b669fcd99ba0939a1df86d
execute: respect selinux_context_ignore

When `SELinuxContext=` parameter is prefixed with `-`, the documentation states
that any errors determining or changing context should be ignored, but this
doesn't actually happen and the service may fail with `229/SELINUX_CONTEXT`.

Fix by adding checks to `context->selinux_context_ignore`.

Closes: #21057
(cherry picked from commit 2ad2925de5f258d128ec8cdb07f10f3c52fa4fcf)
src/core/execute.c