Some handy debugging code for gssapi errors in credential acquisition; currently...
authorKen Raeburn <raeburn@mit.edu>
Wed, 4 Jul 2007 04:00:36 +0000 (04:00 +0000)
committerKen Raeburn <raeburn@mit.edu>
Wed, 4 Jul 2007 04:00:36 +0000 (04:00 +0000)
git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@19667 dc483132-0cff-0310-8789-dd5450dbe970

src/lib/kadm5/clnt/client_init.c

index 26a7304d9d6bbaf591fe5638f7ab5aed18162b15..92cb715b297b4768458aaf7f7e5ab1cd3d64c6fd 100644 (file)
@@ -605,6 +605,50 @@ kadm5_setup_gss(kadm5_server_handle_t handle,
                                &gss_client_creds, NULL, NULL);
      if (gssstat != GSS_S_COMPLETE) {
          code = KADM5_GSS_ERROR;
+#if 0 /* for debugging only */
+         {
+             OM_uint32 maj_status, min_status, message_context = 0;
+             gss_buffer_desc status_string;
+             do {
+                 maj_status = gss_display_status(&min_status,
+                                                 gssstat,
+                                                 GSS_C_GSS_CODE,
+                                                 GSS_C_NO_OID,
+                                                 &message_context,
+                                                 &status_string);
+                 if (maj_status == GSS_S_COMPLETE) {
+                     fprintf(stderr, "MAJ: %.*s\n",
+                             (int) status_string.length,
+                             (char *)status_string.value);
+                     gss_release_buffer(&min_status, &status_string);
+                 } else {
+                     fprintf(stderr,
+                             "MAJ? gss_display_status returns 0x%lx?!\n",
+                             (unsigned long) maj_status);
+                     message_context = 0;
+                 }
+             } while (message_context != 0);
+             do {
+                 maj_status = gss_display_status(&min_status,
+                                                 minor_stat,
+                                                 GSS_C_MECH_CODE,
+                                                 GSS_C_NO_OID,
+                                                 &message_context,
+                                                 &status_string);
+                 if (maj_status == GSS_S_COMPLETE) {
+                     fprintf(stderr, "MIN: %.*s\n",
+                             (int) status_string.length,
+                             (char *)status_string.value);
+                     gss_release_buffer(&min_status, &status_string);
+                 } else {
+                     fprintf(stderr,
+                             "MIN? gss_display_status returns 0x%lx?!\n",
+                             (unsigned long) maj_status);
+                     message_context = 0;
+                 }
+             } while (message_context != 0);
+         }
+#endif
          goto error;
      }