summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--source3/configure.in12
-rw-r--r--source3/libsmb/clikrb5.c29
-rw-r--r--source3/wscript6
3 files changed, 18 insertions, 29 deletions
diff --git a/source3/configure.in b/source3/configure.in
index 914b7145da..b98b49ef88 100644
--- a/source3/configure.in
+++ b/source3/configure.in
@@ -4440,6 +4440,18 @@ if test x"$with_ads_support" != x"no"; then
use_ads=no
fi
+ if test x"$ac_cv_func_ext_krb5_get_init_creds_opt_alloc" != x"yes"
+ then
+ AC_MSG_WARN(krb5_get_init_creds_opt_alloc found in -lkrb5)
+ use_ads=no
+ fi
+
+ if test x"$smb_krb5_cv_creds_opt_free_context" != x"yes"
+ then
+ AC_MSG_WARN(krb5_get_init_creds_opt_free not found or was too old in -lkrb5)
+ use_ads=no
+ fi
+
if test x"$ac_cv_func_ext_krb5_principal2salt" != x"yes" -a \
x"$ac_cv_func_ext_krb5_get_pw_salt" != x"yes"
then
diff --git a/source3/libsmb/clikrb5.c b/source3/libsmb/clikrb5.c
index 76681198b4..adb9c9c6fb 100644
--- a/source3/libsmb/clikrb5.c
+++ b/source3/libsmb/clikrb5.c
@@ -1412,44 +1412,15 @@ done:
krb5_error_code smb_krb5_get_init_creds_opt_alloc(krb5_context context,
krb5_get_init_creds_opt **opt)
{
-#ifdef HAVE_KRB5_GET_INIT_CREDS_OPT_ALLOC
/* Heimdal or modern MIT version */
return krb5_get_init_creds_opt_alloc(context, opt);
-#else
- /* Historical MIT version */
- krb5_get_init_creds_opt *my_opt;
-
- *opt = NULL;
-
- if ((my_opt = SMB_MALLOC_P(krb5_get_init_creds_opt)) == NULL) {
- return ENOMEM;
- }
-
- krb5_get_init_creds_opt_init(my_opt);
-
- *opt = my_opt;
- return 0;
-#endif /* HAVE_KRB5_GET_INIT_CREDS_OPT_ALLOC */
}
void smb_krb5_get_init_creds_opt_free(krb5_context context,
krb5_get_init_creds_opt *opt)
{
-#ifdef HAVE_KRB5_GET_INIT_CREDS_OPT_FREE
-
-#ifdef KRB5_CREDS_OPT_FREE_REQUIRES_CONTEXT
/* Modern MIT or Heimdal version */
krb5_get_init_creds_opt_free(context, opt);
-#else
- /* Heimdal version */
- krb5_get_init_creds_opt_free(opt);
-#endif /* KRB5_CREDS_OPT_FREE_REQUIRES_CONTEXT */
-
-#else /* HAVE_KRB5_GET_INIT_CREDS_OPT_FREE */
- /* Historical MIT version */
- SAFE_FREE(opt);
- opt = NULL;
-#endif /* HAVE_KRB5_GET_INIT_CREDS_OPT_FREE */
}
krb5_enctype smb_get_enctype_from_kt_entry(krb5_keytab_entry *kt_entry)
diff --git a/source3/wscript b/source3/wscript
index 33ff56aa2d..a5bb371466 100644
--- a/source3/wscript
+++ b/source3/wscript
@@ -759,6 +759,12 @@ return krb5_kt_resolve(context, "WRFILE:api", &keytab);
if not conf.CONFIG_SET('HAVE_KRB5_FWD_TGT_CREDS'):
Logs.warn("krb5_fwd_tgt_creds found in -lkrb5")
use_ads=False
+ if not conf.CONFIG_SET('HAVE_KRB5_GET_INIT_CREDS_OPT_ALLOC'):
+ Logs.warn("krb5_get_init_creds_opt_alloc not found in -lkrb5")
+ use_ads=False
+ if not conf.CONFIG_SET('KRB5_CREDS_OPT_FREE_REQUIRES_CONTEXT'):
+ Logs.warn("krb5_get_init_creds_opt_free was not found or was too old in -lkrb5")
+ use_ads=False
if not conf.CONFIG_SET('HAVE_KRB5_PRINCIPAL2SALT') and \
not conf.CONFIG_SET('HAVE_KRB5_GET_PW_SALT'):
Logs.warn("no CREATE_KEY_FUNCTIONS detected")