diff options
author | Ray Strode <rstrode@redhat.com> | 2007-10-26 22:08:32 +0000 |
---|---|---|
committer | Ray Strode <halfline@src.gnome.org> | 2007-10-26 22:08:32 +0000 |
commit | 009614c8bcab2ae73763d8ba11c2c37a10604089 (patch) | |
tree | 824d61cc49c1e5e490c00d3733257746e72a822f /daemon/gdm-server.c | |
parent | b01003209bc260f15f4153fa8ca690cc2486be4c (diff) | |
download | gdm-009614c8bcab2ae73763d8ba11c2c37a10604089.tar.gz |
Get things working with pam_console again
2007-10-26 Ray Strode <rstrode@redhat.com>
Get things working with pam_console again
* daemon/gdm-server.c: (_gdm_server_query_ck_for_display_device),
(gdm_server_get_display_device): cache display tty instead of
invoking ck-get-x11-display-device each time. Add new
display-device property.
* daemon/gdm-session-worker.c (_get_tty_for_pam),
(gdm_session_worker_initialize_pam):
use display name or tty depending on os
* daemon/gdm-simple-slave.c (on_greeter_cancel),
(on_greeter_connected): don't hard code "/dev/console" for display
device.
svn path=/trunk/; revision=5422
Diffstat (limited to 'daemon/gdm-server.c')
-rw-r--r-- | daemon/gdm-server.c | 37 |
1 files changed, 35 insertions, 2 deletions
diff --git a/daemon/gdm-server.c b/daemon/gdm-server.c index 7208ecf5..c2f84f01 100644 --- a/daemon/gdm-server.c +++ b/daemon/gdm-server.c @@ -69,6 +69,7 @@ struct GdmServerPrivate char *log_dir; char *display_name; + char *display_device; char *auth_file; gboolean is_parented; @@ -82,6 +83,7 @@ struct GdmServerPrivate enum { PROP_0, PROP_DISPLAY_NAME, + PROP_DISPLAY_DEVICE, PROP_AUTH_FILE, PROP_IS_PARENTED, PROP_PARENT_DISPLAY_NAME, @@ -108,8 +110,8 @@ static void gdm_server_finalize (GObject *object); G_DEFINE_TYPE (GdmServer, gdm_server, G_TYPE_OBJECT) -char * -gdm_server_get_display_device (GdmServer *server) +static char * +_gdm_server_query_ck_for_display_device (GdmServer *server) { char *out; char *command; @@ -143,6 +145,19 @@ gdm_server_get_display_device (GdmServer *server) return out; } +char * +gdm_server_get_display_device (GdmServer *server) +{ + if (server->priv->display_device == NULL) { + server->priv->display_device = + _gdm_server_query_ck_for_display_device (server); + + g_object_notify (G_OBJECT (server), "display-device"); + } + + return g_strdup (server->priv->display_device); +} + static gboolean emit_ready_idle (GdmServer *server) { @@ -688,6 +703,12 @@ server_died (GdmServer *server) g_spawn_close_pid (server->priv->pid); server->priv->pid = -1; + if (server->priv->display_device != NULL) { + g_free (server->priv->display_device); + server->priv->display_device = NULL; + g_object_notify (G_OBJECT (server), "display-device"); + } + g_debug ("Server died"); } @@ -766,6 +787,10 @@ gdm_server_get_property (GObject *object, case PROP_DISPLAY_NAME: g_value_set_string (value, self->priv->display_name); break; + case PROP_DISPLAY_DEVICE: + g_value_take_string (value, + gdm_server_get_display_device (self)); + break; case PROP_USER_NAME: g_value_set_string (value, self->priv->user_name); break; @@ -822,6 +847,14 @@ gdm_server_class_init (GdmServerClass *klass) NULL, G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY)); g_object_class_install_property (object_class, + PROP_DISPLAY_DEVICE, + g_param_spec_string ("display-device", + "Display Device", + "Path to terminal display is running on", + NULL, + G_PARAM_READABLE)); + + g_object_class_install_property (object_class, PROP_USER_NAME, g_param_spec_string ("user-name", "user name", |