chiark / gitweb /
logind: properly clean up user cgroups when they run empty
[elogind.git] / src / shared / label.c
index 2d7d42a40e7338a7f2ceb83266ab1399a5b5d34a..9a5f79d7aef91d928d448557fc5a55bb15443006 100644 (file)
@@ -90,9 +90,9 @@ int label_init(const char *prefix) {
 
                 l = after_mallinfo.uordblks > before_mallinfo.uordblks ? after_mallinfo.uordblks - before_mallinfo.uordblks : 0;
 
-                log_info("Successfully loaded SELinux database in %s, size on heap is %iK.",
-                         format_timespan(timespan, sizeof(timespan), after_timestamp - before_timestamp),
-                         (l+1023)/1024);
+                log_debug("Successfully loaded SELinux database in %s, size on heap is %iK.",
+                          format_timespan(timespan, sizeof(timespan), after_timestamp - before_timestamp),
+                          (l+1023)/1024);
         }
 #endif
 
@@ -263,15 +263,14 @@ void label_free(const char *label) {
 #endif
 }
 
-int label_mkdir(const char *path, mode_t mode) {
+int label_mkdir(const char *path, mode_t mode, bool apply) {
 
         /* Creates a directory and labels it according to the SELinux policy */
-
 #ifdef HAVE_SELINUX
         int r;
         security_context_t fcon = NULL;
 
-        if (!use_selinux() || !label_hnd)
+        if (!apply || !use_selinux() || !label_hnd)
                 goto skipped;
 
         if (path_is_absolute(path))