From: Alan Jenkins Date: Sat, 16 Sep 2017 13:39:22 +0000 (+0100) Subject: sd-bus: fix response for GetAll on non-existent objects X-Git-Tag: v235~75^2~1 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=733e792bc603f580c7a0e3031917982bb7399994;p=thirdparty%2Fsystemd.git sd-bus: fix response for GetAll on non-existent objects Before this commit, if you run `loginctl user-status` from debug-shell.service (and you have no login sessions for root), you always see this output: 0 Linger: no because Properties.GetAll is returning success but without any properties, when the only find() callback had returned 0 to mean "no object found". After: Could not get properties: Unknown object: '/org/freedesktop/login1/user/self' BTW I have a fix for more user-friendly messages from logind in this case. It is pending in my local branch for #6829 "fix `loginctl enable-linger`". --- diff --git a/src/libsystemd/sd-bus/bus-objects.c b/src/libsystemd/sd-bus/bus-objects.c index bb06d302ca1..a4c0cc5db1f 100644 --- a/src/libsystemd/sd-bus/bus-objects.c +++ b/src/libsystemd/sd-bus/bus-objects.c @@ -829,6 +829,9 @@ static int property_get_all_callbacks_run( return 0; } + if (!*found_object) + return 0; + if (!found_interface) { r = sd_bus_reply_method_errorf( m,