From 0aa5b4d1f7247e9e5ff2bd59f287196e20c03296 Mon Sep 17 00:00:00 2001 From: Kay Sievers Date: Wed, 30 Oct 2013 01:57:47 +0100 Subject: udev: do not allow to change the DEVPATH of a device --- src/udev/udev-rules.c | 22 ++++++---------------- 1 file changed, 6 insertions(+), 16 deletions(-) (limited to 'src') diff --git a/src/udev/udev-rules.c b/src/udev/udev-rules.c index 4437d80529..41b8d53db2 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; } -- cgit v1.2.3-54-g00ecf