From: Ken Raeburn Date: Thu, 14 Aug 2008 21:32:58 +0000 (+0000) Subject: If the LDAP KDB back end is being built, define ENABLE_LDAP. If X-Git-Tag: krb5-1.7-alpha1~490 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=3f6a4615b9b2c145e8ca16dd034e44eaac42b600;p=krb5.git 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 --- diff --git a/src/configure.in b/src/configure.in index b29082320..ffec8b0af 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 6d0ef1a63..07e7f25b7 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 cd345ff56..c0cc495c6 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)