chiark / gitweb /
udev: do not allow to change the DEVPATH of a device
authorKay Sievers <kay@vrfy.org>
Wed, 30 Oct 2013 00:57:47 +0000 (01:57 +0100)
committerKay Sievers <kay@vrfy.org>
Wed, 30 Oct 2013 00:58:26 +0000 (01:58 +0100)
src/udev/udev-rules.c

index 4437d80529e81d85b3ed056261cae1ed278634cf..41b8d53db23fe702b884c9a9485297ddedb417a1 100644 (file)
@@ -551,6 +551,7 @@ static int import_property_from_string(struct udev_device *dev, char *line)
         char *key;
         char *val;
         size_t len;
+        struct udev_list_entry *entry;
 
         /* find key */
         key = line;
@@ -601,22 +602,11 @@ static int import_property_from_string(struct udev_device *dev, char *line)
                 val++;
         }
 
-        /* handle device, renamed by external tool, returning new path */
-        if (streq(key, "DEVPATH")) {
-                char syspath[UTIL_PATH_SIZE];
-
-                log_debug("updating devpath from '%s' to '%s'\n",
-                          udev_device_get_devpath(dev), val);
-                strscpyl(syspath, sizeof(syspath), "/sys", val, NULL);
-                udev_device_set_syspath(dev, syspath);
-        } else {
-                struct udev_list_entry *entry;
-
-                entry = udev_device_add_property(dev, key, val);
-                /* store in db, skip private keys */
-                if (key[0] != '.')
-                        udev_list_entry_set_num(entry, true);
-        }
+        entry = udev_device_add_property(dev, key, val);
+        /* store in db, skip private keys */
+        if (key[0] != '.')
+                udev_list_entry_set_num(entry, true);
+
         return 0;
 }