summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKen Raeburn <raeburn@mit.edu>2008-08-14 21:32:58 +0000
committerKen Raeburn <raeburn@mit.edu>2008-08-14 21:32:58 +0000
commit3f6a4615b9b2c145e8ca16dd034e44eaac42b600 (patch)
tree79b7f9776cb66437aa76452b77a46d2dccd07a2e
parent3ceb437bee2c48950e5b4131164276870b40f8e7 (diff)
downloadkrb5-3f6a4615b9b2c145e8ca16dd034e44eaac42b600.tar.gz
krb5-3f6a4615b9b2c145e8ca16dd034e44eaac42b600.tar.xz
krb5-3f6a4615b9b2c145e8ca16dd034e44eaac42b600.zip
If the LDAP KDB back end is being built, define ENABLE_LDAP. If
ENABLE_LDAP is not defined, don't build the LDAP KDB ASN.1 encoding and decoding functions, and use null pointers for them in the accessor function table. git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@20659 dc483132-0cff-0310-8789-dd5450dbe970
-rw-r--r--src/configure.in1
-rw-r--r--src/lib/krb5/asn.1/ldap_key_seq.c3
-rw-r--r--src/lib/krb5/os/accessor.c11
3 files changed, 13 insertions, 2 deletions
diff --git a/src/configure.in b/src/configure.in
index b290823200..ffec8b0af6 100644
--- a/src/configure.in
+++ b/src/configure.in
@@ -1066,6 +1066,7 @@ if test -n "$OPENLDAP_PLUGIN"; then
AC_ERROR("BER library missing - cannot build LDAP database module")
fi
fi
+ AC_DEFINE([ENABLE_LDAP], 1, [Define if LDAP KDB support within the Kerberos library (mainly ASN.1 code) should be enabled.])
AC_SUBST(LDAP_LIBS)
K5_GEN_MAKEFILE(plugins/kdb/ldap)
diff --git a/src/lib/krb5/asn.1/ldap_key_seq.c b/src/lib/krb5/asn.1/ldap_key_seq.c
index 6d0ef1a636..07e7f25b72 100644
--- a/src/lib/krb5/asn.1/ldap_key_seq.c
+++ b/src/lib/krb5/asn.1/ldap_key_seq.c
@@ -39,6 +39,8 @@
#include "asn1_make.h"
#include "asn1_get.h"
+#ifdef ENABLE_LDAP
+
#define asn1_encode_sequence_of_keys krb5int_ldap_encode_sequence_of_keys
#define asn1_decode_sequence_of_keys krb5int_ldap_decode_sequence_of_keys
@@ -471,3 +473,4 @@ last:
return ret;
}
+#endif
diff --git a/src/lib/krb5/os/accessor.c b/src/lib/krb5/os/accessor.c
index cd345ff56e..c0cc495c61 100644
--- a/src/lib/krb5/os/accessor.c
+++ b/src/lib/krb5/os/accessor.c
@@ -81,8 +81,15 @@ krb5int_accessor(krb5int_access *internals, krb5_int32 version)
S (krb5int_c_mandatory_cksumtype, krb5int_c_mandatory_cksumtype),
S (krb5_ser_pack_int64, krb5_ser_pack_int64),
S (krb5_ser_unpack_int64, krb5_ser_unpack_int64),
- S (asn1_ldap_encode_sequence_of_keys, krb5int_ldap_encode_sequence_of_keys),
- S (asn1_ldap_decode_sequence_of_keys, krb5int_ldap_decode_sequence_of_keys),
+
+#ifdef ENABLE_LDAP
+#define SC(FIELD, VAL) S(FIELD, VAL)
+#else
+#define SC(FIELD, VAL) S(FIELD, 0)
+#endif
+ SC (asn1_ldap_encode_sequence_of_keys, krb5int_ldap_encode_sequence_of_keys),
+ SC (asn1_ldap_decode_sequence_of_keys, krb5int_ldap_decode_sequence_of_keys),
+#undef SC
#ifndef DISABLE_PKINIT
#define SC(FIELD, VAL) S(FIELD, VAL)