[gdm] daemon: import consolekit error handling



commit d92d0b53d754e30daf0c053a5ed2a607f99228cb
Author: Ray Strode <rstrode redhat com>
Date:   Wed Aug 1 17:08:20 2012 -0400

    daemon: import consolekit error handling
    
    Make sure we always return an error in the consolekit session look up
    code when we can't find a session, so that callers don't get timeouts
    waiting for a reply that we previously neglected to send.

 daemon/gdm-manager.c |   12 ++++++++++++
 1 files changed, 12 insertions(+), 0 deletions(-)
---
diff --git a/daemon/gdm-manager.c b/daemon/gdm-manager.c
index 6d6f241..699addb 100644
--- a/daemon/gdm-manager.c
+++ b/daemon/gdm-manager.c
@@ -400,6 +400,11 @@ get_session_id_for_user_on_seat_consolekit (GDBusConnection  *connection,
                                              NULL,
                                              error);
         if (reply == NULL) {
+                g_set_error (error,
+                             G_DBUS_ERROR,
+                             G_DBUS_ERROR_ACCESS_DENIED,
+                             _("Unable to find session for user %s"),
+                             username);
                 return NULL;
         }
 
@@ -464,6 +469,13 @@ get_session_id_for_user_on_seat_consolekit (GDBusConnection  *connection,
         g_free (sessions);
         g_variant_unref (reply);
 
+        if (session == NULL) {
+                g_set_error (error,
+                             G_DBUS_ERROR,
+                             G_DBUS_ERROR_ACCESS_DENIED,
+                             _("Unable to find appropriate session for user %s"),
+                             username);
+        }
         return session;
 }
 #endif



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