Commit 33c755a0 authored by William Jon McCann's avatar William Jon McCann Committed by William Jon McCann

Require the greeter to call BeginVerification. But only after the greeter

2007-10-02  William Jon McCann  <mccann@jhu.edu>

	* daemon/gdm-factory-slave.c: (on_session_relay_info),
	(on_session_relay_problem), (on_session_relay_info_query),
	(on_session_relay_secret_info_query), (on_session_relay_opened),
	(on_session_relay_user_verified), (greeter_reset_timeout),
	(queue_greeter_reset), (on_session_relay_user_verification_error),
	(on_session_relay_disconnected),
	(on_session_relay_session_started),
	(on_greeter_begin_verification), (run_greeter),
	(gdm_factory_slave_start), (gdm_factory_slave_finalize):
	* daemon/gdm-greeter-server.c: (gdm_greeter_server_ready),
	(handle_begin_verification), (greeter_handle_child_message),
	(do_introspect), (gdm_greeter_server_class_init):
	* daemon/gdm-greeter-server.h:
	* daemon/gdm-local-display-factory.c: (create_display_for_device):
	* daemon/gdm-product-slave.c: (relay_session_opened),
	(on_session_opened), (on_session_user_verified),
	(on_session_user_verification_error), (on_session_info),
	(on_session_problem), (on_session_info_query),
	(on_session_secret_info_query), (on_relay_begin_verification),
	(create_new_session), (on_relay_cancelled),
	(connect_to_session_relay), (gdm_product_slave_start):
	* daemon/gdm-session-relay.c:
	(gdm_session_relay_begin_verification), (handle_user_verified),
	(handle_user_verification_error), (handle_opened),
	(session_handle_child_message), (do_introspect),
	(handle_connection), (gdm_session_relay_class_init):
	* daemon/gdm-session-relay.h:
	* daemon/gdm-session.c:
	* daemon/gdm-simple-slave.c: (on_session_user_verified),
	(on_session_user_verification_error), (on_session_info),
	(on_session_problem), (on_session_info_query),
	(on_session_secret_info_query), (on_session_opened),
	(create_new_session), (on_greeter_begin_verification),
	(on_greeter_user_selected), (run_greeter),
	(gdm_simple_slave_finalize):
	* gui/simple-greeter/Makefile.am:
	* gui/simple-greeter/gdm-simple-greeter.c: (switch_page),
	(do_cancel), (reset_dialog), (gdm_simple_greeter_ready),
	(gdm_simple_greeter_reset), (on_user_activated), (create_greeter),
	(gdm_simple_greeter_class_init):
	* gui/simple-greeter/gdm-simple-greeter.glade:
	* gui/simple-greeter/gdm-user-chooser-widget.c: (populate_model):
	* gui/simple-greeter/greeter-main.c: (on_ready),
	(on_begin_verification), (main):
	* libgreeter/gdm-greeter.c: (gdm_greeter_real_ready),
	(gdm_greeter_ready), (gdm_greeter_emit_begin_verification),
	(gdm_greeter_emit_answer_query), (gdm_greeter_class_init):
	* libgreeter/gdm-greeter.h:
	Require the greeter to call BeginVerification.  But only
	after the greeter is sent a Ready.

	Make the factory-slave report verification status.

	Audit the communication paths and apply some fixes.

	Hook up the user chooser in the greeter.  Only has dummy users.


svn path=/branches/mccann-gobject/; revision=5330
parent 55ecbe7b
2007-10-02 William Jon McCann <mccann@jhu.edu>
* daemon/gdm-factory-slave.c: (on_session_relay_info),
(on_session_relay_problem), (on_session_relay_info_query),
(on_session_relay_secret_info_query), (on_session_relay_opened),
(on_session_relay_user_verified), (greeter_reset_timeout),
(queue_greeter_reset), (on_session_relay_user_verification_error),
(on_session_relay_disconnected),
(on_session_relay_session_started),
(on_greeter_begin_verification), (run_greeter),
(gdm_factory_slave_start), (gdm_factory_slave_finalize):
* daemon/gdm-greeter-server.c: (gdm_greeter_server_ready),
(handle_begin_verification), (greeter_handle_child_message),
(do_introspect), (gdm_greeter_server_class_init):
* daemon/gdm-greeter-server.h:
* daemon/gdm-local-display-factory.c: (create_display_for_device):
* daemon/gdm-product-slave.c: (relay_session_opened),
(on_session_opened), (on_session_user_verified),
(on_session_user_verification_error), (on_session_info),
(on_session_problem), (on_session_info_query),
(on_session_secret_info_query), (on_relay_begin_verification),
(create_new_session), (on_relay_cancelled),
(connect_to_session_relay), (gdm_product_slave_start):
* daemon/gdm-session-relay.c:
(gdm_session_relay_begin_verification), (handle_user_verified),
(handle_user_verification_error), (handle_opened),
(session_handle_child_message), (do_introspect),
(handle_connection), (gdm_session_relay_class_init):
* daemon/gdm-session-relay.h:
* daemon/gdm-session.c:
* daemon/gdm-simple-slave.c: (on_session_user_verified),
(on_session_user_verification_error), (on_session_info),
(on_session_problem), (on_session_info_query),
(on_session_secret_info_query), (on_session_opened),
(create_new_session), (on_greeter_begin_verification),
(on_greeter_user_selected), (run_greeter),
(gdm_simple_slave_finalize):
* gui/simple-greeter/Makefile.am:
* gui/simple-greeter/gdm-simple-greeter.c: (switch_page),
(do_cancel), (reset_dialog), (gdm_simple_greeter_ready),
(gdm_simple_greeter_reset), (on_user_activated), (create_greeter),
(gdm_simple_greeter_class_init):
* gui/simple-greeter/gdm-simple-greeter.glade:
* gui/simple-greeter/gdm-user-chooser-widget.c: (populate_model):
* gui/simple-greeter/greeter-main.c: (on_ready),
(on_begin_verification), (main):
* libgreeter/gdm-greeter.c: (gdm_greeter_real_ready),
(gdm_greeter_ready), (gdm_greeter_emit_begin_verification),
(gdm_greeter_emit_answer_query), (gdm_greeter_class_init):
* libgreeter/gdm-greeter.h:
Require the greeter to call BeginVerification. But only
after the greeter is sent a Ready.
Make the factory-slave report verification status.
Audit the communication paths and apply some fixes.
Hook up the user chooser in the greeter. Only has dummy users.
2007-10-02 William Jon McCann <mccann@jhu.edu>
* gui/simple-greeter/gdm-user-chooser-widget.c:
......
......@@ -68,6 +68,7 @@ struct GdmFactorySlavePrivate
GPid pid;
guint output_watch_id;
guint error_watch_id;
guint greeter_reset_id;
GPid server_pid;
Display *server_display;
......@@ -371,27 +372,27 @@ on_greeter_stop (GdmGreeterSession *greeter,
}
static void
on_relay_info (GdmSessionRelay *relay,
const char *text,
GdmFactorySlave *slave)
on_session_relay_info (GdmSessionRelay *relay,
const char *text,
GdmFactorySlave *slave)
{
g_debug ("Info: %s", text);
gdm_greeter_server_info (slave->priv->greeter_server, text);
}
static void
on_relay_problem (GdmSessionRelay *relay,
const char *text,
GdmFactorySlave *slave)
on_session_relay_problem (GdmSessionRelay *relay,
const char *text,
GdmFactorySlave *slave)
{
g_debug ("Problem: %s", text);
gdm_greeter_server_problem (slave->priv->greeter_server, text);
}
static void
on_relay_info_query (GdmSessionRelay *relay,
const char *text,
GdmFactorySlave *slave)
on_session_relay_info_query (GdmSessionRelay *relay,
const char *text,
GdmFactorySlave *slave)
{
g_debug ("Info query: %s", text);
......@@ -399,22 +400,61 @@ on_relay_info_query (GdmSessionRelay *relay,
}
static void
on_relay_secret_info_query (GdmSessionRelay *relay,
const char *text,
GdmFactorySlave *slave)
on_session_relay_secret_info_query (GdmSessionRelay *relay,
const char *text,
GdmFactorySlave *slave)
{
g_debug ("Secret info query: %s", text);
gdm_greeter_server_secret_info_query (slave->priv->greeter_server, text);
}
static void
on_relay_ready (GdmSessionRelay *relay,
GdmFactorySlave *slave)
on_session_relay_opened (GdmSessionRelay *relay,
GdmFactorySlave *slave)
{
g_debug ("Relay session opened");
gdm_greeter_server_ready (slave->priv->greeter_server);
}
static void
on_session_relay_user_verified (GdmSessionRelay *relay,
GdmFactorySlave *slave)
{
g_debug ("Relay is ready");
g_debug ("Relay session user verified");
gdm_greeter_server_reset (slave->priv->greeter_server);
gdm_session_relay_open (slave->priv->session_relay);
}
static gboolean
greeter_reset_timeout (GdmFactorySlave *slave)
{
gdm_greeter_server_reset (slave->priv->greeter_server);
slave->priv->greeter_reset_id = 0;
return FALSE;
}
static void
queue_greeter_reset (GdmFactorySlave *slave)
{
if (slave->priv->greeter_reset_id > 0) {
return;
}
slave->priv->greeter_reset_id = g_timeout_add_seconds (2, (GSourceFunc)greeter_reset_timeout, slave);
}
static void
on_session_relay_user_verification_error (GdmSessionRelay *relay,
const char *message,
GdmFactorySlave *slave)
{
g_debug ("could not successfully authenticate user: %s",
message);
gdm_greeter_server_problem (slave->priv->greeter_server, _("Unable to authenticate user"));
queue_greeter_reset (slave);
}
static gboolean
......@@ -476,8 +516,8 @@ create_product_display (GdmFactorySlave *slave)
}
static void
on_relay_disconnected (GdmSessionRelay *relay,
GdmFactorySlave *slave)
on_session_relay_disconnected (GdmSessionRelay *relay,
GdmFactorySlave *slave)
{
g_debug ("Relay disconnected");
......@@ -487,13 +527,24 @@ on_relay_disconnected (GdmSessionRelay *relay,
}
static void
on_relay_session_started (GdmSessionRelay *relay,
GdmFactorySlave *slave)
on_session_relay_session_started (GdmSessionRelay *relay,
GdmFactorySlave *slave)
{
g_debug ("Relay session started");
gdm_greeter_server_reset (slave->priv->greeter_server);
}
static void
on_greeter_begin_verification (GdmGreeterServer *greeter_server,
const char *username,
GdmFactorySlave *slave)
{
g_debug ("begin verification");
gdm_session_relay_begin_verification (slave->priv->session_relay,
username);
}
static void
on_greeter_answer (GdmGreeterServer *greeter_server,
const char *text,
......@@ -598,6 +649,10 @@ run_greeter (GdmFactorySlave *slave)
"gdm");
slave->priv->greeter_server = gdm_greeter_server_new (display_id);
g_signal_connect (slave->priv->greeter_server,
"begin-verification",
G_CALLBACK (on_greeter_begin_verification),
slave);
g_signal_connect (slave->priv->greeter_server,
"query-answer",
G_CALLBACK (on_greeter_answer),
......@@ -832,31 +887,39 @@ gdm_factory_slave_start (GdmSlave *slave)
GDM_FACTORY_SLAVE (slave)->priv->session_relay = gdm_session_relay_new ();
g_signal_connect (GDM_FACTORY_SLAVE (slave)->priv->session_relay,
"info",
G_CALLBACK (on_relay_info),
G_CALLBACK (on_session_relay_info),
slave);
g_signal_connect (GDM_FACTORY_SLAVE (slave)->priv->session_relay,
"problem",
G_CALLBACK (on_relay_problem),
G_CALLBACK (on_session_relay_problem),
slave);
g_signal_connect (GDM_FACTORY_SLAVE (slave)->priv->session_relay,
"info-query",
G_CALLBACK (on_relay_info_query),
G_CALLBACK (on_session_relay_info_query),
slave);
g_signal_connect (GDM_FACTORY_SLAVE (slave)->priv->session_relay,
"secret-info-query",
G_CALLBACK (on_relay_secret_info_query),
G_CALLBACK (on_session_relay_secret_info_query),
slave);
g_signal_connect (GDM_FACTORY_SLAVE (slave)->priv->session_relay,
"user-verified",
G_CALLBACK (on_session_relay_user_verified),
slave);
g_signal_connect (GDM_FACTORY_SLAVE (slave)->priv->session_relay,
"ready",
G_CALLBACK (on_relay_ready),
"user-verification-error",
G_CALLBACK (on_session_relay_user_verification_error),
slave);
g_signal_connect (GDM_FACTORY_SLAVE (slave)->priv->session_relay,
"opened",
G_CALLBACK (on_session_relay_opened),
slave);
g_signal_connect (GDM_FACTORY_SLAVE (slave)->priv->session_relay,
"disconnected",
G_CALLBACK (on_relay_disconnected),
G_CALLBACK (on_session_relay_disconnected),
slave);
g_signal_connect (GDM_FACTORY_SLAVE (slave)->priv->session_relay,
"session-started",
G_CALLBACK (on_relay_session_started),
G_CALLBACK (on_session_relay_session_started),
slave);
gdm_session_relay_start (GDM_FACTORY_SLAVE (slave)->priv->session_relay);
......@@ -1014,6 +1077,11 @@ gdm_factory_slave_finalize (GObject *object)
gdm_factory_slave_stop (GDM_SLAVE (factory_slave));
if (factory_slave->priv->greeter_reset_id > 0) {
g_source_remove (factory_slave->priv->greeter_reset_id);
factory_slave->priv->greeter_reset_id = 0;
}
G_OBJECT_CLASS (gdm_factory_slave_parent_class)->finalize (object);
}
......
......@@ -72,6 +72,7 @@ enum {
};
enum {
BEGIN_VERIFICATION,
QUERY_ANSWER,
SESSION_SELECTED,
HOSTNAME_SELECTED,
......@@ -199,6 +200,13 @@ gdm_greeter_server_reset (GdmGreeterServer *greeter_server)
return TRUE;
}
gboolean
gdm_greeter_server_ready (GdmGreeterServer *greeter_server)
{
send_dbus_void_signal (greeter_server, "Ready");
return TRUE;
}
/* Note: Use abstract sockets like dbus does by default on Linux. Abstract
* sockets are only available on Linux.
*/
......@@ -227,6 +235,33 @@ generate_address (void)
return path;
}
static DBusHandlerResult
handle_begin_verification (GdmGreeterServer *greeter_server,
DBusConnection *connection,
DBusMessage *message)
{
DBusMessage *reply;
DBusError error;
const char *text;
dbus_error_init (&error);
if (! dbus_message_get_args (message, &error,
DBUS_TYPE_STRING, &text,
DBUS_TYPE_INVALID)) {
g_warning ("ERROR: %s", error.message);
}
g_debug ("BeginVerification for %s", text);
reply = dbus_message_new_method_return (message);
dbus_connection_send (connection, reply, NULL);
dbus_message_unref (reply);
g_signal_emit (greeter_server, signals [BEGIN_VERIFICATION], 0, text);
return DBUS_HANDLER_RESULT_HANDLED;
}
static DBusHandlerResult
handle_answer_query (GdmGreeterServer *greeter_server,
DBusConnection *connection,
......@@ -418,7 +453,9 @@ greeter_handle_child_message (DBusConnection *connection,
{
GdmGreeterServer *greeter_server = GDM_GREETER_SERVER (user_data);
if (dbus_message_is_method_call (message, GDM_GREETER_SERVER_DBUS_INTERFACE, "AnswerQuery")) {
if (dbus_message_is_method_call (message, GDM_GREETER_SERVER_DBUS_INTERFACE, "BeginVerification")) {
return handle_begin_verification (greeter_server, connection, message);
} else if (dbus_message_is_method_call (message, GDM_GREETER_SERVER_DBUS_INTERFACE, "AnswerQuery")) {
return handle_answer_query (greeter_server, connection, message);
} else if (dbus_message_is_method_call (message, GDM_GREETER_SERVER_DBUS_INTERFACE, "SelectSession")) {
return handle_select_session (greeter_server, connection, message);
......@@ -462,6 +499,9 @@ do_introspect (DBusConnection *connection,
/* interface */
xml = g_string_append (xml,
" <interface name=\"org.gnome.DisplayManager.GreeterServer\">\n"
" <method name=\"BeginVerification\">\n"
" <arg name=\"username\" direction=\"in\" type=\"s\"/>\n"
" </method>\n"
" <method name=\"AnswerQuery\">\n"
" <arg name=\"text\" direction=\"in\" type=\"s\"/>\n"
" </method>\n"
......@@ -496,6 +536,8 @@ do_introspect (DBusConnection *connection,
" <signal name=\"SecretInfoQuery\">\n"
" <arg name=\"text\" type=\"s\"/>\n"
" </signal>\n"
" <signal name=\"Ready\">\n"
" </signal>\n"
" <signal name=\"Reset\">\n"
" </signal>\n"
" </interface>\n");
......@@ -861,6 +903,17 @@ gdm_greeter_server_class_init (GdmGreeterServerClass *klass)
"group name",
"gdm",
G_PARAM_READWRITE | G_PARAM_CONSTRUCT));
signals [BEGIN_VERIFICATION] =
g_signal_new ("begin-verification",
G_OBJECT_CLASS_TYPE (object_class),
G_SIGNAL_RUN_FIRST,
G_STRUCT_OFFSET (GdmGreeterServerClass, begin_verification),
NULL,
NULL,
g_cclosure_marshal_VOID__STRING,
G_TYPE_NONE,
1,
G_TYPE_STRING);
signals [QUERY_ANSWER] =
g_signal_new ("query-answer",
G_OBJECT_CLASS_TYPE (object_class),
......
......@@ -45,6 +45,8 @@ typedef struct
{
GObjectClass parent_class;
void (* begin_verification)(GdmGreeterServer *greeter_server,
const char *username);
void (* query_answer) (GdmGreeterServer *greeter_server,
const char *text);
void (* session_selected) (GdmGreeterServer *greeter_server,
......@@ -76,6 +78,7 @@ gboolean gdm_greeter_server_info (GdmGreeterServer *gree
gboolean gdm_greeter_server_problem (GdmGreeterServer *greeter_server,
const char *text);
gboolean gdm_greeter_server_reset (GdmGreeterServer *greeter_server);
gboolean gdm_greeter_server_ready (GdmGreeterServer *greeter_server);
G_END_DECLS
......
......@@ -87,7 +87,11 @@ create_display_for_device (GdmLocalDisplayFactory *factory,
store = gdm_display_factory_get_display_store (GDM_DISPLAY_FACTORY (factory));
#if 0
display = gdm_static_factory_display_new (0, store);
#else
display = gdm_static_display_new (0);
#endif
if (display == NULL) {
g_warning ("Unable to create display: %d", 0);
return;
......
......@@ -384,22 +384,32 @@ relay_session_started (GdmProductSlave *slave)
}
static void
on_opened (GdmSession *session,
GdmProductSlave *slave)
relay_session_opened (GdmProductSlave *slave)
{
GError *error;
gboolean res;
g_debug ("session opened");
res = gdm_session_begin_verification (session,
slave->priv->selected_user,
&error);
error = NULL;
res = dbus_g_proxy_call (slave->priv->session_relay_proxy,
"Opened",
&error,
G_TYPE_INVALID,
G_TYPE_INVALID);
if (! res) {
g_warning ("Unable to begin verification: %s", error->message);
g_warning ("Unable to send Opened: %s", error->message);
g_error_free (error);
}
}
static void
on_session_opened (GdmSession *session,
GdmProductSlave *slave)
{
g_debug ("session opened");
relay_session_opened (slave);
}
static void
disconnect_relay (GdmProductSlave *slave)
{
......@@ -827,18 +837,36 @@ gdm_product_slave_create_server (GdmProductSlave *slave)
}
static void
on_user_verified (GdmSession *session,
GdmProductSlave *slave)
on_session_user_verified (GdmSession *session,
GdmProductSlave *slave)
{
GError *error;
gboolean res;
g_debug ("Session user verified");
error = NULL;
res = dbus_g_proxy_call (slave->priv->session_relay_proxy,
"UserVerified",
&error,
G_TYPE_INVALID,
G_TYPE_INVALID);
if (! res) {
g_warning ("Unable to send UserVerified: %s", error->message);
g_error_free (error);
}
gdm_product_slave_create_server (slave);
}
static void
on_user_verification_error (GdmSession *session,
GError *error,
GdmProductSlave *slave)
on_session_user_verification_error (GdmSession *session,
GError *error,
GdmProductSlave *slave)
{
char *username;
char *username;
GError *local_error;
gboolean res;
username = gdm_session_get_username (session);
......@@ -848,30 +876,24 @@ on_user_verification_error (GdmSession *session,
error->message);
g_free (username);
}
static void
ready_relay (GdmProductSlave *slave)
{
GError *error;
gboolean res;
error = NULL;
local_error = NULL;
res = dbus_g_proxy_call (slave->priv->session_relay_proxy,
"Ready",
&error,
"UserVerificationError",
&local_error,
G_TYPE_STRING, error->message,
G_TYPE_INVALID,
G_TYPE_INVALID);
if (! res) {
g_warning ("Unable to send Ready: %s", error->message);
g_error_free (error);
g_warning ("Unable to send UserVerificationError: %s", local_error->message);
g_error_free (local_error);
}
}
static void
on_info (GdmSession *session,
const char *text,
GdmProductSlave *slave)
on_session_info (GdmSession *session,
const char *text,
GdmProductSlave *slave)
{
GError *error;
gboolean res;
......@@ -892,9 +914,9 @@ on_info (GdmSession *session,
}
static void
on_problem (GdmSession *session,
const char *text,
GdmProductSlave *slave)
on_session_problem (GdmSession *session,
const char *text,
GdmProductSlave *slave)
{
GError *error;
gboolean res;
......@@ -916,9 +938,9 @@ on_problem (GdmSession *session,
}
static void
on_info_query (GdmSession *session,
const char *text,
GdmProductSlave *slave)
on_session_info_query (GdmSession *session,
const char *text,
GdmProductSlave *slave)
{
GError *error;
gboolean res;
......@@ -939,9 +961,9 @@ on_info_query (GdmSession *session,
}
static void
on_secret_info_query (GdmSession *session,
const char *text,
GdmProductSlave *slave)
on_session_secret_info_query (GdmSession *session,
const char *text,
GdmProductSlave *slave)
{
GError *error;
gboolean res;
......@@ -962,6 +984,27 @@ on_secret_info_query (GdmSession *session,
}
}
static void
on_relay_begin_verification (DBusGProxy *proxy,
const char *username,
gpointer data)
{
GdmProductSlave *slave = GDM_PRODUCT_SLAVE (data);
GError *error;
gboolean res;
g_debug ("Relay Begin Verification");
error = NULL;
res = gdm_session_begin_verification (slave->priv->session,
username,
&error);
if (! res) {
g_warning ("Unable to begin verification: %s", error->message);
g_error_free (error);
}
}
static void
on_relay_answer (DBusGProxy *proxy,
const char *text,
......@@ -1064,37 +1107,37 @@ create_new_session (GdmProductSlave *slave)
g_signal_connect (slave->priv->session,
"opened",
G_CALLBACK (on_opened),
G_CALLBACK (on_session_opened),
slave);
g_signal_connect (slave->priv->session,
"info",
G_CALLBACK (on_info),
G_CALLBACK (on_session_info),
slave);
g_signal_connect (slave->priv->session,
"problem",
G_CALLBACK (on_problem),
G_CALLBACK (on_session_problem),
slave);
g_signal_connect (slave->priv->session,
"info-query",
G_CALLBACK (on_info_query),
G_CALLBACK (on_session_info_query),
slave);
g_signal_connect (slave->priv->session,
"secret-info-query",
G_CALLBACK (on_secret_info_query),
G_CALLBACK (on_session_secret_info_query),
slave);
g_signal_connect (slave->priv->session,
"user-verified",
G_CALLBACK (on_user_verified),
G_CALLBACK (on_session_user_verified),
slave);
g_signal_connect (slave->priv->session,
"user-verification-error",
G_CALLBACK (on_user_verification_error),
G_CALLBACK (on_session_user_verification_error),
slave);
g_signal_connect (slave->priv->session,
......@@ -1125,8 +1168,6 @@ on_relay_cancelled (DBusGProxy *proxy,
}
create_new_session (slave);
ready_relay (slave);
}
static void
......@@ -1200,6 +1241,10 @@ connect_to_session_relay (GdmProductSlave *slave)
}
/* FIXME: not sure why introspection isn't working */
dbus_g_proxy_add_signal (slave->priv->session_relay_proxy,
"BeginVerification",
G_TYPE_STRING,
G_TYPE_INVALID);
dbus_g_proxy_add_signal (slave->priv->session_relay_proxy,
"AnswerQuery",
G_TYPE_STRING,
......@@ -1223,6 +1268,11 @@ connect_to_session_relay (GdmProductSlave *slave)
"Cancelled",
G_TYPE_INVALID);
dbus_g_proxy_connect_signal (slave->priv->session_relay_proxy,
"BeginVerification",
G_CALLBACK (on_relay_begin_verification),
slave,
NULL);
dbus_g_proxy_connect_signal (slave->priv->session_relay_proxy,
"AnswerQuery",
G_CALLBACK (on_relay_answer),
......@@ -1308,8 +1358,6 @@ gdm_product_slave_start (GdmSlave *slave)
connect_to_session_relay (GDM_PRODUCT_SLAVE (slave));
ready_relay (GDM_PRODUCT_SLAVE (slave));
ret = TRUE;
out:
......
......@@ -62,13 +62,16 @@ enum {
};
enum {
INFO_QUERY,
SECRET_INFO_QUERY,
USER_VERIFIED = 0,
USER_VERIFICATION_ERROR,
INFO,
PROBLEM,
INFO_QUERY,
SECRET_INFO_QUERY,
SESSION_STARTED,
SESSION_STOPPED,
READY,
OPENED,
CLOSED,
CONNECTED,
DISCONNECTED,
LAST_SIGNAL
......@@ -156,6 +159,14 @@ gdm_session_relay_open (GdmSessionRelay *session_relay)
send_dbus_void_signal (session_relay, "Open");
}
void
gdm_session_relay_begin_verification (GdmSessionRelay *session_relay,
const char *username)
{
g_debug ("Sending signal BeginVerification");
send_dbus_string_signal (session_relay, "BeginVerification", username);
}
void
gdm_session_relay_answer_query (GdmSessionRelay *session_relay,
const char *text)
......@@ -327,6 +338,48 @@ handle_problem (GdmSessionRelay *session_relay,
return DBUS_HANDLER_RESULT_HANDLED;
}
static DBusHandlerResult
handle_user_verified (GdmSessionRelay *session_relay,
DBusConnection *connection,
DBusMessage *message)
{
DBusMessage *reply;
DBusError error;
dbus_error_init (&error);
g_debug ("UserVerified");
reply = dbus_message_new_method_return (message);
dbus_connection_send (connection, reply, NULL);
dbus_message_unref (reply);
g_signal_emit (session_relay, signals [USER_VERIFIED], 0);
return DBUS_HANDLER_RESULT_HANDLED;