summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlan Jenkins <alan.christopher.jenkins@gmail.com>2017-09-16 14:39:22 +0100
committerSven Eden <yamakuzure@gmx.net>2017-09-16 14:39:22 +0100
commit181ff29f0bcf43c18a91b24e26c1b5431c2db1e5 (patch)
treeaa0f00849c578671340073c5e64af662a251e5fc
parentbe101abd86d769b320fd6d40ff73e881474ca462 (diff)
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`".
-rw-r--r--src/libelogind/sd-bus/bus-objects.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/libelogind/sd-bus/bus-objects.c b/src/libelogind/sd-bus/bus-objects.c
index ef05c68f4..0a58a8388 100644
--- a/src/libelogind/sd-bus/bus-objects.c
+++ b/src/libelogind/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,