aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorcaillon <caillon@517b70f8-ed25-0410-8bf6-f5db08f7b76e>2006-10-29 17:42:34 +0000
committercaillon <caillon@517b70f8-ed25-0410-8bf6-f5db08f7b76e>2006-10-29 17:42:34 +0000
commit62bd5e3e3c6973a92b98ff633f33b810d53a73d7 (patch)
tree38bb22a55f2d1513c7825901d1d763e810afce3e
parent4d35371c465d9c0c30664f26b7dc8a0c19629bee (diff)
2006-10-29 Christopher Aillon <caillon@redhat.com>
* src/krb5-auth-dialog.c: Clean up the #ifdefs to make things slightly more readable. git-svn-id: http://svn.gnome.org/svn/krb5-auth-dialog/trunk@66 517b70f8-ed25-0410-8bf6-f5db08f7b76e
-rw-r--r--ChangeLog5
-rw-r--r--src/krb5-auth-dialog.c81
2 files changed, 33 insertions, 53 deletions
diff --git a/ChangeLog b/ChangeLog
index aecca53..e187520 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2006-10-29 Christopher Aillon <caillon@redhat.com>
+
+ * src/krb5-auth-dialog.c: Clean up the #ifdefs to
+ make things slightly more readable.
+
2006-07-24 Christopher Aillon <caillon@redhat.com>
* configure.ac: Release 0.7
diff --git a/src/krb5-auth-dialog.c b/src/krb5-auth-dialog.c
index bb0e0b1..4f70fb9 100644
--- a/src/krb5-auth-dialog.c
+++ b/src/krb5-auth-dialog.c
@@ -47,65 +47,64 @@ static gboolean always_run;
static int grab_credentials (gboolean renewable);
static gboolean get_tgt_from_ccache (krb5_context context, krb5_creds *creds);
-#if defined(HAVE_KRB5_CREDS_TICKET_FLAGS) && defined(TKT_FLG_FORWARDABLE)
+/* YAY for different Kerberos implementations */
static int
get_cred_forwardable(krb5_creds *creds)
{
+#if defined(HAVE_KRB5_CREDS_TICKET_FLAGS) && defined(TKT_FLG_FORWARDABLE)
return creds->ticket_flags & TKT_FLG_FORWARDABLE;
-}
#elif defined(HAVE_KRB5_CREDS_FLAGS_B_FORWARDABLE)
-static int
-get_cred_forwardable(krb5_creds *creds)
-{
return creds->flags.b.forwardable;
-}
#elif defined(HAVE_KRB5_CREDS_FLAGS) && defined(KDC_OPT_FORWARDABLE)
-static int
-get_cred_forwardable(krb5_creds *creds)
-{
return creds->flags & KDC_OPT_FORWARDABLE;
-}
#endif
+}
-#if defined(HAVE_KRB5_CREDS_TICKET_FLAGS) && defined(TKT_FLG_RENEWABLE)
static int
get_cred_renewable(krb5_creds *creds)
{
+#if defined(HAVE_KRB5_CREDS_TICKET_FLAGS) && defined(TKT_FLG_RENEWABLE)
return creds->ticket_flags & TKT_FLG_RENEWABLE;
-}
#elif defined(HAVE_KRB5_CREDS_FLAGS_B_RENEWABLE)
-static int
-get_cred_renewable(krb5_creds *creds)
-{
return creds->flags.b.renewable;
-}
#elif defined(HAVE_KRB5_CREDS_FLAGS) && defined(KDC_OPT_RENEWABLE)
-static int
-get_cred_renewable(krb5_creds *creds)
-{
return creds->flags & KDC_OPT_RENEWABLE;
-}
#endif
+}
-#if defined(HAVE_KRB5_CREDS_TICKET_FLAGS) && defined(TKT_FLG_PROXIABLE)
static int
get_cred_proxiable(krb5_creds *creds)
{
+#if defined(HAVE_KRB5_CREDS_TICKET_FLAGS) && defined(TKT_FLG_PROXIABLE)
return creds->ticket_flags & TKT_FLG_PROXIABLE;
-}
#elif defined(HAVE_KRB5_CREDS_FLAGS_B_PROXIABLE)
-static int
-get_cred_proxiable(krb5_creds *creds)
-{
return creds->flags.b.proxiable;
-}
#elif defined(HAVE_KRB5_CREDS_FLAGS) && defined(KDC_OPT_PROXIABLE)
-static int
-get_cred_proxiable(krb5_creds *creds)
-{
return creds->flags & KDC_OPT_PROXIABLE;
+#endif
+}
+
+static size_t
+get_principal_realm_length(krb5_principal p)
+{
+#if defined(HAVE_KRB5_PRINCIPAL_REALM_AS_STRING)
+ return strlen(p->realm);
+#elif defined(HAVE_KRB5_PRINCIPAL_REALM_AS_DATA)
+ return p->realm.length;
+#endif
}
+
+static const char *
+get_principal_realm_data(krb5_principal p)
+{
+#if defined(HAVE_KRB5_PRINCIPAL_REALM_AS_STRING)
+ return p->realm;
+#elif defined(HAVE_KRB5_PRINCIPAL_REALM_AS_DATA)
+ return p->realm.data;
#endif
+}
+/* ***************************************************************** */
+/* ***************************************************************** */
static gchar* minutes_to_expiry_text (int minutes)
{
@@ -497,30 +496,6 @@ out:
return retval;
}
-#if defined(HAVE_KRB5_PRINCIPAL_REALM_AS_STRING)
-static size_t
-get_principal_realm_length(krb5_principal p)
-{
- return strlen(p->realm);
-}
-static const char *
-get_principal_realm_data(krb5_principal p)
-{
- return p->realm;
-}
-#elif defined(HAVE_KRB5_PRINCIPAL_REALM_AS_DATA)
-static size_t
-get_principal_realm_length(krb5_principal p)
-{
- return p->realm.length;
-}
-static const char *
-get_principal_realm_data(krb5_principal p)
-{
- return p->realm.data;
-}
-#endif
-
static gboolean
get_tgt_from_ccache (krb5_context context, krb5_creds *creds)
{