52b84b
From 7301b170b266225f091e95ff52b3a95ff9776d13 Mon Sep 17 00:00:00 2001
52b84b
From: =?UTF-8?q?Michal=20Sekleta=CC=81r?= <msekleta@redhat.com>
52b84b
Date: Fri, 3 Apr 2020 09:13:59 +0200
52b84b
Subject: [PATCH] selinux: do preprocessor check only in selinux-access.c
52b84b
52b84b
This has the advantage that mac_selinux_access_check() can be used as a
52b84b
function in all contexts. For example, parameters passed to it won't be
52b84b
reported as unused if the "function" call is replaced with 0 on SELinux
52b84b
disabled builds.
52b84b
52b84b
(cherry picked from commit 08deac6e3e9119aeb966375f94695e4aa14ffb1c)
52b84b
52b84b
Related: #1830861
52b84b
---
52b84b
 src/core/selinux-access.h | 9 ---------
52b84b
 1 file changed, 9 deletions(-)
52b84b
52b84b
diff --git a/src/core/selinux-access.h b/src/core/selinux-access.h
52b84b
index 59f2e60c77..46a657a4b4 100644
52b84b
--- a/src/core/selinux-access.h
52b84b
+++ b/src/core/selinux-access.h
52b84b
@@ -12,17 +12,8 @@
52b84b
 
52b84b
 int mac_selinux_generic_access_check(sd_bus_message *message, const char *path, const char *permission, sd_bus_error *error);
52b84b
 
52b84b
-#if HAVE_SELINUX
52b84b
-
52b84b
 #define mac_selinux_access_check(message, permission, error) \
52b84b
         mac_selinux_generic_access_check((message), NULL, (permission), (error))
52b84b
 
52b84b
 #define mac_selinux_unit_access_check(unit, message, permission, error) \
52b84b
         mac_selinux_generic_access_check((message), unit_label_path(unit), (permission), (error))
52b84b
-
52b84b
-#else
52b84b
-
52b84b
-#define mac_selinux_access_check(message, permission, error) 0
52b84b
-#define mac_selinux_unit_access_check(unit, message, permission, error) 0
52b84b
-
52b84b
-#endif