summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-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);