daandemeyer / rpms / systemd

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