summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichal Sekletár <msekleta@redhat.com>2020-04-03 09:13:59 +0200
committerMichal Sekletár <msekleta@redhat.com>2020-04-29 13:56:40 +0200
commit08deac6e3e9119aeb966375f94695e4aa14ffb1c (patch)
tree2635065f4fc7394a8a5acd15f240439680884796
parente83ef04d972f6970945d58b9a310df555871c418 (diff)
downloadsystemd-08deac6e3e9119aeb966375f94695e4aa14ffb1c.tar.gz
selinux: do preprocessor check only in selinux-access.c
This has the advantage that mac_selinux_access_check() can be used as a function in all contexts. For example, parameters passed to it won't be reported as unused if the "function" call is replaced with 0 on SELinux disabled builds.
-rw-r--r--src/core/selinux-access.h9
1 files changed, 0 insertions, 9 deletions
diff --git a/src/core/selinux-access.h b/src/core/selinux-access.h
index da2e6cbd74..58f737de09 100644
--- a/src/core/selinux-access.h
+++ b/src/core/selinux-access.h
@@ -7,17 +7,8 @@
int mac_selinux_generic_access_check(sd_bus_message *message, const char *path, const char *permission, sd_bus_error *error);
-#if HAVE_SELINUX
-
#define mac_selinux_access_check(message, permission, error) \
mac_selinux_generic_access_check((message), NULL, (permission), (error))
#define mac_selinux_unit_access_check(unit, message, permission, error) \
mac_selinux_generic_access_check((message), unit_label_path(unit), (permission), (error))
-
-#else
-
-#define mac_selinux_access_check(message, permission, error) 0
-#define mac_selinux_unit_access_check(unit, message, permission, error) 0
-
-#endif