Merge of krb5_keytab entry key vs keyblock member check from HEAD.
authorTim Potter <tpot@samba.org>
Tue, 21 Oct 2003 04:45:33 +0000 (04:45 +0000)
committerTim Potter <tpot@samba.org>
Tue, 21 Oct 2003 04:45:33 +0000 (04:45 +0000)
(This used to be commit 720f5e5629c54e851c3e9026dc88676795e44c8e)

source3/configure.in
source3/libads/kerberos_verify.c

index f3b3f9272bf339cbaf9e2156bf4f9e697689be24..16b07608028dcbbcc1bac5c134d01c110de5861b 100644 (file)
@@ -2654,6 +2654,15 @@ if test x"$with_ads_support" != x"no"; then
                [Whether in-memory keytabs are supported])
   fi
 
+  AC_CHECK_MEMBER(krb5_keytab_entry.key,
+       AC_DEFINE(HAVE_KRB5_KEYTAB_ENTRY_KEY, 1, 
+               [Whether krb5_keytab_entry has key member]), [],
+               [#include <krb5.h>])
+
+  AC_CHECK_MEMBER(krb5_keytab_entry.keyblock,
+       AC_DEFINE(HAVE_KRB5_KEYTAB_ENTRY_KEYBLOCK, 1, 
+               [Whether krb5_keytab_entry has keyblock member]), [],
+               [#include <krb5.h>])
 
   if test x"$ac_cv_lib_ext_krb5_krb5_mk_req_extended" = x"yes"; then
     AC_DEFINE(HAVE_KRB5,1,[Whether to have KRB5 support])
index 4ae89aa01f3fdef53b4936d970e05a28720ed8ea..cdea5a2fe420fe216bbdaceeba82337ae37db9a6 100644 (file)
@@ -71,10 +71,18 @@ static krb5_error_code create_keytab(krb5_context context,
 
                entry.principal = host_princ;
                entry.vno       = kvno;
-               /* this will have to be detected in configure...heimdal
-                  calls it keyblock, MIT calls it key, but it does not
-                  matter we are creating keytabs with MIT */
-               entry.keyblock  = *key;
+
+#if !defined(HAVE_KRB5_KEYTAB_ENTRY_KEY) && !defined(HAVE_KRB5_KEYTAB_ENTRY_KEYBLOCK)
+#error krb5_keytab_entry has no key or keyblock member
+#endif
+
+#ifdef HAVE_KRB5_KEYTAB_ENTRY_KEY /* MIT */
+               entry.key = *key; 
+#endif
+
+#ifdef HAVE_KRB5_KEYTAB_ENTRY_KEYBLOCK /* Heimdal */
+               entry.keyblock = *key;
+#endif
 
                DEBUG(10,("adding keytab-entry for (%s) with encryption type (%d)\n",
                                host_princ_s, enctypes[i]));