]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
core: dbus: Interpret released names properly (#6175)
authorMichal Koutný <Werkov@users.noreply.github.com>
Fri, 23 Jun 2017 00:26:04 +0000 (02:26 +0200)
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Fri, 23 Jun 2017 00:26:04 +0000 (20:26 -0400)
When a DBus name is released, NameOwnerChanged signal contains an empty string
as new_owner. Commit bbc2908 changed interpretation of the empty string to a
valid name, which is not consistent with values that are sent by dbus-daemon.

As a side effect, this masks symptoms of systemd-logind dbus disconnections
(#2925) by completely restarting it so it can freshly reconnect to dbus.

src/core/unit.c

index 191927830155d3c0e403c76426270c2b2ac4b60c..db4934a82f22e60fc78ce2d3670667f3769655f4 100644 (file)
@@ -2638,6 +2638,9 @@ static int signal_name_owner_changed(sd_bus_message *message, void *userdata, sd
                 return 0;
         }
 
+        old_owner = isempty(old_owner) ? NULL : old_owner;
+        new_owner = isempty(new_owner) ? NULL : new_owner;
+
         if (UNIT_VTABLE(u)->bus_name_owner_change)
                 UNIT_VTABLE(u)->bus_name_owner_change(u, name, old_owner, new_owner);