sd-bus: fix response for GetAll on non-existent objects
authorAlan Jenkins <alan.christopher.jenkins@gmail.com>
Sat, 16 Sep 2017 13:39:22 +0000 (14:39 +0100)
committerAlan Jenkins <alan.christopher.jenkins@gmail.com>
Sun, 17 Sep 2017 16:54:54 +0000 (17:54 +0100)
commit733e792bc603f580c7a0e3031917982bb7399994
treefb5fe0135de7ad29282698136404b00ac730ba71
parentc13ee7cc8be47b7d7a87b69b2ce9d3f35d530cee
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`".
src/libsystemd/sd-bus/bus-objects.c