gdm r6183 - in trunk: . daemon



Author: mccann
Date: Tue Apr 29 22:54:04 2008
New Revision: 6183
URL: http://svn.gnome.org/viewvc/gdm?rev=6183&view=rev

Log:
2008-04-29  William Jon McCann  <jmccann redhat com>

	* daemon/gdm-simple-slave.c: (destroy_session), (reset_session),
	(greeter_reset_timeout), (on_session_setup_failed),
	(on_session_authentication_failed),
	(on_session_authorization_failed), (start_session_timeout),
	(on_session_accreditation_failed), (on_greeter_cancel):
	Close out sessions after each failure to ensure no
	information leakage.  Make sure to close/reopen sessions
	upon reset.



Modified:
   trunk/ChangeLog
   trunk/daemon/gdm-simple-slave.c

Modified: trunk/daemon/gdm-simple-slave.c
==============================================================================
--- trunk/daemon/gdm-simple-slave.c	(original)
+++ trunk/daemon/gdm-simple-slave.c	Tue Apr 29 22:54:04 2008
@@ -92,6 +92,8 @@
 
 G_DEFINE_TYPE (GdmSimpleSlave, gdm_simple_slave, GDM_TYPE_SLAVE)
 
+static void create_new_session (GdmSimpleSlave *slave);
+
 static void
 on_session_started (GdmSession       *session,
                     int               pid,
@@ -140,10 +142,30 @@
         return ret;
 }
 
+static void
+destroy_session (GdmSimpleSlave *slave)
+{
+        if (slave->priv->session != NULL) {
+                gdm_session_close (GDM_SESSION (slave->priv->session));
+                g_object_unref (slave->priv->session);
+                slave->priv->session = NULL;
+        }
+}
+
+static void
+reset_session (GdmSimpleSlave *slave)
+{
+        destroy_session (slave);
+        create_new_session (slave);
+        gdm_session_open (GDM_SESSION (slave->priv->session));
+}
+
 static gboolean
 greeter_reset_timeout (GdmSimpleSlave *slave)
 {
+        g_debug ("GdmSimpleSlave: resetting greeter");
         gdm_greeter_server_reset (slave->priv->greeter_server);
+        reset_session (slave);
         slave->priv->greeter_reset_id = 0;
         return FALSE;
 }
@@ -172,6 +194,7 @@
 {
         gdm_greeter_server_problem (slave->priv->greeter_server, _("Unable to initialize login system"));
 
+        destroy_session (slave);
         queue_greeter_reset (slave);
 }
 
@@ -203,7 +226,7 @@
                                   GdmSimpleSlave *slave)
 {
         gdm_greeter_server_problem (slave->priv->greeter_server, _("Unable to authenticate user"));
-
+        destroy_session (slave);
         queue_greeter_reset (slave);
 }
 
@@ -250,6 +273,7 @@
 {
         gdm_greeter_server_problem (slave->priv->greeter_server, _("Unable to authorize user"));
 
+        destroy_session (slave);
         queue_greeter_reset (slave);
 }
 
@@ -283,11 +307,7 @@
         migrated = try_migrate_session (slave);
         g_debug ("GdmSimpleSlave: migrated: %d", migrated);
         if (migrated) {
-                if (slave->priv->session != NULL) {
-                        gdm_session_close (GDM_SESSION (slave->priv->session));
-                        g_object_unref (slave->priv->session);
-                        slave->priv->session = NULL;
-                }
+                destroy_session (slave);
 
                 /* We don't stop the slave here because
                    when Xorg exits it switches to the VT it was
@@ -356,12 +376,7 @@
            when Xorg exits it switches to the VT it was
            started from.  That interferes with fast
            user switching. */
-
-        if (slave->priv->session != NULL) {
-                gdm_session_close (GDM_SESSION (slave->priv->session));
-                g_object_unref (slave->priv->session);
-                slave->priv->session = NULL;
-        }
+        destroy_session (slave);
 
         queue_greeter_reset (slave);
 }
@@ -710,16 +725,7 @@
                    GdmSimpleSlave   *slave)
 {
         g_debug ("GdmSimpleSlave: Greeter cancelled");
-
-        if (slave->priv->session != NULL) {
-                gdm_session_close (GDM_SESSION (slave->priv->session));
-                g_object_unref (slave->priv->session);
-                slave->priv->session = NULL;
-        }
-
-        create_new_session (slave);
-
-        gdm_session_open (GDM_SESSION (slave->priv->session));
+        reset_session (slave);
 }
 
 static void



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]