chiark / gitweb /
selinux: do not label files in runtime dir
[elogind.git] / libudev / libudev-queue-private.c
index 6109837..2f1afec 100644 (file)
@@ -103,10 +103,10 @@ void udev_queue_export_cleanup(struct udev_queue_export *udev_queue_export)
 {
        char filename[UTIL_PATH_SIZE];
 
-       util_strscpyl(filename, sizeof(filename), udev_get_dev_path(udev_queue_export->udev), "/.udev/queue.tmp", NULL);
+       util_strscpyl(filename, sizeof(filename), udev_get_run_path(udev_queue_export->udev), "/queue.tmp", NULL);
        unlink(filename);
 
-       util_strscpyl(filename, sizeof(filename), udev_get_dev_path(udev_queue_export->udev), "/.udev/queue.bin", NULL);
+       util_strscpyl(filename, sizeof(filename), udev_get_run_path(udev_queue_export->udev), "/queue.bin", NULL);
        unlink(filename);
 }
 
@@ -221,7 +221,7 @@ static int rebuild_queue_file(struct udev_queue_export *udev_queue_export)
        }
 
        /* create new queue file */
-       util_strscpyl(filename_tmp, sizeof(filename_tmp), udev_get_dev_path(udev_queue_export->udev), "/.udev/queue.tmp", NULL);
+       util_strscpyl(filename_tmp, sizeof(filename_tmp), udev_get_run_path(udev_queue_export->udev), "/queue.tmp", NULL);
        new_queue_file = fopen(filename_tmp, "w+");
        if (new_queue_file == NULL)
                goto error;
@@ -255,7 +255,7 @@ static int rebuild_queue_file(struct udev_queue_export *udev_queue_export)
                goto error;
 
        /* rename the new file on top of the old one */
-       util_strscpyl(filename, sizeof(filename), udev_get_dev_path(udev_queue_export->udev), "/.udev/queue.bin", NULL);
+       util_strscpyl(filename, sizeof(filename), udev_get_run_path(udev_queue_export->udev), "/queue.bin", NULL);
        if (rename(filename_tmp, filename) != 0)
                goto error;
 
@@ -401,7 +401,7 @@ static void update_failed(struct udev_queue_export *udev_queue_export,
                return;
 
        /* location of failed file */
-       util_strscpyl(filename, sizeof(filename), udev_get_dev_path(udev), "/.udev/failed/",
+       util_strscpyl(filename, sizeof(filename), udev_get_run_path(udev), "/failed/",
                      udev_device_get_subsystem(udev_device), ":", udev_device_get_sysname(udev_device), NULL);
 
        switch (state) {
@@ -409,9 +409,7 @@ static void update_failed(struct udev_queue_export *udev_queue_export,
                /* record event in the failed directory */
                udev_queue_export->failed_count++;
                util_create_path(udev, filename);
-               udev_selinux_setfscreatecon(udev, filename, S_IFLNK);
                symlink(udev_device_get_devpath(udev_device), filename);
-               udev_selinux_resetfscreatecon(udev);
                break;
 
        case DEVICE_QUEUED:
@@ -423,17 +421,6 @@ static void update_failed(struct udev_queue_export *udev_queue_export,
                break;
 
        case DEVICE_FINISHED:
-               if (udev_device_get_sysname_old(udev_device) != NULL &&
-                   strcmp(udev_device_get_sysname_old(udev_device), udev_device_get_sysname(udev_device)) != 0) {
-                       /* "move" event - rename failed file to current name, do not delete failed */
-                       char filename_old[UTIL_PATH_SIZE];
-
-                       util_strscpyl(filename_old, sizeof(filename_old), udev_get_dev_path(udev), "/.udev/failed/",
-                                     udev_device_get_subsystem(udev_device), ":", udev_device_get_sysname_old(udev_device), NULL);
-                       if (rename(filename_old, filename) == 0)
-                               info(udev, "renamed devpath, moved failed state of '%s' to %s'\n",
-                                    udev_device_get_devpath_old(udev_device), udev_device_get_devpath(udev_device));
-               }
                break;
        }