lib/krb5: add new KRB5_ERROR_CODE() abstraction macro.
authorGünther Deschner <gd@samba.org>
Thu, 9 Jul 2015 16:00:49 +0000 (18:00 +0200)
committerAndreas Schneider <asn@cryptomilk.org>
Tue, 14 Jul 2015 14:11:18 +0000 (16:11 +0200)
Guenther

Signed-off-by: Günther Deschner <gd@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
lib/krb5_wrap/krb5_samba.h

index 12711e8cd325412cc5471d15865fa53a46fcf048..cef9144a17e8bd3049932ba0bd3efdc45b0f9f07 100644 (file)
@@ -109,6 +109,12 @@ typedef struct {
 #define KRB5_KEY_DATA_CAST     krb5_octet
 #endif /* HAVE_KRB5_KEYBLOCK_KEYVALUE */
 
+#ifdef HAVE_E_DATA_POINTER_IN_KRB5_ERROR /* Heimdal */
+#define KRB5_ERROR_CODE(k)     ((k)->error_code)
+#else /* MIT */
+#define KRB5_ERROR_CODE(k)     ((k)->error)
+#endif /* HAVE_E_DATA_POINTER_IN_KRB5_ERROR */
+
 krb5_error_code smb_krb5_parse_name(krb5_context context,
                                const char *name, /* in unix charset */
                                 krb5_principal *principal);