SHA256
1
0
forked from pool/systemd
systemd/1012-libudev-do-not-resolve-attr-device-symlinks.patch

41 lines
2.0 KiB
Diff
Raw Normal View History

From 5ae18ddc0d86673520c0dd6b59ccac8afc8aa605 Mon Sep 17 00:00:00 2001
From: Kay Sievers <kay@vrfy.org>
Date: Tue, 20 Nov 2012 18:07:57 +0100
Subject: [PATCH] libudev: do not resolve $attr{device} symlinks
---
src/libudev/libudev-device.c | 19 ++++++++++---------
1 files changed, 10 insertions(+), 9 deletions(-)
Index: systemd-195/src/libudev/libudev-device.c
===================================================================
--- systemd-195.orig/src/libudev/libudev-device.c
+++ systemd-195/src/libudev/libudev-device.c
@@ -1369,16 +1369,17 @@ _public_ const char *udev_device_get_sys
goto out;
}
- /* resolve link to a device and return its syspath */
- util_strscpyl(path, sizeof(path), udev_device->syspath, "/", sysattr, NULL);
- dev = udev_device_new_from_syspath(udev_device->udev, path);
- if (dev != NULL) {
- list_entry = udev_list_entry_add(&udev_device->sysattr_value_list, sysattr,
- udev_device_get_syspath(dev));
- val = udev_list_entry_get_value(list_entry);
- udev_device_unref(dev);
+ /* resolve custom link to a device and return its syspath */
+ if (!streq(sysattr, "device")) {
+ util_strscpyl(path, sizeof(path), udev_device->syspath, "/", sysattr, NULL);
+ dev = udev_device_new_from_syspath(udev_device->udev, path);
+ if (dev != NULL) {
+ list_entry = udev_list_entry_add(&udev_device->sysattr_value_list, sysattr,
+ udev_device_get_syspath(dev));
+ val = udev_list_entry_get_value(list_entry);
+ udev_device_unref(dev);
+ }
}
-
goto out;
}