chiark / gitweb /
selinux: automatically load policy if the initrd hasn't done this for us yet
[elogind.git] / src / label.c
index 809b1ee64656fb5a75c590a73ee16c44551f28b5..01f36eb6ccc56a1830c898827717815963b67763 100644 (file)
@@ -51,6 +51,9 @@ int label_init(void) {
         if (!use_selinux())
                 return 0;
 
         if (!use_selinux())
                 return 0;
 
+        if (label_hnd)
+                return 0;
+
         label_hnd = selabel_open(SELABEL_CTX_FILE, NULL, 0);
         if (!label_hnd) {
                 log_full(security_getenforce() == 1 ? LOG_ERR : LOG_DEBUG,
         label_hnd = selabel_open(SELABEL_CTX_FILE, NULL, 0);
         if (!label_hnd) {
                 log_full(security_getenforce() == 1 ? LOG_ERR : LOG_DEBUG,