If the LDAP KDB back end is being built, define ENABLE_LDAP. If
authorKen Raeburn <raeburn@mit.edu>
Thu, 14 Aug 2008 21:32:58 +0000 (21:32 +0000)
committerKen Raeburn <raeburn@mit.edu>
Thu, 14 Aug 2008 21:32:58 +0000 (21:32 +0000)
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

src/configure.in
src/lib/krb5/asn.1/ldap_key_seq.c
src/lib/krb5/os/accessor.c

index b2908232008c10adc15baa5a78466147818f56fc..ffec8b0af6939def44ee4772157e7b19bbadd195 100644 (file)
@@ -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)
index 6d0ef1a636d2ef43292cd70e9bb02f11a272f844..07e7f25b727d76dc96fe5c8f705ad0cb9b72416d 100644 (file)
@@ -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
index cd345ff56e4da5d187321ac0f418ee52e9e3c633..c0cc495c61bc9dc0fa6082d1838c0f73b62717b3 100644 (file)
@@ -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)