logind: fix emission of PropertiesChanged on seats
authorZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Mon, 21 Oct 2019 13:05:58 +0000 (15:05 +0200)
committerMichael Biebl <biebl@debian.org>
Tue, 19 Nov 2019 08:17:12 +0000 (08:17 +0000)
The story is the same as in 471cffcfb0e005b7c4044b3b52cc4f25d217efac:
device_attach() → seat_send_changed() → sd_bus_emit_properties_changed_strv()
→ emit_properties_changed_on_interface() → node_vtable_get_userdata()
→ seat_object_find(), which returns 0 because message == NULL.
But when we are emitting a signal, message is always NULL. Removing the
overeager check and assert in the called function allow the signal to be
emitted.

Fixes #13769.

(cherry picked from commit 8cc64c2a3640121745fdfaccc6eae896ac25a911)

Gbp-Pq: Name logind-fix-emission-of-PropertiesChanged-on-seats.patch

src/login/logind-dbus.c
src/login/logind-seat-dbus.c

index 679eb6a62ec0c2068f91aabb9681e46cfb755306..e994b1f1196d141df5bcc1939fb2b624ebbae0a7 100644 (file)
@@ -188,7 +188,6 @@ int manager_get_seat_from_creds(
         int r;
 
         assert(m);
-        assert(message);
         assert(ret);
 
         if (SEAT_IS_SELF(name) || SEAT_IS_AUTO(name)) {
index 3c589296115dc4cfb6022735ef6fcad1505a977e..99584908757170958725dcaf16fb4f68507d7449 100644 (file)
@@ -280,8 +280,6 @@ int seat_object_find(sd_bus *bus, const char *path, const char *interface, void
                 return -ENOMEM;
 
         message = sd_bus_get_current_message(bus);
-        if (!message)
-                return 0;
 
         r = manager_get_seat_from_creds(m, message, e, error, &seat);
         if (r == -ENXIO) {