teknoraver / rpms / systemd

Forked from rpms/systemd 3 months ago
Clone
Blob Blame History Raw
From 602f5a2c2a7ed23ebd61a728f6e16f63024e3c1f Mon Sep 17 00:00:00 2001
From: Michael Scherer <misc@zarb.org>
Date: Thu, 6 Feb 2014 10:05:17 +0100
Subject: [PATCH] exec: Ignore the setting SELinuxContext if selinux is not
 enabled

(cherry picked from commit 5c56a259e07661a66e806cc2fbc71de96a75f78e)

Related: #1113790
---
 src/core/execute.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/core/execute.c b/src/core/execute.c
index cf9d24e..cb6f146 100644
--- a/src/core/execute.c
+++ b/src/core/execute.c
@@ -1472,7 +1472,7 @@ int exec_spawn(ExecCommand *command,
                                 }
                         }
 #ifdef HAVE_SELINUX
-                        if (context->selinux_context) {
+                        if (context->selinux_context && use_selinux()) {
                                 err = security_check_context(context->selinux_context);
                                 if (err < 0) {
                                         r = EXIT_SELINUX_CONTEXT;