chiark / gitweb /
mkdir: append _label to all mkdir() calls that explicitly set the selinux context
[elogind.git] / src / libudev / libudev-device-private.c
index 2c50e174c6d919c179f5a3ec9b08eb5aecf70984..bdb0e70c116c42ab3b3fb4628d027e25849f1b66 100644 (file)
@@ -35,7 +35,7 @@ static void udev_device_tag(struct udev_device *dev, const char *tag, bool add)
         if (add) {
                 int fd;
 
-                mkdir_parents(filename, 0755);
+                mkdir_parents_label(filename, 0755);
                 fd = open(filename, O_WRONLY|O_CREAT|O_CLOEXEC|O_TRUNC|O_NOFOLLOW, 0444);
                 if (fd >= 0)
                         close(fd);
@@ -119,10 +119,10 @@ int udev_device_update_db(struct udev_device *udev_device)
 
         /* write a database file */
         util_strscpyl(filename_tmp, sizeof(filename_tmp), filename, ".tmp", NULL);
-        mkdir_parents(filename_tmp, 0755);
+        mkdir_parents_label(filename_tmp, 0755);
         f = fopen(filename_tmp, "we");
         if (f == NULL) {
-                err(udev, "unable to create temporary db file '%s': %m\n", filename_tmp);
+                udev_err(udev, "unable to create temporary db file '%s': %m\n", filename_tmp);
                 return -1;
         }
 
@@ -162,7 +162,7 @@ int udev_device_update_db(struct udev_device *udev_device)
 
         fclose(f);
         rename(filename_tmp, filename);
-        dbg(udev, "created %s file '%s' for '%s'\n", has_info ? "db" : "empty",
+        udev_dbg(udev, "created %s file '%s' for '%s'\n", has_info ? "db" : "empty",
              filename, udev_device_get_devpath(udev_device));
         return 0;
 }