From 8fde0b88d7c9360e16820d6086eba3e3ca0eee1e Mon Sep 17 00:00:00 2001 From: Sumit Bose Date: Mar 27 2017 15:57:28 +0000 Subject: ipa-kdb: do not depend on certauth_plugin.h Related to https://pagure.io/freeipa/issue/4905 Reviewed-By: Christian Heimes --- diff --git a/configure.ac b/configure.ac index 68340c8..f5c5270 100644 --- a/configure.ac +++ b/configure.ac @@ -231,6 +231,8 @@ dnl --------------------------------------------------------------------------- AM_CONDITIONAL([BUILD_IPA_CERTAUTH_PLUGIN], [test x$have_certauth_plugin = xyes -a x"$SSSCERTMAP_LIBS" != x]) AM_COND_IF([BUILD_IPA_CERTAUTH_PLUGIN], [ + AC_DEFINE([HAVE_KRB5_CERTAUTH_PLUGIN], [1], + [MIT Kerberos version supports certauth plugin]) AM_COND_IF([ENABLE_SERVER], [AC_MSG_NOTICE([Build IPA KDB certauth plugin])], [AC_MSG_WARN([Cannot build IPA KDB certauth plugin])]) diff --git a/daemons/ipa-kdb/ipa_kdb.c b/daemons/ipa-kdb/ipa_kdb.c index a961e4e..050bfc9 100644 --- a/daemons/ipa-kdb/ipa_kdb.c +++ b/daemons/ipa-kdb/ipa_kdb.c @@ -67,7 +67,9 @@ static void ipadb_context_free(krb5_context kcontext, } free(cfg->authz_data); +#ifdef HAVE_KRB5_CERTAUTH_PLUGIN ipa_certauth_free_moddata(&((*ctx)->certauth_moddata)); +#endif free(*ctx); *ctx = NULL; diff --git a/daemons/ipa-kdb/ipa_kdb.h b/daemons/ipa-kdb/ipa_kdb.h index 632c197..72573a6 100644 --- a/daemons/ipa-kdb/ipa_kdb.h +++ b/daemons/ipa-kdb/ipa_kdb.h @@ -30,6 +30,8 @@ * filtering purposes */ #define SECURID 1 +#include "config.h" + #include #include #include @@ -40,7 +42,9 @@ #include #include #include +#ifdef HAVE_KRB5_CERTAUTH_PLUGIN #include +#endif #include "ipa_krb5.h" #include "ipa_pwd.h" @@ -112,7 +116,9 @@ struct ipadb_context { krb5_key_salt_tuple *def_encs; int n_def_encs; struct ipadb_mspac *mspac; +#ifdef HAVE_KRB5_CERTAUTH_PLUGIN krb5_certauth_moddata certauth_moddata; +#endif /* Don't access this directly, use ipadb_get_global_config(). */ struct ipadb_global_config config; @@ -334,5 +340,7 @@ int ipadb_get_enc_salt_types(struct ipadb_context *ipactx, LDAPMessage *entry, char *attr, krb5_key_salt_tuple **enc_salt_types, int *n_enc_salt_types); +#ifdef HAVE_KRB5_CERTAUTH_PLUGIN /* CERTAUTH PLUGIN */ void ipa_certauth_free_moddata(krb5_certauth_moddata *moddata); +#endif