Can not use remote dbus; weird auth situation

Mika Boström mika.bostrom at nomovok.com
Mon May 19 06:52:05 PDT 2008


  Good day.

  I have been trying to tie some applications over several headless
machines together. For the moment I'm prototyping with tracker. Idea is
to attach to (session) bus on another host over TCP transport and use
the services on that machine directly. As far as I understand, this
scenario should be directly supported.

  Platform: Linux (Debian, Ubuntu; no odd patches on functionality)
  Versions tested: 1.1.1, 1.1.20
  For debugging purposes, remote session bus has the following policy:
  <allow send_interface="org.freedesktop.*" />
  <allow receive_interface="org.freedesktop.*" />
  <allow send_interface="com.debug.*" />
  <allow receive_interface="com.debug.*" />

  com.debug.foo.. is for my testing needs.

  The problem I face is that no client can use the remote bus. Session
bus address is set correctly. Moreover, when wondering what goes wrong I
dumped the session traffic. What I discovered is that the following
sequence takes place. Everything goes well and according to the
specification until client tries ANONYMOUS authentication method.
Dbus-daemon from the remote end responds by OK, which should mean that
client can now continue with the regular dbus traffic. But no.

   I turned my results into a sequence diagram to better visualize what
goes on:


 dbus-client                                          dbus-daemon
    |                                                      |
    |               0x00                                   |
    +----------------------------------------------------->|
    |               TCP ACK                                |
    |<--  --  --  --  --  --  --  --  --  --  --  --  --  -+
    |                                                      |
    |   AUTH EXTERNAL <number>*                            |
    +----------------------------------------------------->|
    |                                                      |
    |   REJECTED EXTERNAL DBUS_COOKIE_SHA1 ANONYMOUS       |
    |<-----------------------------------------------------+
    |                                                      |
    |   AUTH DBUS_COOKIE_SHA1 <number>*                    |
    +----------------------------------------------------->|
    |                                                      |
    |   DATA <hex-encoded "org_freedesktop...">            |
    |<-----------------------------------------------------+
    |                                                      |
    |   ERROR "Don't have requested cookie ID"             |
    +----------------------------------------------------->|
    |                                                      |
    |   REJECTED EXTERNAL DBUS_COOKIE_SHA1 ANONYMOUS       |
    |<-----------------------------------------------------+
    |                                                      |
    |   AUTH ANONYMOUS "libdbus 1.1.20"                    |
    +----------------------------------------------------->|
    |                                                      |
    |   OK <guid>                                          |
    |<-----------------------------------------------------+
    |                                                      |
    |   BEGIN                                              |
    +----------------------------------------------------->|
    |                                                      |
    |   <TCP FIN; ACK to BEGIN message>                    |
    |<-----------------------------------------------------+ ???
    |                                                      |
* <number> is the same in both


  As you can see, immediately after daemon's OK, client sends out BEGIN.
Any following packet should be the dbus traffic. Why does the remote
daemon then terminate the connection in response to BEGIN message? This
doesn't make sense.

  Please help me understand the situation here. I feel that I am not far
from a working, first-step solution but simply can not get over this
particular hurdle.

  What am I doing wrong?

-- 
 Mika Boström / mika.bostrom at nomovok.com



More information about the dbus mailing list