[gnome-control-center] user-accounts: Recognize that some kerberos domains cannot be joined



commit 074a495f9737e76b28ed583d252b5361346229e2
Author: Stef Walter <stefw gnome org>
Date:   Sat Oct 6 13:01:03 2012 -0400

    user-accounts: Recognize that some kerberos domains cannot be joined
    
    realmd supports discovering generic kerberos domains, which cannot
    be joined. Add a usable error message in gnome-control-center in
    this case.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=685618

 panels/user-accounts/um-realm-manager.c |   15 +++++++++++++--
 1 files changed, 13 insertions(+), 2 deletions(-)
---
diff --git a/panels/user-accounts/um-realm-manager.c b/panels/user-accounts/um-realm-manager.c
index cc57c36..904876f 100644
--- a/panels/user-accounts/um-realm-manager.c
+++ b/panels/user-accounts/um-realm-manager.c
@@ -312,6 +312,7 @@ on_provider_discover (GObject *source,
         DiscoverClosure *discover = g_simple_async_result_get_op_res_gpointer (async);
         GDBusObject *object;
         GError *error = NULL;
+        gboolean no_membership = FALSE;
         gchar **realms;
         gint relevance;
         gint i;
@@ -324,12 +325,22 @@ on_provider_discover (GObject *source,
                         if (object == NULL) {
                                 g_warning ("Realm is not in object manager: %s", realms[i]);
                         } else {
-                                g_debug ("Discovered realm: %s", realms[i]);
-                                discover->realms = g_list_prepend (discover->realms, object);
+                                if (is_realm_with_kerberos_and_membership (object)) {
+                                        g_debug ("Discovered realm: %s", realms[i]);
+                                        discover->realms = g_list_prepend (discover->realms, object);
+                                } else {
+                                        g_debug ("Realm does not support kerberos membership: %s", realms[i]);
+                                        no_membership = TRUE;
+                                        g_object_unref (object);
+                                }
                         }
                 }
                 g_strfreev (realms);
 
+                if (!discover->realms && no_membership) {
+                        g_simple_async_result_set_error (async, UM_REALM_ERROR, UM_REALM_ERROR_GENERIC,
+                                                         _("Cannot automatically join this type of domain"));
+                }
         } else {
                 g_simple_async_result_take_error (async, error);
         }



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