20788N/Acommit 92b09c0d1863c4de1bae1fbbbf78bd02fad91a5e
20788N/AAuthor: Halton Huo <halton.huo@sun.com>
20788N/ADate: Thu May 27 14:40:41 2010 +0800
20788N/A@@ -77,6 +77,7 @@ struct GdmServerPrivate
20788N/A@@ -271,15 +272,43 @@ _gdm_server_query_ck_for_display_device (GdmServer *server)
20788N/A g_warning ("Could not run helper: %s", error->message);
20788N/A- g_debug ("GdmServer: Got tty: '%s'", out);
20788N/A+ /* There are several scenarios that the device will be "?"
20788N/A+ * 1. Local sessions without VT support. If the display is ":0",
20788N/A+ * This only happens on those systems do not has VT support such as
20788N/A+ * old Solaris. So far, Linux and OpenSolaris with VT support.
20788N/A+ * 3. Local sessions like SunRay, Xvfb, Xvnc, we set device as
20788N/A+ if (!server->priv->is_local) {
20788N/A+ /* This is for XDMCP sessions. */
20788N/A+ if (g_str_equal (server->priv->display_name, ":0")) {
20788N/A+ /* This is for local session run on console. */
20788N/A+ /* This is for local sessions like
20788N/A+ g_debug ("GdmServer: Got tty: '%s'", out);
20788N/A@@ -1229,5 +1258,23 @@ gdm_server_new (const char *display_id)
20788N/A server->priv->auth_file = NULL;
20788N/A+ res = dbus_g_proxy_call (proxy,
20788N/A+ G_TYPE_BOOLEAN, &server->priv->is_local,
20788N/A+ g_warning ("Failed to get value: %s", error->message);
20788N/A+ g_warning ("Failed to get value");
20788N/A@@ -615,6 +617,46 @@ on_console_session_changed (GdmSession *session,
20788N/A+create_device (const char *dev)
20788N/A+ if (dev == NULL || dev[0] == '\0')
20788N/A+ memset (buf, 0, sizeof (gchar) * (MAXPATHLEN + 1));
20788N/A+ g_debug ("Creating pseudo-device %s", dev);
20788N/A+ } else if (readlink (dev, buf, MAXPATHLEN) > 0) {
20788N/A+ if ((utime (dev, &timebuf)) != 0)
20788N/A+ g_debug ("Problem updating access time of pseudo-device %s", dev);
20788N/A+ g_debug ("Touching pseudo-device %s", dev);
20788N/A+ g_debug ("Device %s points to %s", dev, buf);
20788N/A+ g_debug ("Device %s is not a symlink", dev);
20788N/A create_new_session (GdmSimpleSlave *slave)
20788N/A@@ -638,6 +680,9 @@ create_new_session (GdmSimpleSlave *slave)
20788N/A if (slave->priv->server != NULL) {
20788N/A display_device = gdm_server_get_display_device (slave->priv->server);
20788N/A+ if (!display_device && !display_is_local)
20788N/A+ create_device (display_device);
20788N/A slave->priv->session = gdm_session_direct_new (display_id,
20788N/A@@ -963,6 +1008,10 @@ start_greeter (GdmSimpleSlave *slave)
20788N/A display_device = gdm_server_get_display_device (slave->priv->server);
20788N/A+ if (!display_device && !display_is_local)
20788N/A+ create_device (display_device);
20788N/A /* FIXME: send a signal back to the master */