From cad45ba11ec3572296361f53f5852ffb97a97fa3 Mon Sep 17 00:00:00 2001 From: Lennart Poettering Date: Tue, 2 Oct 2012 17:07:00 -0400 Subject: selinux: rework selinux access check logic a) Instead of parsing the bus messages inside of selinux-access.c simply pass everything pre-parsed in the functions b) implement the access checking with a macro that resolves to nothing on non-selinux builds c) split out the selinux checks into their own sources selinux-util.[ch] d) this unifies the job creation code behind the D-Bus calls Manager.StartUnit() and Unit.Start(). --- src/shared/label.c | 15 +-------------- 1 file changed, 1 insertion(+), 14 deletions(-) (limited to 'src/shared/label.c') diff --git a/src/shared/label.c b/src/shared/label.c index 7aa362106e..2062fc316c 100644 --- a/src/shared/label.c +++ b/src/shared/label.c @@ -31,25 +31,12 @@ #include "path-util.h" #ifdef HAVE_SELINUX +#include "selinux-util.h" #include #include static struct selabel_handle *label_hnd = NULL; -static int use_selinux_cached = -1; - -static inline bool use_selinux(void) { - - if (use_selinux_cached < 0) - use_selinux_cached = is_selinux_enabled() > 0; - - return use_selinux_cached; -} - -void label_retest_selinux(void) { - use_selinux_cached = -1; -} - #endif int label_init(const char *prefix) { -- cgit v1.2.3-54-g00ecf