[systemd-commits] src/udev

Kay Sievers kay at kemper.freedesktop.org
Wed Oct 30 01:59:27 CET 2013


 src/udev/udev-rules.c |   22 ++++++----------------
 1 file changed, 6 insertions(+), 16 deletions(-)

New commits:
commit 0aa5b4d1f7247e9e5ff2bd59f287196e20c03296
Author: Kay Sievers <kay at vrfy.org>
Date:   Wed Oct 30 01:57:47 2013 +0100

    udev: do not allow to change the DEVPATH of a device

diff --git a/src/udev/udev-rules.c b/src/udev/udev-rules.c
index 4437d80..41b8d53 100644
--- a/src/udev/udev-rules.c
+++ b/src/udev/udev-rules.c
@@ -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;
 }
 



More information about the systemd-commits mailing list