X-Git-Url: https://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?p=elogind.git;a=blobdiff_plain;f=src%2Flogind-acl.c;h=7f9b0ca15ed91d65ca8777e7f7cb901340b548cc;hp=59af981a5ecb5d33c56830e4a877af4dab288f4d;hb=bccc1d8859175f0927652d694796892c9e9c21d6;hpb=539072153c0db3d91c1c59ad447d96b0e1f3cf77 diff --git a/src/logind-acl.c b/src/logind-acl.c index 59af981a5..7f9b0ca15 100644 --- a/src/logind-acl.c +++ b/src/logind-acl.c @@ -105,7 +105,7 @@ int devnode_acl(const char *path, bool add, uid_t new_uid) { acl_t acl; - int r; + int r = 0; bool changed = false; assert(path); @@ -229,18 +229,16 @@ int devnode_acl_all(struct udev *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; - /* 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) goto finish;