X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?a=blobdiff_plain;f=src%2Flogind-acl.c;h=2aa5866ccd579315f57d2105da6f2fc804106696;hb=1c7dde3e475978c569a982d65fd86d4b4e3caad8;hp=7571093d0ef94c56874b38465e283a7f38f34867;hpb=734b933ace7aac5d9c1d7507f9d30f73390ce102;p=elogind.git diff --git a/src/logind-acl.c b/src/logind-acl.c index 7571093d0..2aa5866cc 100644 --- a/src/logind-acl.c +++ b/src/logind-acl.c @@ -222,23 +222,23 @@ int devnode_acl_all(struct udev *udev, assert(udev); - if (!seat) + if (isempty(seat)) seat = "seat0"; e = udev_enumerate_new(udev); if (!e) return -ENOMEM; + /* We can only match by one tag in libudev. We choose + * "uaccess" for that. If we could match for two tags here we + * could add the seat name as second match tag, but this would + * be hardly optimizable in libudev, and hence checking the + * second tag manually in our loop is a good solution. */ + r = udev_enumerate_add_match_tag(e, "uaccess"); if (r < 0) goto finish; - if (!streq(seat, "seat0")) { - r = udev_enumerate_add_match_tag(e, seat); - if (r < 0) - goto finish; - } - r = udev_enumerate_scan_devices(e); if (r < 0) goto finish; @@ -254,8 +254,8 @@ int devnode_acl_all(struct udev *udev, goto finish; } - sn = udev_device_get_property_value(d, "SEAT"); - if (!sn) + sn = udev_device_get_property_value(d, "ID_SEAT"); + if (isempty(sn)) sn = "seat0"; if (!streq(seat, sn)) { @@ -270,6 +270,8 @@ int devnode_acl_all(struct udev *udev, goto finish; } + log_debug("Fixing up %s for seat %s...", node, sn); + r = devnode_acl(node, flush, del, old_uid, add, new_uid); udev_device_unref(d);