diff options
author | William Jon McCann <mccann@jhu.edu> | 2007-11-07 19:30:58 +0000 |
---|---|---|
committer | William Jon McCann <mccann@src.gnome.org> | 2007-11-07 19:30:58 +0000 |
commit | 6e2a11d328d6b7a5e7b7d79876498134db78c585 (patch) | |
tree | 12a5360be7117e74fa048fe367ace16f583dd0bf /daemon/test-session.c | |
parent | 5a63165752490d1e5bb15253637685f4c50c346d (diff) | |
download | gdm-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/test-session.c')
-rw-r--r-- | daemon/test-session.c | 191 |
1 files changed, 147 insertions, 44 deletions
diff --git a/daemon/test-session.c b/daemon/test-session.c index c229a415..e503808c 100644 --- a/daemon/test-session.c +++ b/daemon/test-session.c @@ -36,61 +36,129 @@ static void on_open (GdmSession *session, const char *username) { - g_debug ("Got opened: begin auth for %s", username ? username : "(null)"); + g_debug ("Got opened: calling setup..."); - gdm_session_begin_verification (session); + gdm_session_setup (session); } static void -on_session_started (GdmSession *session) +on_session_setup_complete (GdmSession *session, + gpointer data) { - g_print ("session started"); + g_debug ("Session setup complete"); + gdm_session_authenticate (session); } static void -on_session_exited (GdmSession *session, - int exit_code) +on_session_setup_failed (GdmSession *session, + const char *message, + gpointer data) { - g_print ("session exited with code %d\n", exit_code); - exit (0); + g_print ("Unable to initialize PAM: %s\n", message); + + exit (1); } static void -on_session_died (GdmSession *session, - int signal_number) +on_session_reset_complete (GdmSession *session, + gpointer data) { - g_print ("session died with signal %d, (%s)", - signal_number, - g_strsignal (signal_number)); + g_debug ("Session reset complete"); +} + +static void +on_session_reset_failed (GdmSession *session, + const char *message, + gpointer data) +{ + g_print ("Unable to reset PAM: %s\n", message); + + exit (1); +} + +static void +on_session_authenticated (GdmSession *session, + gpointer data) +{ + g_debug ("Session authenticated"); + gdm_session_authorize (session); +} + +static void +on_session_authentication_failed (GdmSession *session, + const char *message, + gpointer data) +{ + g_print ("Unable to authenticate user: %s\n", message); + + exit (1); +} + +static void +on_session_authorized (GdmSession *session, + gpointer data) +{ + g_debug ("Session authorized"); + gdm_session_accredit (session, GDM_SESSION_CRED_ESTABLISH); +} + +static void +on_session_authorization_failed (GdmSession *session, + const char *message, + gpointer data) +{ + g_print ("Unable to authorize user: %s\n", message); + exit (1); } static void -on_user_verified (GdmSession *session) +on_session_accredited (GdmSession *session, + gpointer data) { char *username; username = gdm_session_direct_get_username (GDM_SESSION_DIRECT (session)); - g_print ("%s%ssuccessfully authenticated\n", + g_print ("%s%ssuccessfully accredited\n", username ? username : "", username ? " " : ""); g_free (username); gdm_session_start_session (session); + } static void -on_user_verification_error (GdmSession *session, - const char *message) +on_session_accreditation_failed (GdmSession *session, + const char *message, + gpointer data) { - char *username; + g_print ("Unable to accredit user: %s\n", message); - username = gdm_session_direct_get_username (GDM_SESSION_DIRECT (session)); + exit (1); +} - g_print ("%s%scould not be successfully authenticated: %s\n", - username ? username : "", username ? " " : "", - message); - g_free (username); +static void +on_session_started (GdmSession *session) +{ + g_print ("session started\n"); +} + +static void +on_session_exited (GdmSession *session, + int exit_code) +{ + g_print ("session exited with code %d\n", exit_code); + exit (0); +} + +static void +on_session_died (GdmSession *session, + int signal_number) +{ + g_print ("session died with signal %d, (%s)\n", + signal_number, + g_strsignal (signal_number)); exit (1); } @@ -191,43 +259,78 @@ main (int argc, gdm_session_open (GDM_SESSION (session)); - g_signal_connect (session, "opened", + g_signal_connect (session, + "opened", G_CALLBACK (on_open), username); + g_signal_connect (session, + "setup-complete", + G_CALLBACK (on_session_setup_complete), + NULL); + g_signal_connect (session, + "setup-failed", + G_CALLBACK (on_session_setup_failed), + NULL); + g_signal_connect (session, + "reset-complete", + G_CALLBACK (on_session_reset_complete), + NULL); + g_signal_connect (session, + "reset-failed", + G_CALLBACK (on_session_reset_failed), + NULL); + g_signal_connect (session, + "authenticated", + G_CALLBACK (on_session_authenticated), + NULL); + g_signal_connect (session, + "authentication-failed", + G_CALLBACK (on_session_authentication_failed), + NULL); + g_signal_connect (session, + "authorized", + G_CALLBACK (on_session_authorized), + NULL); + g_signal_connect (session, + "authorization-failed", + G_CALLBACK (on_session_authorization_failed), + NULL); + g_signal_connect (session, + "accredited", + G_CALLBACK (on_session_accredited), + NULL); + g_signal_connect (session, + "accreditation-failed", + G_CALLBACK (on_session_accreditation_failed), + NULL); - g_signal_connect (session, "info", + g_signal_connect (session, + "info", G_CALLBACK (on_info), NULL); - - g_signal_connect (session, "problem", + g_signal_connect (session, + "problem", G_CALLBACK (on_problem), NULL); - - g_signal_connect (session, "info-query", + g_signal_connect (session, + "info-query", G_CALLBACK (on_info_query), NULL); - - g_signal_connect (session, "secret-info-query", + g_signal_connect (session, + "secret-info-query", G_CALLBACK (on_secret_info_query), NULL); - g_signal_connect (session, "user-verified", - G_CALLBACK (on_user_verified), - NULL); - - g_signal_connect (session, "user-verification-error", - G_CALLBACK (on_user_verification_error), - NULL); - - g_signal_connect (session, "session-started", + g_signal_connect (session, + "session-started", G_CALLBACK (on_session_started), NULL); - - g_signal_connect (session, "session-exited", + g_signal_connect (session, + "session-exited", G_CALLBACK (on_session_exited), NULL); - - g_signal_connect (session, "session-died", + g_signal_connect (session, + "session-died", G_CALLBACK (on_session_died), NULL); |