chiark
/
gitweb
/
~ianmdlvl
/
elogind.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
5611631
)
limit $attr(<symlink>) magic to well-known links only
author
Kay Sievers
<kay.sievers@vrfy.org>
Mon, 17 Nov 2008 01:01:37 +0000
(
02:01
+0100)
committer
Kay Sievers
<kay.sievers@vrfy.org>
Mon, 17 Nov 2008 01:01:37 +0000
(
02:01
+0100)
udev/lib/libudev-device.c
patch
|
blob
|
history
diff --git
a/udev/lib/libudev-device.c
b/udev/lib/libudev-device.c
index c4714e4088d1a8dc6f1b5b0cc774fab307bf6e12..055263bbef750232c22d48ff1b535f19ec634448 100644
(file)
--- a/
udev/lib/libudev-device.c
+++ b/
udev/lib/libudev-device.c
@@
-859,11
+859,16
@@
const char *udev_device_get_sysattr_value(struct udev_device *udev_device, const
}
if (S_ISLNK(statbuf.st_mode)) {
- /* links return the last element of the target path */
char target[UTIL_NAME_SIZE];
int len;
char *pos;
+ /* some core links return the last element of the target path */
+ if (strcmp(sysattr, "driver") != 0 &&
+ strcmp(sysattr, "subsystem") != 0 &&
+ strcmp(sysattr, "module") != 0)
+ goto out;
+
len = readlink(path, target, sizeof(target));
if (len > 0) {
target[len] = '\0';