chiark / gitweb /
selinux: rework selinux access check logic
[elogind.git] / src / shared / label.c
index 7aa362106e39871077a6d1e6c47d27e41bd2bf17..2062fc316c5dc52c4366d7a8868d6362d65820f1 100644 (file)
 #include "path-util.h"
 
 #ifdef HAVE_SELINUX
+#include "selinux-util.h"
 #include <selinux/selinux.h>
 #include <selinux/label.h>
 
 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) {