diff options
author | Andrew Bartlett <abartlet@samba.org> | 2012-01-05 11:06:28 +1100 |
---|---|---|
committer | Andrew Bartlett <abartlet@samba.org> | 2012-01-10 21:50:07 +0100 |
commit | 39b476d1c9f97b5d1fbc9b08d7a85ac0d59934f2 (patch) | |
tree | 6a4dca51c97a4c9a923d767e72420dbeb6c5577e | |
parent | fc7b34c83a2fe44b905e8af44dcb6d06154f688d (diff) | |
download | samba-39b476d1c9f97b5d1fbc9b08d7a85ac0d59934f2.tar.gz samba-39b476d1c9f97b5d1fbc9b08d7a85ac0d59934f2.tar.bz2 samba-39b476d1c9f97b5d1fbc9b08d7a85ac0d59934f2.zip |
krb5: Require krb5_get_init_creds_opt_alloc/free for build with krb5
This also assumes the modern API with a krb5_context argument.
Andrew Bartlett
-rw-r--r-- | source3/configure.in | 12 | ||||
-rw-r--r-- | source3/libsmb/clikrb5.c | 29 | ||||
-rw-r--r-- | source3/wscript | 6 |
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") |