After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 788594 - gdbus-tool doesn’t handle non-message-bus connections correctly
gdbus-tool doesn’t handle non-message-bus connections correctly
Status: RESOLVED FIXED
Product: glib
Classification: Platform
Component: gio
unspecified
Other Linux
: Normal normal
: ---
Assigned To: gtkdev
gtkdev
Depends on:
Blocks:
 
 
Reported: 2017-10-06 12:26 UTC by Catalin
Modified: 2018-02-19 14:11 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
gdbus-tool: Fix tab-completion for non-message-bus connections (5.14 KB, patch)
2017-10-09 09:47 UTC, Philip Withnall
committed Details | Review
gdbus-tool: Fix some invalid indentation (867 bytes, patch)
2017-10-09 09:47 UTC, Philip Withnall
committed Details | Review
gdbus-tool: Add tab completion support to `gdbus emit` (7.26 KB, patch)
2017-10-09 09:47 UTC, Philip Withnall
committed Details | Review

Description Catalin 2017-10-06 12:26:26 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
Comment 1 Philip Withnall 2017-10-09 09:43:49 UTC
(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.
Comment 2 Philip Withnall 2017-10-09 09:47:24 UTC
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>
Comment 3 Philip Withnall 2017-10-09 09:47:29 UTC
Created attachment 361169 [details] [review]
gdbus-tool: Fix some invalid indentation

Signed-off-by: Philip Withnall <withnall@endlessm.com>
Comment 4 Philip Withnall 2017-10-09 09:47:35 UTC
Created attachment 361170 [details] [review]
gdbus-tool: Add tab completion support to `gdbus emit`

Signed-off-by: Philip Withnall <withnall@endlessm.com>
Comment 5 Catalin 2017-10-09 10:10:26 UTC
Dear, team,

Thank you for your for support !!!
Comment 6 Philip Withnall 2017-10-09 11:08:51 UTC
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.
Comment 7 Emmanuele Bassi (:ebassi) 2017-10-11 10:31:57 UTC
Review of attachment 361168 [details] [review]:

Looks good.
Comment 8 Emmanuele Bassi (:ebassi) 2017-10-11 10:32:15 UTC
Review of attachment 361169 [details] [review]:

Ok.
Comment 9 Emmanuele Bassi (:ebassi) 2017-10-11 10:35:25 UTC
Review of attachment 361170 [details] [review]:

Nice
Comment 10 Philip Withnall 2017-10-11 11:18:43 UTC
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`