summaryrefslogtreecommitdiff
path: root/src/logind-dbus.c
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2011-06-28 21:54:52 +0200
committerLennart Poettering <lennart@poettering.net>2011-06-28 21:54:52 +0200
commitc28fa3d32fe0989c286d04406414bb7ef58dab9a (patch)
tree14bb268a026c8ff1a75d02dd5161202d58942d94 /src/logind-dbus.c
parent47a2669062882d1b4ed6ae3c7b8926e09f2a978e (diff)
logind: include subsystem name in device id for assigning seats
Diffstat (limited to 'src/logind-dbus.c')
-rw-r--r--src/logind-dbus.c11
1 files changed, 6 insertions, 5 deletions
diff --git a/src/logind-dbus.c b/src/logind-dbus.c
index 1ed99c0aa7..91f30320c6 100644
--- a/src/logind-dbus.c
+++ b/src/logind-dbus.c
@@ -553,7 +553,7 @@ static bool device_has_tag(struct udev_device *d, const char *tag) {
static int attach_device(Manager *m, const char *seat, const char *sysfs) {
struct udev_device *d;
char *rule = NULL, *file = NULL;
- const char *path;
+ const char *id_for_seat;
int r;
assert(m);
@@ -569,22 +569,23 @@ static int attach_device(Manager *m, const char *seat, const char *sysfs) {
goto finish;
}
- path = udev_device_get_property_value(d, "ID_PATH");
- if (!path) {
+ id_for_seat = udev_device_get_property_value(d, "ID_FOR_SEAT");
+ if (!id_for_seat) {
r = -ENODEV;
goto finish;
}
- if (asprintf(&file, "/etc/udev/rules.d/72-seat-%s.rules", path) < 0) {
+ if (asprintf(&file, "/etc/udev/rules.d/72-seat-%s.rules", id_for_seat) < 0) {
r = -ENOMEM;
goto finish;
}
- if (asprintf(&rule, "TAG==\"seat\", ID_PATH==\"%s\", ID_SEAT=\"%s\"", path, seat) < 0) {
+ if (asprintf(&rule, "TAG==\"seat\", ENV{ID_FOR_SEAT}==\"%s\", ENV{ID_SEAT}=\"%s\"", id_for_seat, seat) < 0) {
r = -ENOMEM;
goto finish;
}
+ mkdir_p("/etc/udev/rules.d", 0755);
r = write_one_line_file(file, rule);
finish: