chiark / gitweb /
selinux: retest selinux after we loaded the policy
[elogind.git] / src / label.c
index a5994622c70ecef5e7ef03efb5e78503348a6151..fb9a1b426210c473385bba4e0f62daa6f90c943b 100644 (file)
@@ -33,8 +33,9 @@
 
 static struct selabel_handle *label_hnd = NULL;
 
+static int use_selinux_cached = -1;
+
 static inline bool use_selinux(void) {
-        static int use_selinux_cached = -1;
 
         if (use_selinux_cached < 0)
                 use_selinux_cached = is_selinux_enabled() > 0;
@@ -42,6 +43,10 @@ static inline bool use_selinux(void) {
         return use_selinux_cached;
 }
 
+void label_retest_selinux(void) {
+        use_selinux_cached = -1;
+}
+
 #endif
 
 int label_init(void) {