summaryrefslogtreecommitdiff
path: root/daemon/gdm-session-relay.c
diff options
context:
space:
mode:
authorWilliam Jon McCann <mccann@jhu.edu>2007-11-07 19:30:58 +0000
committerWilliam Jon McCann <mccann@src.gnome.org>2007-11-07 19:30:58 +0000
commit6e2a11d328d6b7a5e7b7d79876498134db78c585 (patch)
tree12a5360be7117e74fa048fe367ace16f583dd0bf /daemon/gdm-session-relay.c
parent5a63165752490d1e5bb15253637685f4c50c346d (diff)
downloadgdm-6e2a11d328d6b7a5e7b7d79876498134db78c585.tar.gz
Split up the Verification step in the GdmSession interface into component
2007-11-07 William Jon McCann <mccann@jhu.edu> * daemon/gdm-factory-slave.c: (greeter_reset_timeout), (queue_greeter_reset), (on_session_setup_complete), (on_session_setup_failed), (on_session_reset_complete), (on_session_reset_failed), (on_session_authenticated), (on_session_authentication_failed), (on_session_authorized), (on_session_authorization_failed), (on_session_accredited), (on_session_accreditation_failed), (on_greeter_begin_verification), (on_greeter_begin_verification_for_user), (gdm_factory_slave_start): * daemon/gdm-product-slave.c: (on_session_setup_complete), (on_session_setup_failed), (on_session_reset_complete), (on_session_reset_failed), (on_session_authenticated), (on_session_authentication_failed), (on_session_authorized), (on_session_authorization_failed), (on_session_accredited), (on_session_accreditation_failed), (on_relay_setup), (on_relay_setup_for_user), (on_relay_authenticate), (on_relay_authorize), (on_relay_establish_credentials), (on_relay_renew_credentials), (create_new_session), (relay_dbus_handle_message): * daemon/gdm-session-direct.c: (send_dbus_void_signal), (on_authentication_failed), (on_session_start_failed), (gdm_session_direct_handle_setup_complete), (gdm_session_direct_handle_setup_failed), (gdm_session_direct_handle_reset_complete), (gdm_session_direct_handle_reset_failed), (gdm_session_direct_handle_authenticated), (gdm_session_direct_handle_authentication_failed), (gdm_session_direct_handle_authorized), (gdm_session_direct_handle_authorization_failed), (gdm_session_direct_handle_accredited), (gdm_session_direct_handle_accreditation_failed), (gdm_session_direct_handle_start_failed), (session_worker_message), (do_introspect), (gdm_session_direct_init), (worker_exited), (worker_died), (gdm_session_direct_open), (send_setup), (send_setup_for_user), (gdm_session_direct_setup), (gdm_session_direct_setup_for_user), (gdm_session_direct_authenticate), (gdm_session_direct_authorize), (gdm_session_direct_accredit), (gdm_session_direct_close), (gdm_session_iface_init): * daemon/gdm-session-direct.h: * daemon/gdm-session-private.h: * daemon/gdm-session-relay.c: (send_dbus_string_signal), (send_dbus_void_signal), (gdm_session_relay_setup), (gdm_session_relay_setup_for_user), (gdm_session_relay_authenticate), (gdm_session_relay_authorize), (gdm_session_relay_accredit), (gdm_session_relay_answer_query), (handle_setup_complete), (handle_setup_failed), (handle_authenticated), (handle_authentication_failed), (handle_authorized), (handle_authorization_failed), (handle_accredited), (handle_accreditation_failed), (handle_session_started), (handle_session_stopped), (handle_opened), (session_handle_child_message), (do_introspect), (gdm_session_iface_init): * daemon/gdm-session-worker.c: (gdm_session_execute), (gdm_session_worker_update_username), (gdm_session_worker_initialize_pam), (gdm_session_worker_accredit_user), (session_worker_child_watch), (gdm_session_worker_start_user_session), (do_setup), (do_authenticate), (do_authorize), (do_accredit), (do_open_session), (do_start_session), (state_change_idle), (on_setup), (on_setup_for_user), (on_authenticate), (on_authorize), (on_establish_credentials), (on_renew_credentials), (worker_dbus_handle_message): * daemon/gdm-session.c: (gdm_session_setup), (gdm_session_setup_for_user), (gdm_session_authenticate), (gdm_session_authorize), (gdm_session_accredit), (gdm_session_class_init), (_gdm_session_setup_complete), (_gdm_session_setup_failed), (_gdm_session_reset_complete), (_gdm_session_reset_failed), (_gdm_session_authenticated), (_gdm_session_authentication_failed), (_gdm_session_authorized), (_gdm_session_authorization_failed), (_gdm_session_accredited), (_gdm_session_accreditation_failed), (_gdm_session_session_start_failed): * daemon/gdm-session.h: * daemon/gdm-simple-slave.c: (greeter_reset_timeout), (queue_greeter_reset), (on_session_setup_complete), (on_session_setup_failed), (on_session_reset_complete), (on_session_reset_failed), (on_session_authenticated), (on_session_authentication_failed), (on_session_authorized), (on_session_authorization_failed), (on_session_accredited), (on_session_accreditation_failed), (create_new_session), (on_greeter_begin_verification), (on_greeter_begin_verification_for_user): * daemon/test-session.c: (on_open), (on_session_setup_complete), (on_session_setup_failed), (on_session_reset_complete), (on_session_reset_failed), (on_session_authenticated), (on_session_authentication_failed), (on_session_authorized), (on_session_authorization_failed), (on_session_accredited), (on_session_accreditation_failed), (on_session_started), (on_session_exited), (on_session_died), (main): Split up the Verification step in the GdmSession interface into component parts: setup, authenticate, authorize, accredit. svn path=/trunk/; revision=5496
Diffstat (limited to 'daemon/gdm-session-relay.c')
-rw-r--r--daemon/gdm-session-relay.c301
1 files changed, 245 insertions, 56 deletions
diff --git a/daemon/gdm-session-relay.c b/daemon/gdm-session-relay.c
index 59c84825..cda094d8 100644
--- a/daemon/gdm-session-relay.c
+++ b/daemon/gdm-session-relay.c
@@ -116,6 +116,7 @@ send_dbus_string_signal (GdmSessionRelay *session_relay,
g_return_if_fail (session_relay != NULL);
+ g_debug ("GdmSessionRelay: sending signal %s", name);
message = dbus_message_new_signal (GDM_SESSION_RELAY_DBUS_PATH,
GDM_SESSION_RELAY_DBUS_INTERFACE,
name);
@@ -138,6 +139,7 @@ send_dbus_void_signal (GdmSessionRelay *session_relay,
g_return_if_fail (session_relay != NULL);
+ g_debug ("GdmSessionRelay: sending signal %s", name);
message = dbus_message_new_signal (GDM_SESSION_RELAY_DBUS_PATH,
GDM_SESSION_RELAY_DBUS_INTERFACE,
name);
@@ -164,20 +166,50 @@ gdm_session_relay_close (GdmSession *session)
}
static void
-gdm_session_relay_begin_verification (GdmSession *session)
+gdm_session_relay_setup (GdmSession *session)
{
GdmSessionRelay *impl = GDM_SESSION_RELAY (session);
- g_debug ("GdmSessionRelay: Sending signal BeginVerification");
- send_dbus_void_signal (impl, "BeginVerification");
+ send_dbus_void_signal (impl, "Setup");
}
static void
-gdm_session_relay_begin_verification_for_user (GdmSession *session,
- const char *username)
+gdm_session_relay_setup_for_user (GdmSession *session,
+ const char *username)
{
GdmSessionRelay *impl = GDM_SESSION_RELAY (session);
- g_debug ("GdmSessionRelay: Sending signal BeginVerificationForUser");
- send_dbus_string_signal (impl, "BeginVerificationForUser", username);
+ send_dbus_string_signal (impl, "SetupForUser", username);
+}
+
+static void
+gdm_session_relay_authenticate (GdmSession *session)
+{
+ GdmSessionRelay *impl = GDM_SESSION_RELAY (session);
+ send_dbus_void_signal (impl, "Authenticate");
+}
+
+static void
+gdm_session_relay_authorize (GdmSession *session)
+{
+ GdmSessionRelay *impl = GDM_SESSION_RELAY (session);
+ send_dbus_void_signal (impl, "Authorize");
+}
+
+static void
+gdm_session_relay_accredit (GdmSession *session,
+ int cred_flag)
+{
+ GdmSessionRelay *impl = GDM_SESSION_RELAY (session);
+
+ switch (cred_flag) {
+ case GDM_SESSION_CRED_ESTABLISH:
+ send_dbus_void_signal (impl, "EstablishCredentials");
+ break;
+ case GDM_SESSION_CRED_RENEW:
+ send_dbus_void_signal (impl, "RenewCredentials");
+ break;
+ default:
+ g_assert_not_reached ();
+ }
}
static void
@@ -185,7 +217,6 @@ gdm_session_relay_answer_query (GdmSession *session,
const char *text)
{
GdmSessionRelay *impl = GDM_SESSION_RELAY (session);
- g_debug ("GdmSessionRelay: Sending signal AnswerQuery");
send_dbus_string_signal (impl, "AnswerQuery", text);
}
@@ -366,7 +397,50 @@ handle_problem (GdmSessionRelay *session_relay,
}
static DBusHandlerResult
-handle_user_verified (GdmSessionRelay *session_relay,
+handle_setup_complete (GdmSessionRelay *session_relay,
+ DBusConnection *connection,
+ DBusMessage *message)
+{
+ DBusMessage *reply;
+ DBusError error;
+
+ dbus_error_init (&error);
+
+ g_debug ("GdmSessionRelay: SetupComplete");
+
+ reply = dbus_message_new_method_return (message);
+ dbus_connection_send (connection, reply, NULL);
+ dbus_message_unref (reply);
+
+ _gdm_session_setup_complete (GDM_SESSION (session_relay));
+
+ return DBUS_HANDLER_RESULT_HANDLED;
+}
+
+static DBusHandlerResult
+handle_setup_failed (GdmSessionRelay *session_relay,
+ DBusConnection *connection,
+ DBusMessage *message)
+{
+ DBusMessage *reply;
+ DBusError error;
+
+ dbus_error_init (&error);
+
+ g_debug ("GdmSessionRelay: SetupFailed");
+
+ reply = dbus_message_new_method_return (message);
+ dbus_connection_send (connection, reply, NULL);
+ dbus_message_unref (reply);
+
+ _gdm_session_setup_failed (GDM_SESSION (session_relay), NULL);
+
+ return DBUS_HANDLER_RESULT_HANDLED;
+}
+
+
+static DBusHandlerResult
+handle_authenticated (GdmSessionRelay *session_relay,
DBusConnection *connection,
DBusMessage *message)
{
@@ -375,127 +449,188 @@ handle_user_verified (GdmSessionRelay *session_relay,
dbus_error_init (&error);
- g_debug ("GdmSessionRelay: UserVerified");
+ g_debug ("GdmSessionRelay: Authenticated");
reply = dbus_message_new_method_return (message);
dbus_connection_send (connection, reply, NULL);
dbus_message_unref (reply);
- _gdm_session_user_verified (GDM_SESSION (session_relay));
+ _gdm_session_authenticated (GDM_SESSION (session_relay));
return DBUS_HANDLER_RESULT_HANDLED;
}
static DBusHandlerResult
-handle_user_verification_error (GdmSessionRelay *session_relay,
- DBusConnection *connection,
- DBusMessage *message)
+handle_authentication_failed (GdmSessionRelay *session_relay,
+ DBusConnection *connection,
+ DBusMessage *message)
{
DBusMessage *reply;
DBusError error;
dbus_error_init (&error);
- g_debug ("GdmSessionRelay: UserVerificationError");
+ g_debug ("GdmSessionRelay: AuthenticationFailed");
reply = dbus_message_new_method_return (message);
dbus_connection_send (connection, reply, NULL);
dbus_message_unref (reply);
- _gdm_session_user_verification_error (GDM_SESSION (session_relay), NULL);
+ _gdm_session_authentication_failed (GDM_SESSION (session_relay), NULL);
return DBUS_HANDLER_RESULT_HANDLED;
}
static DBusHandlerResult
-handle_session_started (GdmSessionRelay *session_relay,
- DBusConnection *connection,
- DBusMessage *message)
+handle_authorized (GdmSessionRelay *session_relay,
+ DBusConnection *connection,
+ DBusMessage *message)
{
DBusMessage *reply;
DBusError error;
dbus_error_init (&error);
- g_debug ("GdmSessionRelay: SessionStarted");
+ g_debug ("GdmSessionRelay: Authorized");
reply = dbus_message_new_method_return (message);
dbus_connection_send (connection, reply, NULL);
dbus_message_unref (reply);
- _gdm_session_session_started (GDM_SESSION (session_relay));
+ _gdm_session_authorized (GDM_SESSION (session_relay));
return DBUS_HANDLER_RESULT_HANDLED;
}
static DBusHandlerResult
-handle_session_stopped (GdmSessionRelay *session_relay,
- DBusConnection *connection,
- DBusMessage *message)
+handle_authorization_failed (GdmSessionRelay *session_relay,
+ DBusConnection *connection,
+ DBusMessage *message)
{
DBusMessage *reply;
DBusError error;
dbus_error_init (&error);
- g_debug ("GdmSessionRelay: SessionStopped");
+ g_debug ("GdmSessionRelay: AuthorizationFailed");
reply = dbus_message_new_method_return (message);
dbus_connection_send (connection, reply, NULL);
dbus_message_unref (reply);
-#if 0
- _gdm_session_session_stopped (GDM_SESSION (session_relay));
-#endif
+ _gdm_session_authorization_failed (GDM_SESSION (session_relay), NULL);
return DBUS_HANDLER_RESULT_HANDLED;
}
static DBusHandlerResult
-handle_opened (GdmSessionRelay *session_relay,
- DBusConnection *connection,
- DBusMessage *message)
+handle_accredited (GdmSessionRelay *session_relay,
+ DBusConnection *connection,
+ DBusMessage *message)
{
DBusMessage *reply;
DBusError error;
dbus_error_init (&error);
- g_debug ("GdmSessionRelay: Opened");
+ g_debug ("GdmSessionRelay: Accredited");
reply = dbus_message_new_method_return (message);
dbus_connection_send (connection, reply, NULL);
dbus_message_unref (reply);
- _gdm_session_opened (GDM_SESSION (session_relay));
+ _gdm_session_accredited (GDM_SESSION (session_relay));
+
+ return DBUS_HANDLER_RESULT_HANDLED;
+}
+
+static DBusHandlerResult
+handle_accreditation_failed (GdmSessionRelay *session_relay,
+ DBusConnection *connection,
+ DBusMessage *message)
+{
+ DBusMessage *reply;
+ DBusError error;
+
+ dbus_error_init (&error);
+
+ g_debug ("GdmSessionRelay: AccreditationFailed");
+
+ reply = dbus_message_new_method_return (message);
+ dbus_connection_send (connection, reply, NULL);
+ dbus_message_unref (reply);
+
+ _gdm_session_accreditation_failed (GDM_SESSION (session_relay), NULL);
return DBUS_HANDLER_RESULT_HANDLED;
}
static DBusHandlerResult
-handle_reset (GdmSessionRelay *session_relay,
- DBusConnection *connection,
- DBusMessage *message)
+handle_session_started (GdmSessionRelay *session_relay,
+ DBusConnection *connection,
+ DBusMessage *message)
{
DBusMessage *reply;
DBusError error;
dbus_error_init (&error);
- g_debug ("GdmSessionRelay: Reset");
+ g_debug ("GdmSessionRelay: SessionStarted");
+
+ reply = dbus_message_new_method_return (message);
+ dbus_connection_send (connection, reply, NULL);
+ dbus_message_unref (reply);
+
+ _gdm_session_session_started (GDM_SESSION (session_relay));
+
+ return DBUS_HANDLER_RESULT_HANDLED;
+}
+
+static DBusHandlerResult
+handle_session_stopped (GdmSessionRelay *session_relay,
+ DBusConnection *connection,
+ DBusMessage *message)
+{
+ DBusMessage *reply;
+ DBusError error;
+
+ dbus_error_init (&error);
+
+ g_debug ("GdmSessionRelay: SessionStopped");
reply = dbus_message_new_method_return (message);
dbus_connection_send (connection, reply, NULL);
dbus_message_unref (reply);
#if 0
- _gdm_session_reset (GDM_SESSION (session_relay));
+ _gdm_session_session_stopped (GDM_SESSION (session_relay));
#endif
return DBUS_HANDLER_RESULT_HANDLED;
}
static DBusHandlerResult
+handle_opened (GdmSessionRelay *session_relay,
+ DBusConnection *connection,
+ DBusMessage *message)
+{
+ DBusMessage *reply;
+ DBusError error;
+
+ dbus_error_init (&error);
+
+ g_debug ("GdmSessionRelay: Opened");
+
+ reply = dbus_message_new_method_return (message);
+ dbus_connection_send (connection, reply, NULL);
+ dbus_message_unref (reply);
+
+ _gdm_session_opened (GDM_SESSION (session_relay));
+
+ return DBUS_HANDLER_RESULT_HANDLED;
+}
+
+static DBusHandlerResult
session_handle_child_message (DBusConnection *connection,
DBusMessage *message,
void *user_data)
@@ -510,18 +645,28 @@ session_handle_child_message (DBusConnection *connection,
return handle_info (session_relay, connection, message);
} else if (dbus_message_is_method_call (message, GDM_SESSION_RELAY_DBUS_INTERFACE, "Problem")) {
return handle_problem (session_relay, connection, message);
- } else if (dbus_message_is_method_call (message, GDM_SESSION_RELAY_DBUS_INTERFACE, "UserVerified")) {
- return handle_user_verified (session_relay, connection, message);
- } else if (dbus_message_is_method_call (message, GDM_SESSION_RELAY_DBUS_INTERFACE, "UserVerificationError")) {
- return handle_user_verification_error (session_relay, connection, message);
+ } else if (dbus_message_is_method_call (message, GDM_SESSION_RELAY_DBUS_INTERFACE, "SetupComplete")) {
+ return handle_setup_complete (session_relay, connection, message);
+ } else if (dbus_message_is_method_call (message, GDM_SESSION_RELAY_DBUS_INTERFACE, "SetupFailed")) {
+ return handle_setup_failed (session_relay, connection, message);
+ } else if (dbus_message_is_method_call (message, GDM_SESSION_RELAY_DBUS_INTERFACE, "Authenticated")) {
+ return handle_authenticated (session_relay, connection, message);
+ } else if (dbus_message_is_method_call (message, GDM_SESSION_RELAY_DBUS_INTERFACE, "AuthenticationFailed")) {
+ return handle_authentication_failed (session_relay, connection, message);
+ } else if (dbus_message_is_method_call (message, GDM_SESSION_RELAY_DBUS_INTERFACE, "Authorized")) {
+ return handle_authorized (session_relay, connection, message);
+ } else if (dbus_message_is_method_call (message, GDM_SESSION_RELAY_DBUS_INTERFACE, "AuthorizationFailed")) {
+ return handle_authorization_failed (session_relay, connection, message);
+ } else if (dbus_message_is_method_call (message, GDM_SESSION_RELAY_DBUS_INTERFACE, "Accredited")) {
+ return handle_accredited (session_relay, connection, message);
+ } else if (dbus_message_is_method_call (message, GDM_SESSION_RELAY_DBUS_INTERFACE, "AccreditationFailed")) {
+ return handle_accreditation_failed (session_relay, connection, message);
} else if (dbus_message_is_method_call (message, GDM_SESSION_RELAY_DBUS_INTERFACE, "SessionStarted")) {
return handle_session_started (session_relay, connection, message);
} else if (dbus_message_is_method_call (message, GDM_SESSION_RELAY_DBUS_INTERFACE, "SessionStopped")) {
return handle_session_stopped (session_relay, connection, message);
} else if (dbus_message_is_method_call (message, GDM_SESSION_RELAY_DBUS_INTERFACE, "Opened")) {
return handle_opened (session_relay, connection, message);
- } else if (dbus_message_is_method_call (message, GDM_SESSION_RELAY_DBUS_INTERFACE, "Reset")) {
- return handle_reset (session_relay, connection, message);
}
return DBUS_HANDLER_RESULT_NOT_YET_HANDLED;
@@ -550,10 +695,32 @@ do_introspect (DBusConnection *connection,
/* interface */
xml = g_string_append (xml,
" <interface name=\"org.gnome.DisplayManager.SessionRelay\">\n"
- " <method name=\"UserVerified\">\n"
+ " <method name=\"Opened\">\n"
" </method>\n"
- " <method name=\"UserVerificationError\">\n"
- " <arg name=\"text\" type=\"s\"/>\n"
+ " <method name=\"SetupComplete\">\n"
+ " </method>\n"
+ " <method name=\"SetupFailed\">\n"
+ " <arg name=\"message\" direction=\"in\" type=\"s\"/>\n"
+ " </method>\n"
+ " <method name=\"ResetComplete\">\n"
+ " </method>\n"
+ " <method name=\"RestFailed\">\n"
+ " <arg name=\"message\" direction=\"in\" type=\"s\"/>\n"
+ " </method>\n"
+ " <method name=\"Authenticated\">\n"
+ " </method>\n"
+ " <method name=\"AuthenticationFailed\">\n"
+ " <arg name=\"message\" direction=\"in\" type=\"s\"/>\n"
+ " </method>\n"
+ " <method name=\"Authorized\">\n"
+ " </method>\n"
+ " <method name=\"AuthorizationFailed\">\n"
+ " <arg name=\"message\" direction=\"in\" type=\"s\"/>\n"
+ " </method>\n"
+ " <method name=\"Accredited\">\n"
+ " </method>\n"
+ " <method name=\"AccreditationFailed\">\n"
+ " <arg name=\"message\" direction=\"in\" type=\"s\"/>\n"
" </method>\n"
" <method name=\"InfoQuery\">\n"
" <arg name=\"text\" type=\"s\"/>\n"
@@ -571,19 +738,36 @@ do_introspect (DBusConnection *connection,
" </method>\n"
" <method name=\"SessionStopped\">\n"
" </method>\n"
- " <method name=\"Opened\">\n"
- " </method>\n"
- " <method name=\"Reset\">\n"
- " </method>\n"
+ " <signal name=\"Reset\">\n"
+ " </signal>\n"
+ " <signal name=\"Setup\">\n"
+ " <arg name=\"service_name\" type=\"s\"/>\n"
+ " <arg name=\"x11_display_name\" type=\"s\"/>\n"
+ " <arg name=\"display_device\" type=\"s\"/>\n"
+ " <arg name=\"hostname\" type=\"s\"/>\n"
+ " </signal>\n"
+ " <signal name=\"SetupForUser\">\n"
+ " <arg name=\"service_name\" type=\"s\"/>\n"
+ " <arg name=\"x11_display_name\" type=\"s\"/>\n"
+ " <arg name=\"display_device\" type=\"s\"/>\n"
+ " <arg name=\"hostname\" type=\"s\"/>\n"
+ " <arg name=\"username\" type=\"s\"/>\n"
+ " </signal>\n"
+ " <signal name=\"Authenticate\">\n"
+ " </signal>\n"
+ " <signal name=\"Authorize\">\n"
+ " </signal>\n"
+ " <signal name=\"EstablishCredentials\">\n"
+ " </signal>\n"
+ " <signal name=\"RenewCredentials\">\n"
+ " </signal>\n"
+
" <signal name=\"Open\">\n"
" </signal>\n"
" <signal name=\"Close\">\n"
" </signal>\n"
" <signal name=\"StartSession\">\n"
" </signal>\n"
- " <signal name=\"BeginVerification\">\n"
- " <arg name=\"username\" type=\"s\"/>\n"
- " </signal>\n"
" <signal name=\"AnswerQuery\">\n"
" <arg name=\"text\" type=\"s\"/>\n"
" </signal>\n"
@@ -881,10 +1065,15 @@ gdm_session_relay_constructor (GType type,
static void
gdm_session_iface_init (GdmSessionIface *iface)
{
- iface->begin_verification = gdm_session_relay_begin_verification;
- iface->begin_verification_for_user = gdm_session_relay_begin_verification_for_user;
+
iface->open = gdm_session_relay_open;
+ iface->setup = gdm_session_relay_setup;
+ iface->setup_for_user = gdm_session_relay_setup_for_user;
+ iface->authenticate = gdm_session_relay_authenticate;
+ iface->authorize = gdm_session_relay_authorize;
+ iface->accredit = gdm_session_relay_accredit;
iface->close = gdm_session_relay_close;
+
iface->cancel = gdm_session_relay_cancel;
iface->start_session = gdm_session_relay_start_session;
iface->answer_query = gdm_session_relay_answer_query;