[gnome-initial-setup] account: Add debug output while joining a domain
- From: Stefan Walter <stefw src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-initial-setup] account: Add debug output while joining a domain
- Date: Sun, 26 May 2013 18:39:26 +0000 (UTC)
commit d10d16eb1b5a591573c3e443a98fea30e952fd3f
Author: Stef Walter <stefw redhat com>
Date: Sat May 25 07:01:37 2013 +0200
account: Add debug output while joining a domain
https://bugzilla.gnome.org/show_bug.cgi?id=700996
.../pages/account/um-realm-manager.c | 37 +++++++++++++++++--
1 files changed, 33 insertions(+), 4 deletions(-)
---
diff --git a/gnome-initial-setup/pages/account/um-realm-manager.c
b/gnome-initial-setup/pages/account/um-realm-manager.c
index 301c905..87bd0a8 100644
--- a/gnome-initial-setup/pages/account/um-realm-manager.c
+++ b/gnome-initial-setup/pages/account/um-realm-manager.c
@@ -329,6 +329,8 @@ um_realm_manager_discover (UmRealmManager *self,
g_return_if_fail (input != NULL);
g_return_if_fail (cancellable == NULL || G_IS_CANCELLABLE (cancellable));
+ g_debug ("Discovering realms for: %s", input);
+
res = g_simple_async_result_new (G_OBJECT (self), callback, user_data,
um_realm_manager_discover);
discover = g_slice_new0 (DiscoverClosure);
@@ -475,6 +477,9 @@ on_realm_join_complete (GObject *source,
gpointer user_data)
{
GSimpleAsyncResult *async = G_SIMPLE_ASYNC_RESULT (user_data);
+
+ g_debug ("Completed Join() method call");
+
g_simple_async_result_set_op_res_gpointer (async, g_object_ref (result), g_object_unref);
g_simple_async_result_complete_in_idle (async);
g_object_unref (async);
@@ -502,6 +507,7 @@ realm_join_as_owner (UmRealmObject *realm,
type = find_supported_credentials (membership, owner);
if (type == NULL) {
+ g_debug ("Couldn't find supported credential type for owner: %s", owner);
g_object_unref (membership);
return FALSE;
}
@@ -510,12 +516,14 @@ realm_join_as_owner (UmRealmObject *realm,
realm_join_as_owner);
if (g_str_equal (type, "ccache")) {
+ g_debug ("Using a kerberos credential cache to join the realm");
contents = g_variant_new_from_data (G_VARIANT_TYPE ("ay"),
g_bytes_get_data (credentials, NULL),
g_bytes_get_size (credentials),
TRUE, (GDestroyNotify)g_bytes_unref, credentials);
} else if (g_str_equal (type, "password")) {
+ g_debug ("Using a user/password to join the realm");
contents = g_variant_new ("(ss)", login, password);
} else {
@@ -525,6 +533,8 @@ realm_join_as_owner (UmRealmObject *realm,
creds = g_variant_new ("(ssv)", type, owner, contents);
options = g_variant_new_array (G_VARIANT_TYPE ("{sv}"), NULL, 0);
+ g_debug ("Calling the Join() method with %s credentials", owner);
+
um_realm_kerberos_membership_call_join (membership, creds, options,
cancellable, on_realm_join_complete,
g_object_ref (async));
@@ -600,6 +610,7 @@ um_realm_join_finish (UmRealmObject *realm,
dbus_error = g_dbus_error_get_remote_error (call_error);
if (dbus_error == NULL) {
+ g_debug ("Join() failed because of %s", call_error->message);
g_propagate_error (error, call_error);
return FALSE;
}
@@ -607,10 +618,12 @@ um_realm_join_finish (UmRealmObject *realm,
g_dbus_error_strip_remote_error (call_error);
if (g_str_equal (dbus_error, "org.freedesktop.realmd.Error.AuthenticationFailed")) {
+ g_debug ("Join() failed because of invalid/insufficient credentials");
g_set_error (error, UM_REALM_ERROR, UM_REALM_ERROR_BAD_LOGIN,
"%s", call_error->message);
g_error_free (call_error);
} else {
+ g_debug ("Join() failed because of %s", call_error->message);
g_propagate_error (error, call_error);
}
@@ -654,10 +667,16 @@ login_perform_kinit (krb5_context k5,
name = g_strdup_printf ("%s %s", login, realm);
code = krb5_parse_name (k5, name, &principal);
- g_free (name);
- if (code != 0)
+ if (code != 0) {
+ g_debug ("Couldn't parse principal name: %s: %s",
+ name, krb5_get_error_message (k5, code));
+ g_free (name);
return code;
+ }
+
+ g_debug ("Using principal name to kinit: %s", name);
+ g_free (name);
if (filename == NULL)
code = krb5_cc_default (k5, &ccache);
@@ -666,6 +685,9 @@ login_perform_kinit (krb5_context k5,
if (code != 0) {
krb5_free_principal (k5, principal);
+ g_debug ("Couldn't open credential cache: %s: %s",
+ filename ? filename : "<default>",
+ krb5_get_error_message (k5, code));
return code;
}
@@ -683,8 +705,12 @@ login_perform_kinit (krb5_context k5,
krb5_cc_close (k5, ccache);
krb5_free_principal (k5, principal);
- if (code == 0)
+ if (code == 0) {
+ g_debug ("kinit succeeded");
krb5_free_cred_contents (k5, &creds);
+ } else {
+ g_debug ("kinit failed: %s", krb5_get_error_message (k5, code));
+ }
return code;
}
@@ -727,8 +753,10 @@ kinit_thread_func (GSimpleAsyncResult *async,
g_file_get_contents (filename, &contents, &length, &error);
if (error == NULL) {
login->credentials = g_bytes_new_take (contents, length);
+ g_debug ("Read in credential cache: %s", filename);
} else {
- g_warning ("Couldn't read credential cache: %s", error->message);
+ g_warning ("Couldn't read credential cache: %s: %s",
+ filename, error->message);
g_error_free (error);
}
}
@@ -756,6 +784,7 @@ kinit_thread_func (GSimpleAsyncResult *async,
if (filename) {
g_unlink (filename);
+ g_debug ("Deleted credential cache: %s", filename);
g_free (filename);
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]