Problem using the latest D-Bus enabled GDM on Solaris

Brian Cameron Brian.Cameron at Sun.COM
Fri Sep 7 16:33:46 PDT 2007


Havoc:

I notice that we are setting up the socket as follows.  I'm a bit confused
by setting the auth_mechanism to "EXTERNAL".  Perhaps I need additional setup
to support this?

         const char *auth_mechanisms[] = {"EXTERNAL", NULL};

         address = generate_address ();

         dbus_error_init (&error);
         session->priv->server = dbus_server_listen (address, &error);
         g_free (address);
         dbus_server_setup_with_g_main (session->priv->server, NULL);
         dbus_server_set_auth_mechanisms (session->priv->server,
              auth_mechanisms);
         dbus_server_set_new_connection_function (session->priv->server,
                                                  handle_connection,
                                                  session,
                                                  NULL);

Perhaps one reason it might not work on Solaris, is that the
generate_address function seems to be written to only work on Linux?

static char *
generate_address (void)
{
         char *path;
#if defined (__linux__)
         int   i;
         char  tmp[9];

         for (i = 0; i < 8; i++) {
                 if (g_random_int_range (0, 2) == 0) {
                         tmp[i] = g_random_int_range ('a', 'z' + 1);
                 } else {
                         tmp[i] = g_random_int_range ('A', 'Z' + 1);
                 }
         }
         tmp[8] = '\0';

         path = g_strdup_printf ("unix:abstract=/tmp/gdm-session-%s", tmp);
#else
         path = g_strdup ("unix:tmpdir=/tmp");
#endif

         return path;
}

Is it the case that abstract sockets only works on Linux?  It seems that
using the /tmp directory might not work for what the new GDM code is
trying to do.

Brian

> man page for dbus-daemon has a section called Debugging that explains
> how to get tons of debug output. You may have to rebuild with verbose
> mode enabled though. Simply doing an strace (or truss or whatever) may
> also help.
> 
> I don't understand enough about your setup here to guess what's going
> wrong. With the usual dbus setup, the file in /tmp would not be owned
> by root, and also the file would be obtained from
> DBUS_SESSION_BUS_ADDRESS set on user login, which I'd assume is not
> available to gdm.
> 
> So you presumably have something custom going on here, which you would
> have to explain the intent of and mechanism for before I'd have any
> advice.
> 
> Havoc



More information about the dbus mailing list