acl: libudev currently doesn't handle properly enumerator matches with multiple tags, so avoid using them for now

This commit is contained in:
Lennart Poettering 2011-06-29 19:41:07 +02:00
parent f5f32cd7ad
commit 539072153c
5 changed files with 18 additions and 10 deletions

3
TODO
View file

@ -22,6 +22,9 @@ F15 External:
* fix broken Sockets=syslog-ng.socket packaging * fix broken Sockets=syslog-ng.socket packaging
Features: Features:
* understand https://bugzilla.redhat.com/show_bug.cgi?id=672194
* possibly set timezone offset from systemd at init instead * possibly set timezone offset from systemd at init instead
of calling hwclock of calling hwclock

View file

@ -222,7 +222,7 @@ int devnode_acl_all(struct udev *udev,
assert(udev); assert(udev);
if (!seat) if (isempty(seat))
seat = "seat0"; seat = "seat0";
e = udev_enumerate_new(udev); e = udev_enumerate_new(udev);
@ -233,11 +233,13 @@ int devnode_acl_all(struct udev *udev,
if (r < 0) if (r < 0)
goto finish; goto finish;
if (!streq(seat, "seat0")) { /* FIXME: when libudev is able to handle multiple match tags
r = udev_enumerate_add_match_tag(e, seat); * properly, optimize the search here a bit */
if (r < 0) /* if (!streq(seat, "seat0")) { */
goto finish; /* r = udev_enumerate_add_match_tag(e, seat); */
} /* if (r < 0) */
/* goto finish; */
/* } */
r = udev_enumerate_scan_devices(e); r = udev_enumerate_scan_devices(e);
if (r < 0) if (r < 0)
@ -254,8 +256,8 @@ int devnode_acl_all(struct udev *udev,
goto finish; goto finish;
} }
sn = udev_device_get_property_value(d, "SEAT"); sn = udev_device_get_property_value(d, "ID_SEAT");
if (!sn) if (isempty(sn))
sn = "seat0"; sn = "seat0";
if (!streq(seat, sn)) { if (!streq(seat, sn)) {
@ -270,6 +272,8 @@ int devnode_acl_all(struct udev *udev,
goto finish; goto finish;
} }
log_debug("Fixing up %s for seat %s...", node, sn);
r = devnode_acl(node, flush, del, old_uid, add, new_uid); r = devnode_acl(node, flush, del, old_uid, add, new_uid);
udev_device_unref(d); udev_device_unref(d);

View file

@ -286,7 +286,7 @@ int manager_process_seat_device(Manager *m, struct udev_device *d) {
Seat *seat; Seat *seat;
sn = udev_device_get_property_value(d, "ID_SEAT"); sn = udev_device_get_property_value(d, "ID_SEAT");
if (!sn) if (isempty(sn))
sn = "seat0"; sn = "seat0";
if (!seat_name_is_valid(sn)) { if (!seat_name_is_valid(sn)) {

View file

@ -45,6 +45,7 @@
* trigger based on libudev if available * trigger based on libudev if available
* enumerate recursively with libudev when triggering * enumerate recursively with libudev when triggering
* use sysfs in device hash table, not sysname, when fb driver is fixed * use sysfs in device hash table, not sysname, when fb driver is fixed
* fix ACL enumeration as soon as libudev can properly handle two match tags when enumerating
* *
* non-local X11 server * non-local X11 server
* reboot/shutdown halt management * reboot/shutdown halt management

View file

@ -44,7 +44,7 @@ int main(int argc, char *argv[]) {
} }
path = argv[1]; path = argv[1];
seat = argc >= 3 ? argv[2] : "seat0"; seat = argc < 3 || isempty(argv[2]) ? "seat0" : argv[2];
p = strappend("/run/systemd/seats/", seat); p = strappend("/run/systemd/seats/", seat);
if (!p) { if (!p) {