gdm r5622 - in trunk: . daemon gui/simple-greeter



Author: mccann
Date: Tue Jan 22 18:05:21 2008
New Revision: 5622
URL: http://svn.gnome.org/viewvc/gdm?rev=5622&view=rev

Log:
2008-01-22  William Jon McCann  <mccann jhu edu>

	* daemon/gdm-display.c: (gdm_display_real_add_user_authorization),
	(gdm_display_real_unmanage), (gdm_display_unmanage),
	(gdm_display_dispose), (gdm_display_finalize):
	* daemon/gdm-factory-slave.c: (on_session_session_started):
	* daemon/gdm-product-display.c:
	(gdm_product_display_add_user_authorization),
	(gdm_product_display_remove_user_authorization):
	* daemon/gdm-product-slave.c: (add_user_authorization),
	(setup_session), (on_relay_establish_credentials),
	(on_relay_renew_credentials):
	* daemon/gdm-session-direct.c: (gdm_session_direct_select_user),
	(gdm_session_direct_handle_username_changed),
	(gdm_session_direct_setup_for_user), (open_ck_session):
	* daemon/gdm-session-worker.c:
	(gdm_session_worker_update_username):
	* daemon/gdm-simple-slave.c: (on_session_accredited):
	* daemon/gdm-static-factory-display.c:
	(gdm_static_factory_display_add_user_authorization),
	(gdm_static_factory_display_remove_user_authorization):
	Make user auth work for factory display again.



Modified:
   trunk/ChangeLog
   trunk/daemon/gdm-display.c
   trunk/daemon/gdm-factory-slave.c
   trunk/daemon/gdm-product-display.c
   trunk/daemon/gdm-product-slave.c
   trunk/daemon/gdm-session-direct.c
   trunk/daemon/gdm-session-worker.c
   trunk/daemon/gdm-simple-slave.c
   trunk/daemon/gdm-static-factory-display.c
   trunk/gui/simple-greeter/gdm-greeter-login-window.c

Modified: trunk/daemon/gdm-display.c
==============================================================================
--- trunk/daemon/gdm-display.c	(original)
+++ trunk/daemon/gdm-display.c	Tue Jan 22 18:05:21 2008
@@ -204,13 +204,16 @@
                                          GError    **error)
 {
         GdmDisplayAccessFile *access_file;
-        GError *access_file_error;
+        GError               *access_file_error;
 
         g_return_val_if_fail (GDM_IS_DISPLAY (display), FALSE);
         g_return_val_if_fail (display->priv->access_file != NULL, FALSE);
 
+        g_debug ("GdmDisplay: Adding user authorization for %s", username);
+
         access_file_error = NULL;
-        access_file = _create_access_file_for_user (display, username,
+        access_file = _create_access_file_for_user (display,
+                                                    username,
                                                     &access_file_error);
 
         if (access_file == NULL) {
@@ -219,9 +222,13 @@
         }
 
         if (!gdm_display_access_file_add_display_with_cookie (access_file,
-                                                              display, display->priv->x11_cookie,
+                                                              display,
+                                                              display->priv->x11_cookie,
                                                               display->priv->x11_cookie_size,
                                                               &access_file_error)) {
+                g_debug ("GdmDisplay: Unable to add user authorization for %s: %s",
+                         username,
+                         access_file_error->message);
                 g_propagate_error (error, access_file_error);
                 gdm_display_access_file_close (access_file);
                 g_object_unref (access_file);
@@ -231,6 +238,8 @@
         *filename = gdm_display_access_file_get_path (access_file);
         display->priv->user_access_file = access_file;
 
+        g_debug ("GdmDisplay: Added user authorization for %s: %s", username, *filename);
+
         return TRUE;
 }
 
@@ -468,7 +477,7 @@
 
         display->priv->status = GDM_DISPLAY_UNMANAGED;
 
-        g_debug ("GdmDisplay unmanage display");
+        g_debug ("GdmDisplay: unmanage display");
 
         if (display->priv->slave_proxy != NULL) {
                 gdm_slave_proxy_stop (display->priv->slave_proxy);
@@ -499,7 +508,7 @@
 
         g_return_val_if_fail (GDM_IS_DISPLAY (display), FALSE);
 
-        g_debug ("Unmanaging display");
+        g_debug ("GdmDisplay: Unmanaging display");
 
         g_object_ref (display);
         ret = GDM_DISPLAY_GET_CLASS (display)->unmanage (display);
@@ -759,7 +768,7 @@
                 display->priv->finish_idle_id = 0;
         }
 
-        g_debug ("Disposing display");
+        g_debug ("GdmDisplay: Disposing display");
         gdm_display_unmanage (display);
 
         G_OBJECT_CLASS (gdm_display_parent_class)->dispose (object);
@@ -878,7 +887,7 @@
 
         g_return_if_fail (display->priv != NULL);
 
-        g_debug ("Finalizing display: %s", display->priv->id);
+        g_debug ("GdmDisplay: Finalizing display: %s", display->priv->id);
         g_free (display->priv->id);
         g_free (display->priv->seat_id);
         g_free (display->priv->remote_hostname);

Modified: trunk/daemon/gdm-factory-slave.c
==============================================================================
--- trunk/daemon/gdm-factory-slave.c	(original)
+++ trunk/daemon/gdm-factory-slave.c	Tue Jan 22 18:05:21 2008
@@ -270,6 +270,7 @@
                             GdmFactorySlave *slave)
 {
         g_debug ("GdmFactorySlave: Relay session started");
+
         gdm_greeter_server_reset (slave->priv->greeter_server);
 }
 

Modified: trunk/daemon/gdm-product-display.c
==============================================================================
--- trunk/daemon/gdm-product-display.c	(original)
+++ trunk/daemon/gdm-product-display.c	Tue Jan 22 18:05:21 2008
@@ -74,7 +74,7 @@
                                             char      **filename,
                                             GError    **error)
 {
-        return TRUE;
+        return GDM_DISPLAY_CLASS (gdm_product_display_parent_class)->add_user_authorization (display, username, filename, error);
 }
 
 static gboolean
@@ -82,7 +82,7 @@
                                                const char *username,
                                                GError    **error)
 {
-        return TRUE;
+        return GDM_DISPLAY_CLASS (gdm_product_display_parent_class)->remove_user_authorization (display, username, error);
 }
 
 static gboolean

Modified: trunk/daemon/gdm-product-slave.c
==============================================================================
--- trunk/daemon/gdm-product-slave.c	(original)
+++ trunk/daemon/gdm-product-slave.c	Tue Jan 22 18:05:21 2008
@@ -266,9 +266,12 @@
         gboolean ret;
 
         username = gdm_session_direct_get_username (slave->priv->session);
+
         ret = gdm_slave_add_user_authorization (GDM_SLAVE (slave),
                                                 username,
                                                 filename);
+        g_debug ("GdmProductSlave: Adding user authorization for %s: %s", username, *filename);
+
         g_free (username);
 
         return ret;
@@ -283,6 +286,8 @@
         auth_file = NULL;
         add_user_authorization (slave, &auth_file);
 
+        g_assert (auth_file != NULL);
+
         display_device = NULL;
         if (slave->priv->server != NULL) {
                 display_device = gdm_server_get_display_device (slave->priv->server);
@@ -563,7 +568,7 @@
 on_relay_establish_credentials (GdmProductSlave *slave,
                                 DBusMessage     *message)
 {
-        g_debug ("GdmProductSlave: Relay Authorize");
+        g_debug ("GdmProductSlave: Relay EstablishCredentials");
 
         gdm_session_accredit (GDM_SESSION (slave->priv->session), GDM_SESSION_CRED_ESTABLISH);
 }
@@ -572,7 +577,7 @@
 on_relay_renew_credentials (GdmProductSlave *slave,
                             DBusMessage     *message)
 {
-        g_debug ("GdmProductSlave: Relay Authorize");
+        g_debug ("GdmProductSlave: Relay RenewCredentials");
 
         gdm_session_accredit (GDM_SESSION (slave->priv->session), GDM_SESSION_CRED_RENEW);
 }

Modified: trunk/daemon/gdm-session-direct.c
==============================================================================
--- trunk/daemon/gdm-session-direct.c	(original)
+++ trunk/daemon/gdm-session-direct.c	Tue Jan 22 18:05:21 2008
@@ -447,6 +447,18 @@
         return DBUS_HANDLER_RESULT_HANDLED;
 }
 
+static void
+gdm_session_direct_select_user (GdmSession *session,
+                                const char *text)
+{
+        GdmSessionDirect *impl = GDM_SESSION_DIRECT (session);
+
+        g_debug ("GdmSessionDirect: Setting user: '%s'", text);
+
+        g_free (impl->priv->selected_user);
+        impl->priv->selected_user = g_strdup (text);
+}
+
 static DBusHandlerResult
 gdm_session_direct_handle_username_changed (GdmSessionDirect *session,
                                             DBusConnection   *connection,
@@ -471,8 +483,7 @@
                  session->priv->selected_user != NULL ? session->priv->selected_user : "<unset>",
                  (strlen (text)) ? text : "<unset>");
 
-        g_free (session->priv->selected_user);
-        session->priv->selected_user = (strlen (text) > 0) ? g_strdup (text) : NULL;
+        gdm_session_direct_select_user (GDM_SESSION (session), (strlen (text) > 0) ? g_strdup (text) : NULL);
 
         _gdm_session_selected_user_changed (GDM_SESSION (session), session->priv->selected_user);
 
@@ -1389,7 +1400,7 @@
         g_return_if_fail (dbus_connection_get_is_connected (impl->priv->worker_connection));
         g_return_if_fail (username != NULL);
 
-        impl->priv->selected_user = g_strdup (username);
+        gdm_session_direct_select_user (session, username);
 
         send_setup_for_user (impl);
 }
@@ -1620,6 +1631,8 @@
                 display_device = "";
         }
 
+        g_assert (session->priv->selected_user != NULL);
+
         pwent = getpwnam (session->priv->selected_user);
         if (pwent == NULL) {
                 return FALSE;
@@ -1836,16 +1849,6 @@
         impl->priv->selected_language = g_strdup (text);
 }
 
-static void
-gdm_session_direct_select_user (GdmSession *session,
-                                const char *text)
-{
-        GdmSessionDirect *impl = GDM_SESSION_DIRECT (session);
-
-        g_free (impl->priv->selected_user);
-        impl->priv->selected_user = g_strdup (text);
-}
-
 /* At some point we may want to read these right from
  * the slave but for now I don't want the dependency */
 static void

Modified: trunk/daemon/gdm-session-worker.c
==============================================================================
--- trunk/daemon/gdm-session-worker.c	(original)
+++ trunk/daemon/gdm-session-worker.c	Tue Jan 22 18:05:21 2008
@@ -480,6 +480,10 @@
         username = NULL;
         res = gdm_session_worker_get_username (worker, &username);
         if (res) {
+                g_debug ("GdmSessionWorker: old-username='%s' new-username='%s'",
+                         username != NULL ? username : "<unset>",
+                         worker->priv->username != NULL ? worker->priv->username : "<unset>");
+
                 if ((worker->priv->username == username) ||
                     ((worker->priv->username != NULL) && (username != NULL) &&
                      (strcmp (worker->priv->username, username) == 0)))

Modified: trunk/daemon/gdm-simple-slave.c
==============================================================================
--- trunk/daemon/gdm-simple-slave.c	(original)
+++ trunk/daemon/gdm-simple-slave.c	Tue Jan 22 18:05:21 2008
@@ -237,6 +237,8 @@
         auth_file = NULL;
         add_user_authorization (slave, &auth_file);
 
+        g_assert (auth_file != NULL);
+
         g_object_set (session,
                       "user-x11-authority-file", auth_file,
                       NULL);

Modified: trunk/daemon/gdm-static-factory-display.c
==============================================================================
--- trunk/daemon/gdm-static-factory-display.c	(original)
+++ trunk/daemon/gdm-static-factory-display.c	Tue Jan 22 18:05:21 2008
@@ -128,7 +128,7 @@
                                                    char      **filename,
                                                    GError    **error)
 {
-        return FALSE;
+        return GDM_DISPLAY_CLASS (gdm_static_factory_display_parent_class)->add_user_authorization (display, username, filename, error);
 }
 
 static gboolean
@@ -136,7 +136,7 @@
                                                       const char *username,
                                                       GError    **error)
 {
-        return FALSE;
+        return GDM_DISPLAY_CLASS (gdm_static_factory_display_parent_class)->remove_user_authorization (display, username, error);
 }
 
 static gboolean

Modified: trunk/gui/simple-greeter/gdm-greeter-login-window.c
==============================================================================
--- trunk/gui/simple-greeter/gdm-greeter-login-window.c	(original)
+++ trunk/gui/simple-greeter/gdm-greeter-login-window.c	Tue Jan 22 18:05:21 2008
@@ -487,7 +487,7 @@
 
 static void
 on_user_unchosen (GdmUserChooserWidget  *user_chooser,
-                     GdmGreeterLoginWindow *login_window)
+                  GdmGreeterLoginWindow *login_window)
 {
         do_cancel (login_window);
 }



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