Commit 1f539686 authored by William Jon McCann's avatar William Jon McCann

Add x11-display property to display. Move

remote-hostname from xdmcp display to parent class.
Set some defaults in slave so greeter and server start.

svn path=/branches/mccann-gobject/; revision=4916
parent b961c279
...@@ -47,8 +47,9 @@ static guint32 display_serial = 1; ...@@ -47,8 +47,9 @@ static guint32 display_serial = 1;
struct GdmDisplayPrivate struct GdmDisplayPrivate
{ {
char *id; char *id;
char *name; char *remote_hostname;
int number; int number;
char *x11_display;
int status; int status;
time_t creation_time; time_t creation_time;
char *cookie; char *cookie;
...@@ -64,8 +65,9 @@ struct GdmDisplayPrivate ...@@ -64,8 +65,9 @@ struct GdmDisplayPrivate
enum { enum {
PROP_0, PROP_0,
PROP_ID, PROP_ID,
PROP_NAME, PROP_REMOTE_HOSTNAME,
PROP_NUMBER, PROP_NUMBER,
PROP_X11_DISPLAY,
PROP_COOKIE, PROP_COOKIE,
PROP_BINARY_COOKIE, PROP_BINARY_COOKIE,
PROP_AUTHORITY_FILE, PROP_AUTHORITY_FILE,
...@@ -149,6 +151,34 @@ gdm_display_create_authority (GdmDisplay *display) ...@@ -149,6 +151,34 @@ gdm_display_create_authority (GdmDisplay *display)
return ret; return ret;
} }
gboolean
gdm_display_get_remote_hostname (GdmDisplay *display,
char **hostname,
GError **error)
{
g_return_val_if_fail (GDM_IS_DISPLAY (display), FALSE);
if (hostname != NULL) {
*hostname = g_strdup (display->priv->remote_hostname);
}
return TRUE;
}
gboolean
gdm_display_get_number (GdmDisplay *display,
int *number,
GError **error)
{
g_return_val_if_fail (GDM_IS_DISPLAY (display), FALSE);
if (number != NULL) {
*number = display->priv->number;
}
return TRUE;
}
static gboolean static gboolean
gdm_display_real_manage (GdmDisplay *display) gdm_display_real_manage (GdmDisplay *display)
{ {
...@@ -226,28 +256,14 @@ gdm_display_get_id (GdmDisplay *display, ...@@ -226,28 +256,14 @@ gdm_display_get_id (GdmDisplay *display,
} }
gboolean gboolean
gdm_display_get_name (GdmDisplay *display, gdm_display_get_x11_display (GdmDisplay *display,
char **name, char **x11_display,
GError **error) GError **error)
{ {
g_return_val_if_fail (GDM_IS_DISPLAY (display), FALSE); g_return_val_if_fail (GDM_IS_DISPLAY (display), FALSE);
if (name != NULL) { if (x11_display != NULL) {
*name = g_strdup (display->priv->name); *x11_display = g_strdup (display->priv->x11_display);
}
return TRUE;
}
gboolean
gdm_display_get_number (GdmDisplay *display,
int *number,
GError **error)
{
g_return_val_if_fail (GDM_IS_DISPLAY (display), FALSE);
if (number != NULL) {
*number = display->priv->number;
} }
return TRUE; return TRUE;
...@@ -276,11 +292,26 @@ _gdm_display_set_id (GdmDisplay *display, ...@@ -276,11 +292,26 @@ _gdm_display_set_id (GdmDisplay *display,
} }
static void static void
_gdm_display_set_name (GdmDisplay *display, _gdm_display_set_remote_hostname (GdmDisplay *display,
const char *name) const char *hostname)
{ {
g_free (display->priv->name); g_free (display->priv->remote_hostname);
display->priv->name = g_strdup (name); display->priv->remote_hostname = g_strdup (hostname);
}
static void
_gdm_display_set_number (GdmDisplay *display,
int num)
{
display->priv->number = num;
}
static void
_gdm_display_set_x11_display (GdmDisplay *display,
const char *x11_display)
{
g_free (display->priv->x11_display);
display->priv->x11_display = g_strdup (x11_display);
} }
static void static void
...@@ -307,13 +338,6 @@ _gdm_display_set_authority_file (GdmDisplay *display, ...@@ -307,13 +338,6 @@ _gdm_display_set_authority_file (GdmDisplay *display,
display->priv->authority_file = g_strdup (file); display->priv->authority_file = g_strdup (file);
} }
static void
_gdm_display_set_number (GdmDisplay *display,
int num)
{
display->priv->number = num;
}
static void static void
_gdm_display_set_is_local (GdmDisplay *display, _gdm_display_set_is_local (GdmDisplay *display,
gboolean is_local) gboolean is_local)
...@@ -335,8 +359,14 @@ gdm_display_set_property (GObject *object, ...@@ -335,8 +359,14 @@ gdm_display_set_property (GObject *object,
case PROP_ID: case PROP_ID:
_gdm_display_set_id (self, g_value_get_string (value)); _gdm_display_set_id (self, g_value_get_string (value));
break; break;
case PROP_NAME: case PROP_REMOTE_HOSTNAME:
_gdm_display_set_name (self, g_value_get_string (value)); _gdm_display_set_remote_hostname (self, g_value_get_string (value));
break;
case PROP_NUMBER:
_gdm_display_set_number (self, g_value_get_int (value));
break;
case PROP_X11_DISPLAY:
_gdm_display_set_x11_display (self, g_value_get_string (value));
break; break;
case PROP_COOKIE: case PROP_COOKIE:
_gdm_display_set_cookie (self, g_value_get_string (value)); _gdm_display_set_cookie (self, g_value_get_string (value));
...@@ -347,9 +377,6 @@ gdm_display_set_property (GObject *object, ...@@ -347,9 +377,6 @@ gdm_display_set_property (GObject *object,
case PROP_AUTHORITY_FILE: case PROP_AUTHORITY_FILE:
_gdm_display_set_authority_file (self, g_value_get_string (value)); _gdm_display_set_authority_file (self, g_value_get_string (value));
break; break;
case PROP_NUMBER:
_gdm_display_set_number (self, g_value_get_int (value));
break;
case PROP_IS_LOCAL: case PROP_IS_LOCAL:
_gdm_display_set_is_local (self, g_value_get_boolean (value)); _gdm_display_set_is_local (self, g_value_get_boolean (value));
break; break;
...@@ -373,8 +400,14 @@ gdm_display_get_property (GObject *object, ...@@ -373,8 +400,14 @@ gdm_display_get_property (GObject *object,
case PROP_ID: case PROP_ID:
g_value_set_string (value, self->priv->id); g_value_set_string (value, self->priv->id);
break; break;
case PROP_NAME: case PROP_REMOTE_HOSTNAME:
g_value_set_string (value, self->priv->name); g_value_set_string (value, self->priv->remote_hostname);
break;
case PROP_NUMBER:
g_value_set_int (value, self->priv->number);
break;
case PROP_X11_DISPLAY:
g_value_set_string (value, self->priv->x11_display);
break; break;
case PROP_COOKIE: case PROP_COOKIE:
g_value_set_string (value, self->priv->cookie); g_value_set_string (value, self->priv->cookie);
...@@ -385,9 +418,6 @@ gdm_display_get_property (GObject *object, ...@@ -385,9 +418,6 @@ gdm_display_get_property (GObject *object,
case PROP_AUTHORITY_FILE: case PROP_AUTHORITY_FILE:
g_value_set_string (value, self->priv->authority_file); g_value_set_string (value, self->priv->authority_file);
break; break;
case PROP_NUMBER:
g_value_set_int (value, self->priv->number);
break;
case PROP_IS_LOCAL: case PROP_IS_LOCAL:
g_value_set_boolean (value, self->priv->is_local); g_value_set_boolean (value, self->priv->is_local);
break; break;
...@@ -468,10 +498,26 @@ gdm_display_class_init (GdmDisplayClass *klass) ...@@ -468,10 +498,26 @@ gdm_display_class_init (GdmDisplayClass *klass)
NULL, NULL,
G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY)); G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY));
g_object_class_install_property (object_class, g_object_class_install_property (object_class,
PROP_NAME, PROP_REMOTE_HOSTNAME,
g_param_spec_string ("name", g_param_spec_string ("remote-hostname",
"name", "remote-hostname",
"name", "remote-hostname",
NULL,
G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY));
g_object_class_install_property (object_class,
PROP_NUMBER,
g_param_spec_int ("number",
"number",
"number",
-1,
G_MAXINT,
-1,
G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY));
g_object_class_install_property (object_class,
PROP_X11_DISPLAY,
g_param_spec_string ("x11-display",
"x11-display",
"x11-display",
NULL, NULL,
G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY)); G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY));
g_object_class_install_property (object_class, g_object_class_install_property (object_class,
...@@ -495,15 +541,6 @@ gdm_display_class_init (GdmDisplayClass *klass) ...@@ -495,15 +541,6 @@ gdm_display_class_init (GdmDisplayClass *klass)
"authority file", "authority file",
NULL, NULL,
G_PARAM_READWRITE | G_PARAM_CONSTRUCT)); G_PARAM_READWRITE | G_PARAM_CONSTRUCT));
g_object_class_install_property (object_class,
PROP_NUMBER,
g_param_spec_int ("number",
"number",
"number",
-1,
G_MAXINT,
-1,
G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY));
g_object_class_install_property (object_class, g_object_class_install_property (object_class,
PROP_IS_LOCAL, PROP_IS_LOCAL,
......
...@@ -83,11 +83,14 @@ gboolean gdm_display_unmanage (GdmDisplay *disp ...@@ -83,11 +83,14 @@ gboolean gdm_display_unmanage (GdmDisplay *disp
gboolean gdm_display_get_id (GdmDisplay *display, gboolean gdm_display_get_id (GdmDisplay *display,
char **id, char **id,
GError **error); GError **error);
gboolean gdm_display_get_remote_hostname (GdmDisplay *display,
char **hostname,
GError **error);
gboolean gdm_display_get_number (GdmDisplay *display, gboolean gdm_display_get_number (GdmDisplay *display,
int *number, int *number,
GError **error); GError **error);
gboolean gdm_display_get_name (GdmDisplay *display, gboolean gdm_display_get_x11_display (GdmDisplay *display,
char **name, char **x11_display,
GError **error); GError **error);
gboolean gdm_display_is_local (GdmDisplay *display, gboolean gdm_display_is_local (GdmDisplay *display,
gboolean *local, gboolean *local,
......
...@@ -4,12 +4,9 @@ ...@@ -4,12 +4,9 @@
<method name="GetId"> <method name="GetId">
<arg name="id" direction="out" type="o"/> <arg name="id" direction="out" type="o"/>
</method> </method>
<method name="GetName"> <method name="GetX11Display">
<arg name="name" direction="out" type="s"/> <arg name="name" direction="out" type="s"/>
</method> </method>
<method name="GetNumber">
<arg name="number" direction="out" type="i"/>
</method>
<method name="IsLocal"> <method name="IsLocal">
<arg name="local" direction="out" type="b"/> <arg name="local" direction="out" type="b"/>
</method> </method>
......
...@@ -206,8 +206,7 @@ load_static_displays_from_file (GdmManager *manager) ...@@ -206,8 +206,7 @@ load_static_displays_from_file (GdmManager *manager)
g_debug ("Loading display for '%d' %s", xserver->number, xserver->id); g_debug ("Loading display for '%d' %s", xserver->number, xserver->id);
display = gdm_static_display_new (xserver->number, display = gdm_static_display_new (xserver->number);
xserver->id);
if (display == NULL) { if (display == NULL) {
g_warning ("Unable to create display: %d %s", xserver->number, xserver->id); g_warning ("Unable to create display: %d %s", xserver->number, xserver->id);
......
...@@ -327,6 +327,8 @@ server_child_setup (GdmServer *server) ...@@ -327,6 +327,8 @@ server_child_setup (GdmServer *server)
logfile = gdm_make_filename (server->priv->log_dir, logfile = gdm_make_filename (server->priv->log_dir,
server->priv->display_name, server->priv->display_name,
".log"); ".log");
g_debug ("Opening logfile for server %s", logfile);
VE_IGNORE_EINTR (g_unlink (logfile)); VE_IGNORE_EINTR (g_unlink (logfile));
VE_IGNORE_EINTR (logfd = open (logfile, O_CREAT|O_TRUNC|O_WRONLY|O_EXCL, 0644)); VE_IGNORE_EINTR (logfd = open (logfile, O_CREAT|O_TRUNC|O_WRONLY|O_EXCL, 0644));
...@@ -678,6 +680,8 @@ gdm_server_init (GdmServer *server) ...@@ -678,6 +680,8 @@ gdm_server_init (GdmServer *server)
server->priv = GDM_SERVER_GET_PRIVATE (server); server->priv = GDM_SERVER_GET_PRIVATE (server);
server->priv->pid = -1; server->priv->pid = -1;
server->priv->command = g_strdup ("/usr/bin/Xorg");
server->priv->log_dir = g_strdup (LOGDIR);
} }
static void static void
......
...@@ -504,9 +504,7 @@ get_script_environment (GdmSlave *slave, ...@@ -504,9 +504,7 @@ get_script_environment (GdmSlave *slave,
static gboolean static gboolean
gdm_slave_exec_script (GdmSlave *slave, gdm_slave_exec_script (GdmSlave *slave,
const char *dir, const char *dir,
const char *login, const char *login)
struct passwd *pwent,
gboolean pass_stdout)
{ {
char *script; char *script;
char **argv; char **argv;
...@@ -516,6 +514,9 @@ gdm_slave_exec_script (GdmSlave *slave, ...@@ -516,6 +514,9 @@ gdm_slave_exec_script (GdmSlave *slave,
gboolean res; gboolean res;
gboolean ret; gboolean ret;
g_assert (dir != NULL);
g_assert (login != NULL);
script = g_build_filename (dir, slave->priv->display_name, NULL); script = g_build_filename (dir, slave->priv->display_name, NULL);
if (g_access (script, R_OK|X_OK) != 0) { if (g_access (script, R_OK|X_OK) != 0) {
g_free (script); g_free (script);
...@@ -691,9 +692,7 @@ gdm_slave_run (GdmSlave *slave) ...@@ -691,9 +692,7 @@ gdm_slave_run (GdmSlave *slave)
/* Run the init script. gdmslave suspends until script has terminated */ /* Run the init script. gdmslave suspends until script has terminated */
gdm_slave_exec_script (slave, gdm_slave_exec_script (slave,
GDMCONFDIR"/Init", GDMCONFDIR"/Init",
NULL, "gdm");
NULL,
FALSE /* pass_stdout */);
slave->priv->greeter = gdm_greeter_new (slave->priv->display_name); slave->priv->greeter = gdm_greeter_new (slave->priv->display_name);
gdm_greeter_start (slave->priv->greeter); gdm_greeter_start (slave->priv->greeter);
...@@ -772,7 +771,7 @@ gdm_slave_start (GdmSlave *slave) ...@@ -772,7 +771,7 @@ gdm_slave_start (GdmSlave *slave)
error = NULL; error = NULL;
res = dbus_g_proxy_call (slave->priv->display_proxy, res = dbus_g_proxy_call (slave->priv->display_proxy,
"GetName", "GetX11Display",
&error, &error,
G_TYPE_INVALID, G_TYPE_INVALID,
G_TYPE_STRING, &slave->priv->display_name, G_TYPE_STRING, &slave->priv->display_name,
...@@ -788,24 +787,6 @@ gdm_slave_start (GdmSlave *slave) ...@@ -788,24 +787,6 @@ gdm_slave_start (GdmSlave *slave)
return FALSE; return FALSE;
} }
error = NULL;
res = dbus_g_proxy_call (slave->priv->display_proxy,
"GetNumber",
&error,
G_TYPE_INVALID,
G_TYPE_STRING, &slave->priv->display_number,
G_TYPE_INVALID);
if (! res) {
if (error != NULL) {
g_warning ("Failed to get value: %s", error->message);
g_error_free (error);
} else {
g_warning ("Failed to get value");
}
return FALSE;
}
gdm_slave_run (slave); gdm_slave_run (slave);
return TRUE; return TRUE;
......
...@@ -161,15 +161,17 @@ gdm_static_display_finalize (GObject *object) ...@@ -161,15 +161,17 @@ gdm_static_display_finalize (GObject *object)
} }
GdmDisplay * GdmDisplay *
gdm_static_display_new (int number, gdm_static_display_new (int display_number)
const char *name)
{ {
GObject *object; GObject *object;
char *x11_display;
x11_display = g_strdup_printf (":%d", display_number);
object = g_object_new (GDM_TYPE_STATIC_DISPLAY, object = g_object_new (GDM_TYPE_STATIC_DISPLAY,
"number", number, "number", display_number,
"name", name, "x11-display", x11_display,
NULL); NULL);
g_free (x11_display);
return GDM_DISPLAY (object); return GDM_DISPLAY (object);
} }
...@@ -52,8 +52,7 @@ typedef struct ...@@ -52,8 +52,7 @@ typedef struct
} GdmStaticDisplayClass; } GdmStaticDisplayClass;
GType gdm_static_display_get_type (void); GType gdm_static_display_get_type (void);
GdmDisplay * gdm_static_display_new (int number, GdmDisplay * gdm_static_display_new (int display_number);
const char *name);
G_END_DECLS G_END_DECLS
......
...@@ -49,14 +49,12 @@ ...@@ -49,14 +49,12 @@
struct GdmXdmcpDisplayPrivate struct GdmXdmcpDisplayPrivate
{ {
char *remote_hostname;
GdmAddress *remote_address; GdmAddress *remote_address;
gint32 session_number; gint32 session_number;
}; };
enum { enum {
PROP_0, PROP_0,
PROP_REMOTE_HOSTNAME,
PROP_REMOTE_ADDRESS, PROP_REMOTE_ADDRESS,
PROP_SESSION_NUMBER, PROP_SESSION_NUMBER,
}; };
...@@ -75,20 +73,6 @@ gdm_xdmcp_display_get_session_number (GdmXdmcpDisplay *display) ...@@ -75,20 +73,6 @@ gdm_xdmcp_display_get_session_number (GdmXdmcpDisplay *display)
return display->priv->session_number; return display->priv->session_number;
} }
gboolean
gdm_xdmcp_display_get_remote_hostname (GdmXdmcpDisplay *display,
char **hostname,
GError **error)
{
g_return_val_if_fail (GDM_IS_XDMCP_DISPLAY (display), FALSE);
if (hostname != NULL) {
*hostname = g_strdup (display->priv->remote_hostname);
}
return TRUE;
}
GdmAddress * GdmAddress *
gdm_xdmcp_display_get_remote_address (GdmXdmcpDisplay *display) gdm_xdmcp_display_get_remote_address (GdmXdmcpDisplay *display)
{ {
...@@ -200,9 +184,6 @@ gdm_xdmcp_display_set_property (GObject *object, ...@@ -200,9 +184,6 @@ gdm_xdmcp_display_set_property (GObject *object,
self = GDM_XDMCP_DISPLAY (object); self = GDM_XDMCP_DISPLAY (object);
switch (prop_id) { switch (prop_id) {
case PROP_REMOTE_HOSTNAME:
self->priv->remote_hostname = g_value_dup_string (value);
break;
case PROP_REMOTE_ADDRESS: case PROP_REMOTE_ADDRESS:
self->priv->remote_address = g_value_get_boxed (value); self->priv->remote_address = g_value_get_boxed (value);
break; break;
...@@ -226,9 +207,6 @@ gdm_xdmcp_display_get_property (GObject *object, ...@@ -226,9 +207,6 @@ gdm_xdmcp_display_get_property (GObject *object,
self = GDM_XDMCP_DISPLAY (object); self = GDM_XDMCP_DISPLAY (object);
switch (prop_id) { switch (prop_id) {
case PROP_REMOTE_HOSTNAME:
g_value_set_string (value, self->priv->remote_hostname);
break;
case PROP_REMOTE_ADDRESS: case PROP_REMOTE_ADDRESS:
g_value_set_boxed (value, self->priv->remote_address); g_value_set_boxed (value, self->priv->remote_address);
break; break;
...@@ -257,13 +235,6 @@ gdm_xdmcp_display_class_init (GdmXdmcpDisplayClass *klass) ...@@ -257,13 +235,6 @@ gdm_xdmcp_display_class_init (GdmXdmcpDisplayClass *klass)
g_type_class_add_private (klass, sizeof (GdmXdmcpDisplayPrivate)); g_type_class_add_private (klass, sizeof (GdmXdmcpDisplayPrivate));
g_object_class_install_property (object_class,
PROP_REMOTE_HOSTNAME,
g_param_spec_string ("remote-hostname",
"remote-hostname",
"remote-hostname",
NULL,
G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY));
g_object_class_install_property (object_class, g_object_class_install_property (object_class,
PROP_REMOTE_ADDRESS, PROP_REMOTE_ADDRESS,
g_param_spec_boxed ("remote-address", g_param_spec_boxed ("remote-address",
...@@ -308,22 +279,24 @@ gdm_xdmcp_display_finalize (GObject *object) ...@@ -308,22 +279,24 @@ gdm_xdmcp_display_finalize (GObject *object)
} }
GdmDisplay * GdmDisplay *
gdm_xdmcp_display_new (int number, gdm_xdmcp_display_new (const char *hostname,
const char *name, int number,
const char *hostname,
GdmAddress *address, GdmAddress *address,
gint32 session_number) gint32 session_number)
{ {
GObject *object; GObject *object;
char *x11_display;
x11_display = g_strdup_printf ("%s:%d", hostname, number);
object = g_object_new (GDM_TYPE_XDMCP_DISPLAY, object = g_object_new (GDM_TYPE_XDMCP_DISPLAY,
"is-local", FALSE,
"number", number,
"name", name,
"remote-hostname", hostname, "remote-hostname", hostname,
"number", number,
"x11-display", x11_display,
"is-local", FALSE,
"remote-address", address, "remote-address", address,
"session-number", session_number, "session-number", session_number,
NULL); NULL);
g_free (x11_display);
return GDM_DISPLAY (object); return GDM_DISPLAY (object);
} }
...@@ -56,9 +56,8 @@ typedef struct ...@@ -56,9 +56,8 @@ typedef struct
GType gdm_xdmcp_display_get_type (void); GType gdm_xdmcp_display_get_type (void);
GdmDisplay * gdm_xdmcp_display_new (int number, GdmDisplay * gdm_xdmcp_display_new (const char *hostname,
const char *name, int number,
const char *hostname,
GdmAddress *addr, GdmAddress *addr,
gint32 serial_number); gint32 serial_number);
...@@ -66,12 +65,6 @@ gint32 gdm_xdmcp_display_get_session_number (GdmXdmcpDi ...@@ -66,12 +65,6 @@ gint32 gdm_xdmcp_display_get_session_number (GdmXdmcpDi
GdmAddress * gdm_xdmcp_display_get_remote_address (GdmXdmcpDisplay *display); GdmAddress * gdm_xdmcp_display_get_remote_address (GdmXdmcpDisplay *display);
/* exported */
gboolean gdm_xdmcp_display_get_remote_hostname (GdmXdmcpDisplay *display,
char **hostname,
GError **error);
G_END_DECLS G_END_DECLS
#endif /* __GDM_XDMCP_DISPLAY_H */ #endif /* __GDM_XDMCP_DISPLAY_H */
...@@ -1659,7 +1659,7 @@ remove_host (const char *id, ...@@ -1659,7 +1659,7 @@ remove_host (const char *id,
return FALSE; return FALSE;
} }
gdm_xdmcp_display_get_remote_hostname (GDM_XDMCP_DISPLAY (display), &hostname, NULL); gdm_display_get_remote_hostname (display, &hostname, NULL);
gdm_display_get_number (display, &disp_num, NULL); gdm_display_get_number (display, &disp_num, NULL);
if (disp_num == data->display_num && if (disp_num == data->display_num &&
...@@ -1748,21 +1748,15 @@ gdm_xdmcp_send_decline (GdmXdmcpManager *manager, ...@@ -1748,21 +1748,15 @@ gdm_xdmcp_send_decline (GdmXdmcpManager *manager,
} }
static GdmDisplay * static GdmDisplay *
gdm_xdmcp_display_alloc (GdmXdmcpManager *manager, gdm_xdmcp_display_alloc (GdmXdmcpManager *manager,
const char *hostname, const char *hostname,
GdmAddress *address, GdmAddress *address,
int displaynum) int displaynum)
{ {
GdmDisplay *display; GdmDisplay *display;
char *name;
name = g_strdup_printf ("%s:%d",
hostname,
displaynum);
display = gdm_xdmcp_display_new (displaynum, display = gdm_xdmcp_display_new (hostname,
name, displaynum,
hostname,
address, address,
get_next_session_serial (manager)); get_next_session_serial (manager));
if (display == NULL) { if (display == NULL) {
...@@ -1779,7 +1773,6 @@ gdm_xdmcp_display_alloc (GdmXdmcpManager *manager, ...@@ -1779,7 +1773,6 @@ gdm_xdmcp_display_alloc (GdmXdmcpManager *manager,
manager->priv->num_pending_sessions++; manager->priv->num_pending_sessions++;
out: out:
g_free (name);
return display; return display;
} }
...@@ -2226,7 +2219,7 @@ gdm_xdmcp_handle_manage (GdmXdmcpManager *manager, ...@@ -2226,7 +2219,7 @@ gdm_xdmcp_handle_manage (GdmXdmcpManager *manager,
char *name; char *name;
name = NULL; name = NULL;
gdm_display_get_name (display, &name, NULL); gdm_display_get_x11_display (display, &name, NULL);