From: Greg Hudson Date: Tue, 28 Jun 2011 14:07:07 +0000 (+0000) Subject: Get static linking working again, mostly X-Git-Tag: krb5-1.10-alpha1~377 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=bc359880c203d769e230e3285af2512d22fc62aa;p=krb5.git Get static linking working again, mostly Static linking (#6510) broke when lockout support was added because the DB2 plugin became dependent on libkadm5srv_mit for XDR functions. Also, static linking was extensively broken in combination with LDAP support. Fix these problems. Afer these fixes, the test suite fails in the FAST tests because there's no static build support for dynamic preauth plugins, which means there's no encrypted challenge. (And unlike the pkinit tests, the test suite doesn't conditionalize on the presence of the encrypted challenge plugin, because we always build it.) This will fix itself if and when encrypted challenge becomes linked into the consumers, or static build support is added for preauth plugins. ticket: 6914 git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@24996 dc483132-0cff-0310-8789-dd5450dbe970 --- diff --git a/src/Makefile.in b/src/Makefile.in index 1bf2671a2..d64e195b9 100644 --- a/src/Makefile.in +++ b/src/Makefile.in @@ -8,10 +8,10 @@ mydir=. # plugins/preauth/cksum_body # plugins/authdata/greet SUBDIRS=util include lib \ - @ldap_plugin_dir@ \ @sam2_plugin@ \ plugins/kadm5_hook/test \ plugins/kdb/db2 \ + @ldap_plugin_dir@ \ plugins/preauth/pkinit \ plugins/preauth/encrypted_challenge \ kdc kadmin slave clients appl tests \ diff --git a/src/aclocal.m4 b/src/aclocal.m4 index 57a0a38d9..a56e7ec5e 100644 --- a/src/aclocal.m4 +++ b/src/aclocal.m4 @@ -1149,9 +1149,13 @@ if test "x$enable_static" = xyes; then KDB5_PLUGIN_DEPLIBS='$(TOPLIBD)/libkrb5_db2$(DEPLIBEXT)' KDB5_PLUGIN_LIBS='-lkrb5_db2' if test "x$OPENLDAP_PLUGIN" = xyes; then - KDB5_PLUGIN_DEBLIBS=$KDB5_PLUGIN_DEPLIBS' $(TOPLIBD)/libkrb5_ldap$(DEPLIBEXT)' - KDB5_PLUGIN_LIBS=$KDB_LUGIN_LIBS' -lkrb5_ldap' + KDB5_PLUGIN_DEBLIBS=$KDB5_PLUGIN_DEPLIBS' $(TOPLIBD)/libkrb5_ldap$(DEPLIBEXT) $(TOPLIBD)/libkdb_ldap$(DEPLIBEXT)' + KDB5_PLUGIN_LIBS=$KDB5_PLUGIN_LIBS' -lkrb5_kldap -lkdb_ldap $(LDAP_LIBS)' fi + # kadm5srv_mit normally comes before kdb on the link line. Add it + # again after the KDB plugins, since they depend on it for XDR stuff. + KDB5_PLUGIN_DEPLIBS=$KDB5_PLUGIN_DEPLIBS' $(TOPLIBD)/libkadm5srv_mit$(DEPLIBEXT)' + KDB5_PLUGIN_LIBS=$KDB5_PLUGIN_LIBS' -lkadm5srv_mit' # avoid duplicate rules generation for AIX and such SHLIBEXT=.so-nobuild diff --git a/src/config/pre.in b/src/config/pre.in index a81d150dd..7b96ebc7d 100644 --- a/src/config/pre.in +++ b/src/config/pre.in @@ -376,6 +376,8 @@ KDB5_LIB = -lkdb5 $(KDB5_PLUGIN_LIBS) DL_LIB = @DL_LIB@ +LDAP_LIBS = @LDAP_LIBS@ + KRB5_LIB = -lkrb5 K5CRYPTO_LIB = -lk5crypto COM_ERR_LIB = -lcom_err diff --git a/src/configure.in b/src/configure.in index 6b69df909..641a0f364 100644 --- a/src/configure.in +++ b/src/configure.in @@ -1066,7 +1066,7 @@ if test -n "$OPENLDAP_PLUGIN"; then K5_GEN_MAKEFILE(plugins/kdb/ldap) K5_GEN_MAKEFILE(plugins/kdb/ldap/ldap_util) K5_GEN_MAKEFILE(plugins/kdb/ldap/libkdb_ldap) - ldap_plugin_dir=plugins/kdb/ldap + ldap_plugin_dir='plugins/kdb/ldap plugins/kdb/ldap/ldap_util' LDAP=yes else LDAP=no diff --git a/src/lib/crypto/crypto_tests/Makefile.in b/src/lib/crypto/crypto_tests/Makefile.in index 555c90c64..5aeef54a6 100644 --- a/src/lib/crypto/crypto_tests/Makefile.in +++ b/src/lib/crypto/crypto_tests/Makefile.in @@ -71,40 +71,40 @@ check-unix:: t_nfold t_encrypt t_decrypt t_prf t_prng t_cmac t_hmac \ diff t_cf2.output $(srcdir)/t_cf2.expected # $(RUN_SETUP) $(VALGRIND) ./t_pkcs5 -t_nfold$(EXEEXT): t_nfold.$(OBJEXT) $(CRYPTO_DEPLIB) $(SUPPORT_DEPLIB) - $(CC_LINK) -o $@ t_nfold.$(OBJEXT) -lkrb5 -lk5crypto -lcom_err $(SUPPORT_LIB) +t_nfold$(EXEEXT): t_nfold.$(OBJEXT) $(KRB5_BASE_DEPLIBS) + $(CC_LINK) -o $@ t_nfold.$(OBJEXT) $(KRB5_BASE_LIBS) -t_encrypt$(EXEEXT): t_encrypt.$(OBJEXT) $(CRYPTO_DEPLIB) $(SUPPORT_DEPLIB) - $(CC_LINK) -o $@ t_encrypt.$(OBJEXT) -lkrb5 -lk5crypto -lcom_err $(SUPPORT_LIB) +t_encrypt$(EXEEXT): t_encrypt.$(OBJEXT) $(KRB5_BASE_DEPLIBS) + $(CC_LINK) -o $@ t_encrypt.$(OBJEXT) $(KRB5_BASE_LIBS) -t_decrypt$(EXEEXT): t_decrypt.$(OBJEXT) $(CRYPTO_DEPLIB) $(SUPPORT_DEPLIB) - $(CC_LINK) -o $@ t_decrypt.$(OBJEXT) -lkrb5 -lk5crypto -lcom_err $(SUPPORT_LIB) +t_decrypt$(EXEEXT): t_decrypt.$(OBJEXT) $(KRB5_BASE_DEPLIBS) + $(CC_LINK) -o $@ t_decrypt.$(OBJEXT) $(KRB5_BASE_LIBS) -t_prf$(EXEEXT): t_prf.$(OBJEXT) $(SUPPORT_DEPLIB) - $(CC_LINK) -o $@ t_prf.$(OBJEXT) -lkrb5 -lk5crypto -lcom_err $(SUPPORT_LIB) +t_prf$(EXEEXT): t_prf.$(OBJEXT) $(KRB5_BASE_DEPLIBS) + $(CC_LINK) -o $@ t_prf.$(OBJEXT) $(KRB5_BASE_LIBS) -t_prng$(EXEEXT): t_prng.$(OBJEXT) $(SUPPORT_DEPLIB) - $(CC_LINK) -o $@ t_prng.$(OBJEXT) -lk5crypto -lcom_err $(SUPPORT_LIB) +t_prng$(EXEEXT): t_prng.$(OBJEXT) $(KRB5_BASE_DEPLIBS) + $(CC_LINK) -o $@ t_prng.$(OBJEXT) $(KRB5_BASE_LIBS) -t_cmac$(EXEEXT): t_cmac.$(OBJEXT) $(CRYPTO_DEPLIB) $(SUPPORT_DEPLIB) - $(CC_LINK) -o $@ t_cmac.$(OBJEXT) $(K5CRYPTO_LIB) $(COM_ERR_LIB) $(SUPPORT_LIB) +t_cmac$(EXEEXT): t_cmac.$(OBJEXT) $(KRB5_BASE_DEPLIBS) + $(CC_LINK) -o $@ t_cmac.$(OBJEXT) $(KRB5_BASE_LIBS) -t_hmac$(EXEEXT): t_hmac.$(OBJEXT) $(CRYPTO_DEPLIB) $(SUPPORT_DEPLIB) - $(CC_LINK) -o $@ t_hmac.$(OBJEXT) $(K5CRYPTO_LIB) $(COM_ERR_LIB) $(SUPPORT_LIB) +t_hmac$(EXEEXT): t_hmac.$(OBJEXT) $(KRB5_BASE_DEPLIBS) + $(CC_LINK) -o $@ t_hmac.$(OBJEXT) $(KRB5_BASE_LIBS) -#t_pkcs5$(EXEEXT): t_pkcs5.$(OBJEXT) $(CRYPTO_DEPLIB) $(SUPPORT_DEPLIB) -# $(CC_LINK) -o $@ t_pkcs5.$(OBJEXT) $(K5CRYPTO_LIB) $(COM_ERR_LIB) $(SUPPORT_LIB) +#t_pkcs5$(EXEEXT): t_pkcs5.$(OBJEXT) $(KRB5_BASE_DEPLIBS) +# $(CC_LINK) -o $@ t_pkcs5.$(OBJEXT) $(KRB5_BASE_LIBS) -vectors$(EXEEXT): vectors.$(OBJEXT) $(CRYPTO_DEPLIB) $(SUPPORT_DEPLIB) - $(CC_LINK) -o $@ vectors.$(OBJEXT) $(K5CRYPTO_LIB) $(COM_ERR_LIB) $(SUPPORT_LIB) +vectors$(EXEEXT): vectors.$(OBJEXT) $(KRB5_BASE_DEPLIBS) + $(CC_LINK) -o $@ vectors.$(OBJEXT) $(KRB5_BASE_LIBS) - t_cts$(EXEEXT): t_cts.$(OBJEXT) $(CRYPTO_DEPLIB) $(SUPPORT_DEPLIB) +t_cts$(EXEEXT): t_cts.$(OBJEXT) $(KRB5_BASE_DEPLIBS) $(CC_LINK) -o $@ t_cts.$(OBJEXT) \ - $(K5CRYPTO_LIB) $(COM_ERR_LIB) $(SUPPORT_LIB) + $(KRB5_BASE_LIBS) -t_short$(EXEEXT): t_short.$(OBJEXT) $(CRYPTO_DEPLIB) $(SUPPORT_DEPLIB) +t_short$(EXEEXT): t_short.$(OBJEXT) $(KRB5_BASE_DEPLIBS) $(CC_LINK) -o $@ t_short.$(OBJEXT) \ - $(K5CRYPTO_LIB) $(COM_ERR_LIB) $(SUPPORT_LIB) + $(KRB5_BASE_LIBS) t_cksum4.o: $(srcdir)/t_cksum.c $(CC) -DMD=4 $(ALL_CFLAGS) -o t_cksum4.o -c $(srcdir)/t_cksum.c @@ -113,46 +113,46 @@ t_cksum5.o: $(srcdir)/t_cksum.c $(CC) -DMD=5 $(ALL_CFLAGS) -o t_cksum5.o -c $(srcdir)/t_cksum.c t_cksum4: t_cksum4.o $(CRYTPO_DEPLIB) - $(CC_LINK) -o t_cksum4 t_cksum4.o $(K5CRYPTO_LIB) $(COM_ERR_LIB) $(SUPPORT_LIB) $(LIBS) + $(CC_LINK) -o t_cksum4 t_cksum4.o $(KRB5_BASE_LIBS) t_cksum5: t_cksum5.o $(CRYPTO_DEPLIB) - $(CC_LINK) -o t_cksum5 t_cksum5.o $(K5CRYPTO_LIB) $(COM_ERR_LIB) $(SUPPORT_LIB) $(LIBS) + $(CC_LINK) -o t_cksum5 t_cksum5.o $(KRB5_BASE_LIBS) t_cksums: t_cksums.o $(CRYTPO_DEPLIB) - $(CC_LINK) -o t_cksums t_cksums.o -lkrb5 $(K5CRYPTO_LIB) $(COM_ERR_LIB) $(SUPPORT_LIB) $(LIBS) + $(CC_LINK) -o t_cksums t_cksums.o -lkrb5 $(KRB5_BASE_LIBS) -t_crc: t_crc.o $(CRYPTO_DEPLIB) $(SUPPORT_DEPLIB) - $(CC_LINK) -o $@ t_crc.o $(K5CRYPTO_LIB) $(SUPPORT_LIB) +t_crc: t_crc.o $(KRB5_BASE_DEPLIBS) + $(CC_LINK) -o $@ t_crc.o $(KRB5_BASE_LIBS) -aes-test: aes-test.$(OBJEXT) $(CRYPTO_DEPLIB) - $(CC_LINK) -o aes-test aes-test.$(OBJEXT) $(K5CRYPTO_LIB) $(COM_ERR_LIB) $(SUPPORT_LIB) +aes-test: aes-test.$(OBJEXT) $(KRB5_BASE_DEPLIBS) + $(CC_LINK) -o aes-test aes-test.$(OBJEXT) $(KRB5_BASE_LIBS) camellia-test: camellia-test.$(OBJEXT) $(CRYPTO_DEPLIB) - $(CC_LINK) -o camellia-test camellia-test.$(OBJEXT) $(K5CRYPTO_LIB) $(COM_ERR_LIB) $(SUPPORT_LIB) + $(CC_LINK) -o camellia-test camellia-test.$(OBJEXT) $(KRB5_BASE_LIBS) t_mddriver4.o: $(srcdir)/t_mddriver.c $(CC) -DMD=4 $(ALL_CFLAGS) -o t_mddriver4.o -c $(srcdir)/t_mddriver.c -t_mddriver4: t_mddriver4.o $(SUPPORT_DEPLIB) $(CRYPTO_DEPLIB) - $(CC_LINK) -DMD4 -o t_mddriver4 t_mddriver4.o -lk5crypto $(SUPPORT_LIB) +t_mddriver4: t_mddriver4.o $(KRB5_BASE_DEPLIBS) + $(CC_LINK) -DMD4 -o t_mddriver4 t_mddriver4.o $(KRB5_BASE_LIBS) -t_mddriver: t_mddriver.o $(SUPPORT_DEPLIB) $(CRYPTO_DEPLIB) - $(CC_LINK) -o t_mddriver t_mddriver.o -lk5crypto $(SUPPORT_LIB) +t_mddriver: t_mddriver.o $(KRB5_BASE_DEPLIBS) + $(CC_LINK) -o t_mddriver t_mddriver.o $(KRB5_BASE_LIBS) -t_kperf: t_kperf.o $(SUPPORT_DEPLIB) $(CRYPTO_DEPLIB) - $(CC_LINK) -o t_kperf t_kperf.o $(SUPPORT_LIB) $(CRYPTO_DEPLIB) +t_kperf: t_kperf.o $(KRB5_BASE_DEPLIBS) + $(CC_LINK) -o t_kperf t_kperf.o $(KRB5_BASE_LIBS) -t_str2key$(EXEEXT): t_str2key.$(OBJEXT) $(SUPPORT_DEPLIB) - $(CC_LINK) -o $@ t_str2key.$(OBJEXT) -lkrb5 -lk5crypto -lcom_err $(SUPPORT_LIB) +t_str2key$(EXEEXT): t_str2key.$(OBJEXT) $(KRB5_BASE_DEPLIBS) + $(CC_LINK) -o $@ t_str2key.$(OBJEXT) $(KRB5_BASE_LIBS) -t_derive$(EXEEXT): t_derive.$(OBJEXT) $(SUPPORT_DEPLIB) - $(CC_LINK) -o $@ t_derive.$(OBJEXT) -lkrb5 -lk5crypto -lcom_err $(SUPPORT_LIB) +t_derive$(EXEEXT): t_derive.$(OBJEXT) $(KRB5_BASE_DEPLIBS) + $(CC_LINK) -o $@ t_derive.$(OBJEXT) $(KRB5_BASE_LIBS) -t_fork$(EXEEXT): t_fork.$(OBJEXT) $(SUPPORT_DEPLIB) - $(CC_LINK) -o $@ t_fork.$(OBJEXT) -lkrb5 -lk5crypto -lcom_err $(SUPPORT_LIB) +t_fork$(EXEEXT): t_fork.$(OBJEXT) $(KRB5_BASE_DEPLIBS) + $(CC_LINK) -o $@ t_fork.$(OBJEXT) $(KRB5_BASE_LIBS) -t_cf2$(EXEEXT): t_cf2.$(OBJEXT) $(SUPPORT_DEPLIB) - $(CC_LINK) -o $@ t_cf2.$(OBJEXT) -lkrb5 -lk5crypto -lcom_err $(SUPPORT_LIB) +t_cf2$(EXEEXT): t_cf2.$(OBJEXT) $(KRB5_BASE_DEPLIBS) + $(CC_LINK) -o $@ t_cf2.$(OBJEXT) $(KRB5_BASE_LIBS) clean:: $(RM) t_nfold.o t_nfold t_encrypt t_encrypt.o \ diff --git a/src/lib/kdb/kdb5.c b/src/lib/kdb/kdb5.c index e18b99e8b..62d713936 100644 --- a/src/lib/kdb/kdb5.c +++ b/src/lib/kdb/kdb5.c @@ -265,7 +265,7 @@ kdb_setup_opt_functions(db_library lib) extern kdb_vftabl krb5_db2_kdb_function_table; #ifdef ENABLE_LDAP -extern kdb_vftabl krb5_db2_ldap_function_table; +extern kdb_vftabl krb5_ldap_kdb_function_table; #endif static krb5_error_code diff --git a/src/plugins/kdb/ldap/Makefile.in b/src/plugins/kdb/ldap/Makefile.in index 490c3ecfd..dffb60f47 100644 --- a/src/plugins/kdb/ldap/Makefile.in +++ b/src/plugins/kdb/ldap/Makefile.in @@ -7,7 +7,7 @@ PROG_RPATH=$(KRB5_LIBDIR) DEFS = MODULE_INSTALL_DIR = $(KRB5_DB_MODULE_DIR) -SUBDIRS= libkdb_ldap ldap_util +SUBDIRS= libkdb_ldap LOCALINCLUDES = -I../../../lib/kdb -I$(srcdir)/../../../lib/kdb \ -I$(srcdir)/libkdb_ldap @@ -29,8 +29,6 @@ SHLIB_EXPLIBS= -lkdb_ldap $(GSSRPC_LIBS) -lkrb5 -lcom_err -lk5crypto -lkrb5suppo SHLIB_DIRS=-L$(TOPLIBD) SHLIB_RDIRS=$(KRB5_LIBDIR) -$(TOPLIBD)/libkdb_ldap$(SHLIBEXT): all-recurse - SRCS= $(srcdir)/ldap_exp.c STOBJLISTS=OBJS.ST diff --git a/src/plugins/kdb/ldap/libkdb_ldap/Makefile.in b/src/plugins/kdb/ldap/libkdb_ldap/Makefile.in index cadc1bfe0..2126df616 100644 --- a/src/plugins/kdb/ldap/libkdb_ldap/Makefile.in +++ b/src/plugins/kdb/ldap/libkdb_ldap/Makefile.in @@ -29,7 +29,7 @@ SHLIB_EXPDEPS = \ $(TOPLIBD)/libk5crypto$(SHLIBEXT) \ $(SUPPORT_DEPLIB) \ $(TOPLIBD)/libkrb5$(SHLIBEXT) -SHLIB_EXPLIBS= $(KADMSRV_LIBS) -lkrb5 -lk5crypto $(COM_ERR_LIB) $(SUPPORT_LIB) @LDAP_LIBS@ $(LIBS) +SHLIB_EXPLIBS= $(KADMSRV_LIBS) -lkrb5 -lk5crypto $(COM_ERR_LIB) $(SUPPORT_LIB) $(LDAP_LIBS) $(LIBS) SHLIB_DIRS=-L$(TOPLIBD) SHLIB_RDIRS=$(KRB5_LIBDIR)