diff options
author | Kay Sievers <kay@vrfy.org> | 2013-10-30 01:57:47 +0100 |
---|---|---|
committer | Kay Sievers <kay@vrfy.org> | 2013-10-30 01:58:26 +0100 |
commit | 0aa5b4d1f7247e9e5ff2bd59f287196e20c03296 (patch) | |
tree | 08bb813a906dd11f286fdb07d8b4f8fcef7934d3 /src/udev/udev-rules.c | |
parent | e0221a35c8a967b2c772f26fcb6ef2300216d0b0 (diff) |
udev: do not allow to change the DEVPATH of a device
Diffstat (limited to 'src/udev/udev-rules.c')
-rw-r--r-- | src/udev/udev-rules.c | 22 |
1 files changed, 6 insertions, 16 deletions
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; } |