From 6106de34e56cf6a3b4655f799c88ab1c349ae4a9 Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Thu, 24 Jun 2004 21:35:16 +0000 Subject: r1247: Final fix to make this compile on Heimdal. Jeremy. (This used to be commit b462b8fa2f264bef62ed4cd2aaacb2f21e135068) --- source3/configure.in | 61 +++++++++++++++++++++++++++++---------------- source3/libads/krb5_setpw.c | 4 +++ 2 files changed, 43 insertions(+), 22 deletions(-) (limited to 'source3') diff --git a/source3/configure.in b/source3/configure.in index 9bc69926ad..44ef66ab8c 100644 --- a/source3/configure.in +++ b/source3/configure.in @@ -2883,7 +2883,45 @@ if test x"$with_ads_support" != x"no"; then KRB5_LIBS="" with_ads_support=no fi - LIBS="$ac_save_LIBS" + + AC_CACHE_CHECK([for WRFILE: keytab support], + samba_cv_HAVE_WRFILE_KEYTAB,[ + AC_TRY_RUN([ +#include + main() + { + krb5_context context; + krb5_keytab keytab; + + krb5_init_context(&context); + if (krb5_kt_resolve(context, "WRFILE:api", &keytab)) + exit(0); + exit(1); + }], + samba_cv_HAVE_WRFILE_KEYTAB=no, + samba_cv_HAVE_WRFILE_KEYTAB=yes)]) + + if test x"$samba_cv_HAVE_WRFILE_KEYTAB" = x"yes"; then + AC_DEFINE(HAVE_WRFILE_KEYTAB,1, + [Whether the WRFILE:-keytab is supported]) + fi + + AC_CACHE_CHECK([for krb5_princ_realm returns krb5_realm or krb5_data], + samba_cv_KRB5_PRINC_REALM_RETURNS_REALM,[ + AC_TRY_COMPILE([#include ], + [ + krb5_context context; + krb5_principal principal; + krb5_realm realm; realm = *krb5_princ_realm(context, principal);], + samba_cv_KRB5_PRINC_REALM_RETURNS_REALM=yes, + samba_cv_KRB5_PRINC_REALM_RETURNS_REALM=no)]) + + if test x"$samba_cv_KRB5_PRINC_REALM_RETURNS_REALM" = x"yes"; then + AC_DEFINE(KRB5_PRINC_REALM_RETURNS_REALM,1, + [Whether krb5_princ_realm returns krb5_realm or krb5_data]) + fi + +LIBS="$ac_save_LIBS" fi ######################################################## @@ -2970,27 +3008,6 @@ AC_ARG_WITH(smbmount, AC_MSG_RESULT(no) ) -AC_CACHE_CHECK([for WRFILE: keytab support], - samba_cv_HAVE_WRFILE_KEYTAB,[ - AC_TRY_RUN([ -#include - main() - { - krb5_context context; - krb5_keytab keytab; - - krb5_init_context(&context); - if (krb5_kt_resolve(context, "WRFILE:api", &keytab)) - exit(0); - exit(1); - }], - samba_cv_HAVE_WRFILE_KEYTAB=no, - samba_cv_HAVE_WRFILE_KEYTAB=yes)]) - - if test x"$samba_cv_HAVE_WRFILE_KEYTAB" = x"yes"; then - AC_DEFINE(HAVE_WRFILE_KEYTAB,1, - [Whether the WRFILE:-keytab is supported]) - fi ################################################# diff --git a/source3/libads/krb5_setpw.c b/source3/libads/krb5_setpw.c index c7e9e3fe76..84595212e6 100644 --- a/source3/libads/krb5_setpw.c +++ b/source3/libads/krb5_setpw.c @@ -468,7 +468,11 @@ ADS_STATUS ads_krb5_set_password(const char *kdc_host, const char *princ, char *princ_name = NULL; char *realm = NULL; krb5_creds creds, *credsp = NULL; +#if KRB5_PRINC_REALM_RETURNS_REALM + krb5_realm orig_realm; +#else krb5_data orig_realm; +#endif krb5_ccache ccache = NULL; ZERO_STRUCT(creds); -- cgit