]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
logind: only apply ACLs for device currently tagged with "uaccess"
authorLennart Poettering <lennart@poettering.net>
Thu, 13 Dec 2018 17:35:06 +0000 (18:35 +0100)
committerLennart Poettering <lennart@poettering.net>
Tue, 1 Sep 2020 15:40:12 +0000 (17:40 +0200)
This is about security, hence let's be particularly careful here: only
devices currenlty tagged with "uaccess" will get ACL management, and
it's not sufficient if they once were (though that is used for
filtering).

src/login/logind-acl.c

index 76af208af1a417687cdb055cc9bfc806750dc9ac..5b75d8f3621356c2c3920a39277449785782f9d4 100644 (file)
@@ -195,6 +195,10 @@ int devnode_acl_all(const char *seat,
         FOREACH_DEVICE(e, d) {
                 const char *node, *sn;
 
+                /* Make sure the tag is still in place */
+                if (sd_device_has_current_tag(d, "uaccess") <= 0)
+                        continue;
+
                 if (sd_device_get_property_value(d, "ID_SEAT", &sn) < 0 || isempty(sn))
                         sn = "seat0";