summaryrefslogtreecommitdiff
path: root/src/login/logind-core.c
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2018-12-13 18:36:57 +0100
committerLennart Poettering <lennart@poettering.net>2020-09-01 17:40:13 +0200
commit643bb9240832c238a28cb36efc9d1a6c8d7e6ea0 (patch)
tree40c7692479ae74d79f886133aa05ca80b7c1fdda /src/login/logind-core.c
parentfccb48b286dcfc07f86d3e376829086294dfd978 (diff)
downloadsystemd-643bb9240832c238a28cb36efc9d1a6c8d7e6ea0.tar.gz
logind: always check current tag list before using a device
Diffstat (limited to 'src/login/logind-core.c')
-rw-r--r--src/login/logind-core.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/src/login/logind-core.c b/src/login/logind-core.c
index e0d61f3e75..0487182225 100644
--- a/src/login/logind-core.c
+++ b/src/login/logind-core.c
@@ -243,7 +243,8 @@ int manager_process_seat_device(Manager *m, sd_device *d) {
assert(m);
- if (device_for_action(d, DEVICE_ACTION_REMOVE)) {
+ if (device_for_action(d, DEVICE_ACTION_REMOVE) ||
+ sd_device_has_current_tag(d, "seat") <= 0) {
const char *syspath;
r = sd_device_get_syspath(d, &syspath);
@@ -271,7 +272,7 @@ int manager_process_seat_device(Manager *m, sd_device *d) {
}
seat = hashmap_get(m->seats, sn);
- master = sd_device_has_tag(d, "master-of-seat") > 0;
+ master = sd_device_has_current_tag(d, "master-of-seat") > 0;
/* Ignore non-master devices for unknown seats */
if (!master && !seat)
@@ -313,7 +314,8 @@ int manager_process_button_device(Manager *m, sd_device *d) {
if (r < 0)
return r;
- if (device_for_action(d, DEVICE_ACTION_REMOVE)) {
+ if (device_for_action(d, DEVICE_ACTION_REMOVE) ||
+ sd_device_has_current_tag(d, "power-switch") <= 0) {
b = hashmap_get(m->buttons, sysname);
if (!b)