how to get the DBusConnection for dbus_connection_dispatch from a DBusWatch of a DBusServer ?

Alexander Neundorf neundorf at eit.uni-kl.de
Wed Jul 1 00:34:02 PDT 2009


On Friday 19 June 2009 16:12:39 Havoc Pennington wrote:
> Hi,
>
> On Fri, Jun 19, 2009 at 2:49 AM, Alexander
>
> Neundorf<neundorf at eit.uni-kl.de> wrote:
> > Should, at least the client sends one.
> > How can I find out ?
> > dbus-monitor doesn't work since I'm trying to do peer-to-peer.
> > Are there any environment variables to enable debug output ?
>
> You can use DBUS_VERBOSE=1 but only with a specially-compiled dbus
> (see "man dbus-daemon")

Ok, we have some more information.
We assume that there is something going wrong with authentication:

The client starts with the authentication:

16724: Finally maybe_authenticated - FALSE
16724: DBUS_AUTH_STATE_HAVE_BYTES_TO_SEND
16724: in iteration, need_read=0 need_write=1
16724: Finally maybe_authenticated - FALSE
16724: Finally maybe_authenticated - FALSE
16724: exchange_credentials: do_reading = 0, do_writing = 1
16724: wrote credentials byte
16724: DBUS_AUTH_STATE_HAVE_BYTES_TO_SEND
16724:  client auth state: bytes to send
16724: client: Sent 24 bytes of: AUTH EXTERNAL 31303030
16724: maybe_authenticated = TRUE
16724: DBUS_AUTH_STATE_WAITING_FOR_INPUT
16724: maybe_authenticated falls back to FALSE
16724: Finally maybe_authenticated - FALSE
16724: exchange_credentials: do_reading = 0, do_writing = 1
16724: DBUS_AUTH_STATE_WAITING_FOR_INPUT
16724:  client auth state: waiting for input
16724: maybe_authenticated = TRUE
16724: DBUS_AUTH_STATE_WAITING_FOR_INPUT


but somehow never gets out of the DBUS_AUTH_STATE_WAITING_FOR_INPUT state, 
i.e. there are many more lines like that.

On the server side I see this:

...
16721: _dbus_connection_acquire_io_path end connection->io_path_acquired = 1 
we_acquired = 1
16721: _dbus_connection_acquire_io_path unlocking io_path_mutex
16721:   LOCK: _dbus_connection_acquire_io_path
16721: handling read watch 0xd63e10 flags = 1
16721: Finally maybe_authenticated - FALSE
16721: Finally maybe_authenticated - FALSE
16721: exchange_credentials: do_reading = 1, do_writing = 0
16721: read credentials byte
16721: Credentials:  pid 16724  uid 1000
16721: DBUS_AUTH_STATE_WAITING_FOR_INPUT
16721:  server auth state: waiting for input
16721:  read 24 bytes in auth phase
16721: maybe_authenticated = TRUE
16721: server: got command "AUTH EXTERNAL 31303030"
16721: server: Trying mechanism EXTERNAL
16721: server: data: '1000'
16721: No cache for UID 1000
16721: Using cache for UID 1000 information
16721: server: going from state WaitingForAuth to state WaitingForBegin
16721: server: authenticated client based on socket credentials
16721: DBUS_AUTH_STATE_HAVE_BYTES_TO_SEND
16721: maybe_authenticated falls back to FALSE
16721: Finally maybe_authenticated - FALSE
16721: exchange_credentials: do_reading = 1, do_writing = 0
16721: DBUS_AUTH_STATE_HAVE_BYTES_TO_SEND

So the server receives something.

Am I right that here something is going wrong ?
If so, what do I have to do in the server to make it work ?

Alex



More information about the dbus mailing list