GNOME Bugzilla – Bug 788594
gdbus-tool doesn’t handle non-message-bus connections correctly
Last modified: 2018-02-19 14:11:56 UTC
Hi, I'm trying to connect to a different dbus address(unix:abstract=/tmp/remotebus). This connection is not made successfully in case of using gdbus tool. Q: What is the pattern of the addresses in case of gdbus ? =========================================================== Debugging informations: The output is like that: sudo gdbus monitor -a "unix:abstract=/tmp/remotebus" (gdbus monitor:10385): GLib-GIO-CRITICAL **: g_dbus_is_name: assertion 'string != NULL' failed Error: (null) is not a valid bus name .......................................................... In case of dbus-monitor this has been successful: sudo dbus-monitor --address "unix:abstract=/tmp/remotebus" --monitor dbus-monitor: unable to enable new-style monitoring, your dbus-daemon is too old. Falling back to eavesdropping. signal time=1507292569.645937 sender=org.freedesktop.DBus -> destination=:1.780 serial=2 path=/org/freedesktop/DBus; interface=org.freedesktop.DBus; member=NameAcquired string ":1.780" signal time=1507292570.759559 sender=:1.0 -> destination=(null destination) serial=17831 path=/org
(In reply to Catalin from comment #0) > sudo gdbus monitor -a "unix:abstract=/tmp/remotebus" You need to specify a bus name to monitor using the --dest argument. For example, gdbus monitor -a unix:abstract=/tmp/remotebus --dest org.PulseAudio1 It’s a mandatory argument. See `man gdbus`. --- The bug here is that gdbus is not bailing out if your bus is not a message-bus (i.e. doesn’t implement org.freedesktop.DBus). I’ll attach a patch for that.
Created attachment 361168 [details] [review] gdbus-tool: Fix tab-completion for non-message-bus connections • `gdbus monitor` can’t work at all for non-message-bus connections, since it can’t subscribe to signals. • Other tab completions for names depend on the connection being a message bus connection, but we still need to print `--dest` (etc.) when tab completing them, even if we can’t print a list of available names. Signed-off-by: Philip Withnall <withnall@endlessm.com>
Created attachment 361169 [details] [review] gdbus-tool: Fix some invalid indentation Signed-off-by: Philip Withnall <withnall@endlessm.com>
Created attachment 361170 [details] [review] gdbus-tool: Add tab completion support to `gdbus emit` Signed-off-by: Philip Withnall <withnall@endlessm.com>
Dear, team, Thank you for your for support !!!
There is a bug here (which my patches attempt to fix, and need reviewing by another team member); it’s just not the bug you originally reported. Reopening.
Review of attachment 361168 [details] [review]: Looks good.
Review of attachment 361169 [details] [review]: Ok.
Review of attachment 361170 [details] [review]: Nice
Thanks for the review. Attachment 361168 [details] pushed as b3acf58 - gdbus-tool: Fix tab-completion for non-message-bus connections Attachment 361169 [details] pushed as 51e91e3 - gdbus-tool: Fix some invalid indentation Attachment 361170 [details] pushed as faf9440 - gdbus-tool: Add tab completion support to `gdbus emit`