summaryrefslogtreecommitdiff
path: root/source3
diff options
context:
space:
mode:
authorJeremy Allison <jra@samba.org>2004-06-24 21:35:16 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 10:52:02 -0500
commit6106de34e56cf6a3b4655f799c88ab1c349ae4a9 (patch)
tree11e89aec61bc134dcfbecf9334095b5d5e19e9a0 /source3
parent41416f3876da5a43077ff991817e73c44dd6ae70 (diff)
downloadsamba-6106de34e56cf6a3b4655f799c88ab1c349ae4a9.tar.gz
samba-6106de34e56cf6a3b4655f799c88ab1c349ae4a9.tar.bz2
samba-6106de34e56cf6a3b4655f799c88ab1c349ae4a9.zip
r1247: Final fix to make this compile on Heimdal.
Jeremy. (This used to be commit b462b8fa2f264bef62ed4cd2aaacb2f21e135068)
Diffstat (limited to 'source3')
-rw-r--r--source3/configure.in61
-rw-r--r--source3/libads/krb5_setpw.c4
2 files changed, 43 insertions, 22 deletions
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<krb5.h>
+ 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.h>],
+ [
+ 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<krb5.h>
- 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);