]> err.no Git - systemd/commitdiff
acl: libudev currently doesn't handle properly enumerator matches with multiple tags...
authorLennart Poettering <lennart@poettering.net>
Wed, 29 Jun 2011 17:41:07 +0000 (19:41 +0200)
committerLennart Poettering <lennart@poettering.net>
Wed, 29 Jun 2011 17:41:07 +0000 (19:41 +0200)
TODO
src/logind-acl.c
src/logind.c
src/logind.h
src/uaccess.c

diff --git a/TODO b/TODO
index 86f2d72e711c8c85656cb8885dc6e21f656e5094..155f09fc83bddae6150284ca6f8c4042eda93932 100644 (file)
--- a/TODO
+++ b/TODO
@@ -22,6 +22,9 @@ F15 External:
 * fix broken Sockets=syslog-ng.socket packaging
 
 Features:
+
+* understand https://bugzilla.redhat.com/show_bug.cgi?id=672194
+
 * possibly set timezone offset from systemd at init instead
   of calling hwclock
 
index 7571093d0ef94c56874b38465e283a7f38f34867..59af981a5ecb5d33c56830e4a877af4dab288f4d 100644 (file)
@@ -222,7 +222,7 @@ int devnode_acl_all(struct udev *udev,
 
         assert(udev);
 
-        if (!seat)
+        if (isempty(seat))
                 seat = "seat0";
 
         e = udev_enumerate_new(udev);
@@ -233,11 +233,13 @@ int devnode_acl_all(struct udev *udev,
         if (r < 0)
                 goto finish;
 
-        if (!streq(seat, "seat0")) {
-                r = udev_enumerate_add_match_tag(e, seat);
-                if (r < 0)
-                        goto finish;
-        }
+        /* FIXME: when libudev is able to handle multiple match tags
+         * properly, optimize the search here a bit */
+        /* 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)
@@ -254,8 +256,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 +272,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);
 
index 9bab8751318153886d86001a31a94a133d983b33..cbc878e68234a01a27edb2d1537e7c4e7a58c126 100644 (file)
@@ -286,7 +286,7 @@ int manager_process_seat_device(Manager *m, struct udev_device *d) {
                 Seat *seat;
 
                 sn = udev_device_get_property_value(d, "ID_SEAT");
-                if (!sn)
+                if (isempty(sn))
                         sn = "seat0";
 
                 if (!seat_name_is_valid(sn)) {
index aaa21cddda643e181c0bd96773e25a49914b2c42..7e47bc34895da77257c9741a8dadce651326977f 100644 (file)
@@ -45,6 +45,7 @@
  * trigger based on libudev if available
  * enumerate recursively with libudev when triggering
  * 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
  * reboot/shutdown halt management
index 2f6ac43754b450dfff8dafcf50be235868d144e0..1683707977e68964ea58aca1811e44e0413bef84 100644 (file)
@@ -44,7 +44,7 @@ int main(int argc, char *argv[]) {
         }
 
         path = argv[1];
-        seat = argc >= 3 ? argv[2] : "seat0";
+        seat = argc < 3 || isempty(argv[2]) ? "seat0" : argv[2];
 
         p = strappend("/run/systemd/seats/", seat);
         if (!p) {