summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSumit Bose <sbose@redhat.com>2017-03-27 13:19:57 +0200
committerPavel Vomacka <pvomacka@redhat.com>2017-03-27 17:57:28 +0200
commit0ba0c0781367d8e2d4affca29e3cf5ab93c4c33a (patch)
treeadf8547b0b0f73344e007bf2c4a4c7174d067c8c
parent054f1bd78b04a79f765f524f829b34c0ee252a1b (diff)
downloadfreeipa-0ba0c0781367d8e2d4affca29e3cf5ab93c4c33a.tar.gz
freeipa-0ba0c0781367d8e2d4affca29e3cf5ab93c4c33a.tar.xz
freeipa-0ba0c0781367d8e2d4affca29e3cf5ab93c4c33a.zip
ipa-kdb: do not depend on certauth_plugin.h
Related to https://pagure.io/freeipa/issue/4905 Reviewed-By: Christian Heimes <cheimes@redhat.com>
-rw-r--r--configure.ac2
-rw-r--r--daemons/ipa-kdb/ipa_kdb.c2
-rw-r--r--daemons/ipa-kdb/ipa_kdb.h8
3 files changed, 12 insertions, 0 deletions
diff --git a/configure.ac b/configure.ac
index 68340c8ac..f5c52704f 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 a961e4e57..050bfc90c 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 632c1979d..72573a61a 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 <errno.h>
#include <kdb.h>
#include <ldap.h>
@@ -40,7 +42,9 @@
#include <arpa/inet.h>
#include <endian.h>
#include <unistd.h>
+#ifdef HAVE_KRB5_CERTAUTH_PLUGIN
#include <krb5/certauth_plugin.h>
+#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