svn rev #22406: trunk/src/ config/ include/ lib/kdb/ plugins/authdata/greet/ ...

ghudson@MIT.EDU ghudson at MIT.EDU
Mon Jun 8 06:01:58 EDT 2009


http://src.mit.edu/fisheye/changelog/krb5/?cs=22406
Commit By: ghudson
Log Message:
ticket: 6510
subject: Restore limited support for static linking

Add enough static linking support to run the test suite without shared
libraries, to facilitate gcov and other kinds of instrumentation.  The
necessary changes include:

* Undo some of the changes which removed static linking support,
  and cannibalize the defunct krb5_force_static conditional block
  in aclocal.m4.
* Add --enable-static-only configure option.
* For plugins, use a different symbol name for static and dynamic
  builds, via a macro in k5plugin.h.
* Add build machinery for building static libraries for plugins
  (somewhat grotty due to the difference in names).
* Move plugin subdirs earlier in SUBDIRS in src/Makefile.in.
* Make the in-tree KDB5 plugins dependencies of libkdb5 in a static
  build (aclocal.m4 has to know what they are).
* In kdb5.c, cannibalize the broken _KDB5_STATIC_LINK support to
  allow "loading" of statically linked plugin libraries.

Preauth, authdata, locate, and GSSAPI plugins are not handled by this
change, as they are not currently necessary to the test suite.
Supporting GSSAPI plugins may be a bit tricky but the others should be
straightforward if they become needed.

$(STLIBEXT) changes from .a-nobuild to .a in a normal shared build as
a result of these changes (except on AIX where aclocal.m4 changes it).
This does not seem to be important as we avoid selecting the static
library for building via other means.



Changed Files:
U   trunk/src/Makefile.in
U   trunk/src/aclocal.m4
U   trunk/src/config/libnover.in
U   trunk/src/config/libpriv.in
U   trunk/src/config/pre.in
U   trunk/src/include/k5-plugin.h
U   trunk/src/lib/kdb/kdb5.c
U   trunk/src/plugins/authdata/greet/Makefile.in
U   trunk/src/plugins/kdb/db2/Makefile.in
U   trunk/src/plugins/kdb/db2/db2_exp.c
U   trunk/src/plugins/kdb/ldap/Makefile.in
U   trunk/src/plugins/kdb/ldap/ldap_exp.c
U   trunk/src/plugins/locate/python/Makefile.in
U   trunk/src/plugins/preauth/encrypted_challenge/Makefile.in
U   trunk/src/plugins/preauth/pkinit/Makefile.in
U   trunk/src/plugins/preauth/pkinit/pkinit_clnt.c
U   trunk/src/plugins/preauth/pkinit/pkinit_srv.c
Modified: trunk/src/Makefile.in
===================================================================
--- trunk/src/Makefile.in	2009-06-08 09:43:45 UTC (rev 22405)
+++ trunk/src/Makefile.in	2009-06-08 10:01:57 UTC (rev 22406)
@@ -9,11 +9,12 @@
 #	plugins/preauth/wpse
 #	plugins/preauth/cksum_body
 #	plugins/authdata/greet
-SUBDIRS=util include lib kdc kadmin @ldap_plugin_dir@ slave clients \
+SUBDIRS=util include lib \
+	@ldap_plugin_dir@ \
 	plugins/kdb/db2 \
 	plugins/preauth/pkinit \
 	plugins/preauth/encrypted_challenge \
-	appl tests \
+	kdc kadmin slave clients appl tests \
 	config-files gen-manpages
 BUILDTOP=$(REL)$(C)
 LOCALINCLUDES = -I$(srcdir) 

Modified: trunk/src/aclocal.m4
===================================================================
--- trunk/src/aclocal.m4	2009-06-08 09:43:45 UTC (rev 22405)
+++ trunk/src/aclocal.m4	2009-06-08 10:01:57 UTC (rev 22406)
@@ -1141,6 +1141,11 @@
 fi
 AC_SUBST(LIBLIST)
 AC_SUBST(LIBLINKS)
+AC_SUBST(PLUGIN)
+AC_SUBST(PLUGINLINK)
+AC_SUBST(PLUGININST)
+AC_SUBST(KDB5_PLUGIN_DEPLIBS)
+AC_SUBST(KDB5_PLUGIN_LIBS)
 AC_SUBST(MAKE_SHLIB_COMMAND)
 AC_SUBST(SHLIB_RPATH_FLAGS)
 AC_SUBST(SHLIB_EXPFLAGS)
@@ -1213,6 +1218,11 @@
 [if test "$enableval" != yes; then
   AC_MSG_ERROR([Sorry, this release builds only shared libraries, cannot disable them.])
 fi])
+AC_ARG_ENABLE([static-only],
+AC_HELP_STRING([--enable-static-only],[use static libraries and plugins]),
+[static_only=$enableval],
+[static_only=no])
+
 AC_ARG_ENABLE([rpath],
 AC_HELP_STRING([--disable-rpath],[suppress run path flags in link lines]),
 [enable_rpath=$enableval],
@@ -1231,16 +1241,24 @@
 
 DEPLIBEXT=$SHLIBEXT
 
-if test "$krb5_force_static" = "yes"; then
+if test "x$static_only" = xyes; then
 	LIBLIST='lib$(LIBBASE)$(STLIBEXT)'
 	LIBLINKS='$(TOPLIBD)/lib$(LIBBASE)$(STLIBEXT)'
+	PLUGIN='libkrb5_$(LIBBASE)$(STLIBEXT)'
+	PLUGINLINK='$(TOPLIBD)/libkrb5_$(LIBBASE)$(STLIBEXT)'
+	PLUGININST=install-static
 	OBJLISTS=OBJS.ST
-	# This used to be install-static, but now we only follow this
-	# path for internal libraries we don't want installed, not for
-	# configure-time requests for installed static libraries.
-	LIBINSTLIST=
-#	CFLAGS="$CFLAGS -D_KDB5_STATIC_LINK"
+	LIBINSTLIST=install-static
+	DEPLIBEXT=$STLIBEXT
+	AC_DEFINE([STATIC_PLUGINS], 1, [Define for static plugin linkage])
 
+	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'
+	fi
+
 	AC_MSG_RESULT([Forcing static libraries.])
 	# avoid duplicate rules generation for AIX and such
 	SHLIBEXT=.so-nobuild
@@ -1255,23 +1273,25 @@
 	fi
 	case "$SHLIBSEXT" in
 	.so.s-nobuild)
-		SHLIB_HAVE_MINOR_VERS=no
 		LIBLIST='lib$(LIBBASE)$(SHLIBEXT)'
 		LIBLINKS='$(TOPLIBD)/lib$(LIBBASE)$(SHLIBEXT) $(TOPLIBD)/lib$(LIBBASE)$(SHLIBVEXT)'
 		LIBINSTLIST="install-shared"
 		;;
 	*)
-		SHLIB_HAVE_MINOR_VERS=yes
 		LIBLIST='lib$(LIBBASE)$(SHLIBEXT) lib$(LIBBASE)$(SHLIBSEXT)'
 		LIBLINKS='$(TOPLIBD)/lib$(LIBBASE)$(SHLIBEXT) $(TOPLIBD)/lib$(LIBBASE)$(SHLIBVEXT) $(TOPLIBD)/lib$(LIBBASE)$(SHLIBSEXT)'
 		LIBINSTLIST="install-shlib-soname"
 		;;
 	esac
 	OBJLISTS="OBJS.SH"
+	PLUGIN='$(LIBBASE)$(DYNOBJEXT)'
+	PLUGINLINK=
+	PLUGININST=install-plugin
+	KDB5_PLUGIN_DEPLIBS=
+	KDB5_PLUGIN_LIBS=
 fi
 CC_LINK="$CC_LINK_SHARED"
 CXX_LINK="$CXX_LINK_SHARED"
-AC_SUBST(SHLIB_HAVE_MINOR_VERS)
 
 if test -z "$LIBLIST"; then
 	AC_MSG_ERROR([must enable one of shared or static libraries])

Modified: trunk/src/config/libnover.in
===================================================================
--- trunk/src/config/libnover.in	2009-06-08 09:43:45 UTC (rev 22405)
+++ trunk/src/config/libnover.in	2009-06-08 10:01:57 UTC (rev 22406)
@@ -27,16 +27,21 @@
 
 # STOBJLISTS=dir1/OBJS.ST dir2/OBJS.ST etc...
 SHOBJLISTS=$(STOBJLISTS:.ST=.SH)
+PFOBJLISTS=$(STOBJLISTS:.ST=.PF)
 
 dummy-target-1 $(SUBDIROBJLISTS) $(SUBDIROBJLISTS:.ST=.SH) $(SUBDIROBJLISTS:.ST=.PF): all-recurse
 
 # Gets invoked as $(PARSE_OBJLISTS) list-of-OBJS.*-files
 PARSE_OBJLISTS= set -x && $(PERL) -p -e 'BEGIN { $$SIG{__WARN__} = sub {die @_} }; $$e=$$ARGV; $$e =~ s/OBJS\...$$//; s/^/ /; s/ $$//; s/ / $$e/g;'
 
-SHLIBVEXT=$(SHLIBEXT)
-LIBLIST=$(LIBBASE)$(DYNOBJEXT)
 LIBINSTLIST=install-shared
 
+libkrb5_$(LIBBASE)$(STLIBEXT): $(STOBJLISTS)
+	$(RM) $@
+	@echo "building static $(LIBBASE) library"
+	set -x; objlist=`$(PARSE_OBJLISTS) $(STOBJLISTS)` && $(AR) cq $@ $$objlist
+	$(RANLIB) $@
+
 $(LIBBASE)$(DYNOBJEXT): $(SHOBJLISTS) $(DYNOBJ_EXPDEPS) $(SHLIB_EXPORT_FILE_DEP)
 	$(RM) $@
 	@echo "building dynamic $(LIBBASE) object"
@@ -80,18 +85,29 @@
 	$(RM) darwin.exports
 	sed "s/^/_/" < $(SHLIB_EXPORT_FILE) > darwin.exports
 
-$(TOPLIBD)/$(LIBBASE)$(SHLIBEXT): $(LIBBASE)$(SHLIBEXT)
+libkrb5_$(LIBBASE)$(PFLIBEXT): $(PFOBJLISTS)
 	$(RM) $@
-	(cd $(TOPLIBD) && $(LN_S) $(RELDIR)/$(LIBBASE)$(SHLIBEXT) .)
+	@echo "building profiled $(LIBBASE) library"
+	set -x; objlist=`$(PARSE_OBJLISTS) $(PFOBJLISTS)` && $(AR) cq $@ $$objlist
+	$(RANLIB) $@
 
-all-libs: $(LIBBASE)$(DYNOBJEXT) # $(LIBLIST)
+$(TOPLIBD)/libkrb5_$(LIBBASE)$(STLIBEXT):
+	$(RM) $@
+	(cd $(TOPLIBD) && $(LN_S) $(RELDIR)/libkrb5_$(LIBBASE)$(STLIBEXT) .)
 
+all-liblinks: all-libs $(PLUGINLINK)
+all-libs: $(PLUGIN)
+
 clean-libs:
 	$(RM) $(LIBBASE)$(DYNOBJEXT)
 	$(RM) binutils.versions osf1.exports darwin.exports hpux10.exports
 
-install-libs: $(LIBINSTLIST)
-install-shared:
+install-libs: $(PLUGININST)
+install-static:
+	$(RM) $(DESTDIR)$(KRB5_LIBDIR)/libkrb5_$(LIBBASE)$(STLIBEXT)
+	$(INSTALL_DATA) libkrb5_$(LIBBASE)$(STLIBEXT) $(DESTDIR)$(KRB5_LIBDIR)
+	$(RANLIB) $(DESTDIR)$(KRB5_LIBDIR)/libkrb5_$(LIBBASE)$(STLIBEXT)
+install-plugin:
 	$(RM) $(DESTDIR)$(MODULE_INSTALL_DIR)/$(LIBBASE)$(DYNOBJEXT)
 	$(INSTALL_SHLIB) $(LIBBASE)$(DYNOBJEXT) $(DESTDIR)$(MODULE_INSTALL_DIR)
 

Modified: trunk/src/config/libpriv.in
===================================================================
--- trunk/src/config/libpriv.in	2009-06-08 09:43:45 UTC (rev 22405)
+++ trunk/src/config/libpriv.in	2009-06-08 10:01:57 UTC (rev 22406)
@@ -10,4 +10,3 @@
 SHLIBEXT=.so-nobuild
 SHLIBVEXT=.so.v-nobuild
 SHLIBSEXT=.so.s-nobuild
-STLIBEXT=$(STLIBEXT_if_static)

Modified: trunk/src/config/pre.in
===================================================================
--- trunk/src/config/pre.in	2009-06-08 09:43:45 UTC (rev 22405)
+++ trunk/src/config/pre.in	2009-06-08 10:01:57 UTC (rev 22406)
@@ -315,6 +315,9 @@
 # depending on whether we're building with shared libraries.
 DEPLIBEXT=@DEPLIBEXT@
 
+KDB5_PLUGIN_DEPLIBS = @KDB5_PLUGIN_DEPLIBS@
+KDB5_PLUGIN_LIBS = @KDB5_PLUGIN_LIBS@
+
 KADMCLNT_DEPLIB	= $(TOPLIBD)/libkadm5clnt$(DEPLIBEXT)
 KADMSRV_DEPLIB	= $(TOPLIBD)/libkadm5srv$(DEPLIBEXT)
 KDB5_DEPLIB	= $(TOPLIBD)/libkdb5$(DEPLIBEXT)
@@ -337,7 +340,7 @@
 APPUTILS_DEPLIB	= $(TOPLIBD)/libapputils.a
 
 KRB5_BASE_DEPLIBS	= $(KRB5_DEPLIB) $(CRYPTO_DEPLIB) $(COM_ERR_DEPLIB) $(SUPPORT_DEPLIB)
-KDB5_DEPLIBS		= $(KDB5_DEPLIB)
+KDB5_DEPLIBS		= $(KDB5_DEPLIB) $(KDB5_PLUGIN_DEPLIBS)
 GSS_DEPLIBS		= $(GSS_DEPLIB)
 GSSRPC_DEPLIBS		= $(GSSRPC_DEPLIB) $(GSS_DEPLIBS)
 KADM_COMM_DEPLIBS	= $(GSSRPC_DEPLIBS) $(KDB5_DEPLIBS) $(GSSRPC_DEPLIBS)
@@ -365,7 +368,7 @@
 SS_LIB		= $(SS_LIB- at SS_VERSION@)
 SS_LIB-sys	= @SS_LIB@
 SS_LIB-k5	= $(TOPLIBD)/libss.a
-KDB5_LIB	= -lkdb5
+KDB5_LIB	= -lkdb5 $(KDB5_PLUGIN_LIBS)
 
 DL_LIB		= @DL_LIB@
 
@@ -471,26 +474,28 @@
 # Set to "lib$(LIBBASE)$(STEXT) lib$(LIBBASE)$(SHEXT) lib$(LIBBASE)$(PFEXT)" or
 # some subset thereof by configure; determines which types of libs get
 # built.
-LIBLIST=$(LIBLIST_ at SHLIB_HAVE_MINOR_VERS@)
-LIBLIST_yes=lib$(LIBBASE)$(SHLIBEXT) lib$(LIBBASE)$(SHLIBSEXT)
-LIBLIST_no=lib$(LIBBASE)$(SHLIBEXT)
+LIBLIST=@LIBLIST@
 
 # Set by configure; list of library symlinks to make to $(TOPLIBD)
-LIBLINKS=$(LIBLINKS_ at SHLIB_HAVE_MINOR_VERS@)
-LIBLINKS_yes=$(TOPLIBD)/lib$(LIBBASE)$(SHLIBEXT) $(TOPLIBD)/lib$(LIBBASE)$(SHLIBVEXT) $(TOPLIBD)/lib$(LIBBASE)$(SHLIBSEXT)
-LIBLINKS_no=$(TOPLIBD)/lib$(LIBBASE)$(SHLIBEXT) $(TOPLIBD)/lib$(LIBBASE)$(SHLIBVEXT)
+LIBLINKS=@LIBLINKS@
 
-# Set by configure; list of install targets
-LIBINSTLIST=$(LIBINSTLIST_ at SHLIB_HAVE_MINOR_VERS@)
-LIBINSTLIST_yes=install-shlib-soname
-LIBINSTLIST_no=install-shared
+# Set by configure; name of plugin module to build (libfoo.a or foo.so)
+PLUGIN=@PLUGIN@
 
+# Set by configure; symlink for plugin module for static plugin linking
+PLUGINLINK=@PLUGINLINK@
+
+# Set by configure; list of install targets for libraries
+LIBINSTLIST=@LIBINSTLIST@
+
+# Set by configure; install target
+PLUGININST=@PLUGININST@
+
 # Some of these should really move to pre.in, since programs will need
 # it too. (e.g. stuff that has dependencies on the libraries)
 
 # usually .a
-STLIBEXT_if_static=@STLIBEXT@
-STLIBEXT=.a-nobuild
+STLIBEXT=@STLIBEXT@
 
 # usually .so.$(LIBMAJOR).$(LIBMINOR)
 SHLIBVEXT=@SHLIBVEXT@
@@ -536,7 +541,7 @@
 
 # Set to "OBJS.ST OBJS.SH OBJS.PF" or some subset thereof by
 # configure; determines which types of object files get built.
-OBJLISTS=OBJS.SH
+OBJLISTS=@OBJLISTS@
 
 # Note that $(LIBSRCS) *cannot* contain any variable references, or
 # the suffix substitution will break on some platforms!

Modified: trunk/src/include/k5-plugin.h
===================================================================
--- trunk/src/include/k5-plugin.h	2009-06-08 09:43:45 UTC (rev 22405)
+++ trunk/src/include/k5-plugin.h	2009-06-08 10:01:57 UTC (rev 22406)
@@ -65,6 +65,23 @@
 
 #include "k5-err.h"
 
+/*
+ * Plugins normally export fixed symbol names, but when statically
+ * linking plugins, we need a different symbol name for each plugin.
+ * The first argument to PLUGIN_SYMBOL_NAME acts as the
+ * differentiator, and is only used for static plugin linking.
+ *
+ * Although this macro (and thus this header file) are used in plugins
+ * whose code lies inside the krb5 tree, plugins maintained separately
+ * from the krb5 tree do not need it; they can just use the fixed
+ * symbol name unconditionally.
+ */
+#ifdef STATIC_PLUGINS
+#define PLUGIN_SYMBOL_NAME(prefix, symbol) prefix ## _ ## symbol
+#else
+#define PLUGIN_SYMBOL_NAME(prefix, symbol) symbol
+#endif
+
 struct plugin_file_handle;	/* opaque */
 
 struct plugin_dir_handle {

Modified: trunk/src/lib/kdb/kdb5.c
===================================================================
--- trunk/src/lib/kdb/kdb5.c	2009-06-08 09:43:45 UTC (rev 22405)
+++ trunk/src/lib/kdb/kdb5.c	2009-06-08 10:01:57 UTC (rev 22406)
@@ -60,14 +60,6 @@
 
 static k5_mutex_t db_lock = K5_MUTEX_PARTIAL_INITIALIZER;
 
-#ifdef _KDB5_STATIC_LINK
-#undef _KDB5_DYNAMIC_LINK
-#else
-#undef _KDB5_DYNAMIC_LINK
-/* to avoid redefinition problem */
-#define _KDB5_DYNAMIC_LINK
-#endif
-
 static db_library lib_list;
 
 /*
@@ -323,78 +315,54 @@
     }
 }
 
-static int kdb_db2_pol_err_loaded = 0;
-#ifdef _KDB5_STATIC_LINK
-#define DEF_SYMBOL(a) extern kdb_vftabl krb5_db_vftabl_ ## a
-#define GET_SYMBOL(a) (krb5_db_vftabl_ ## a)
+#ifdef STATIC_PLUGINS
+
+extern kdb_vftabl krb5_db2_kdb_function_table;
+#ifdef ENABLE_LDAP
+extern kdb_vftabl krb5_db2_ldap_function_table;
+#endif
+
 static krb5_error_code
-kdb_load_library(krb5_context kcontext, char *lib_name, db_library * lib)
+kdb_load_library(krb5_context kcontext, char *lib_name, db_library *libptr)
 {
     krb5_error_code status;
-    void   *vftabl_addr = NULL;
-    char    buf[KRB5_MAX_ERR_STR];
+    db_library lib;
+    kdb_vftabl *vftabl_addr = NULL;
 
-    if (!strcmp("kdb_db2", lib_name) && (kdb_db2_pol_err_loaded == 0)) {
-	initialize_adb_error_table();
-	kdb_db2_pol_err_loaded = 1;
+    if (strcmp(lib_name, "db2") == 0)
+	vftabl_addr = &krb5_db2_kdb_function_table;
+#ifdef ENABLE_LDAP
+    if (strcmp(lib_name, "ldap") == 0)
+	vftabl_addr = &krb5_ldap_kdb_function_table;
+#endif
+    if (!vftabl_addr) {
+	krb5_set_error_message(kcontext, KRB5_KDB_DBTYPE_NOTFOUND,
+			       "Unable to find requested database type: %s",
+			       lib_name);
+	return KRB5_KDB_DBTYPE_NOSUP;
     }
 
-    *lib = calloc((size_t) 1, sizeof(**lib));
-    if (*lib == NULL) {
-	status = ENOMEM;
-	goto clean_n_exit;
-    }
+    lib = calloc(1, sizeof(*lib));
+    if (lib == NULL)
+	return ENOMEM;
 
     status = kdb_init_lib_lock(*lib);
-    if (status) {
-	goto clean_n_exit;
-    }
+    if (status)
+	goto cleanup;
 
-    strlcpy((*lib)->name, lib_name, sizeof((*lib)->name));
+    strlcpy(lib->name, lib_name, sizeof(lib->name));
+    memcpy(&lib->vftabl, vftabl_addr, sizeof(kdb_vftabl));
+    kdb_setup_opt_functions(lib);
 
-#if !defined(KDB5_USE_LIB_KDB_DB2) && !defined(KDB5_USE_LIB_TEST)
-#error No database module defined
-#endif
+    status = lib->vftabl.init_library();
+    if (status)
+	goto cleanup;
 
-#ifdef KDB5_USE_LIB_KDB_DB2
-    if (strcmp(lib_name, "kdb_db2") == 0) {
-	DEF_SYMBOL(kdb_db2);
-	vftabl_addr = (void *) &GET_SYMBOL(kdb_db2);
-    } else
-#endif
-#ifdef KDB5_USE_LIB_TEST
-    if (strcmp(lib_name, "test") == 0) {
-	DEF_SYMBOL(test);
-	vftabl_addr = (void *) &GET_SYMBOL(test);
-    } else
-#endif
-    {
-	snprintf(buf, sizeof(buf),
-		 "Program not built to support %s database type\n",
-		 lib_name);
-	status = KRB5_KDB_DBTYPE_NOSUP;
-	krb5_db_set_err(kcontext, krb5_err_have_str, status, buf);
-	goto clean_n_exit;
-    }
+    *libptr = lib;
+    return 0;
 
-    memcpy(&(*lib)->vftabl, vftabl_addr, sizeof(kdb_vftabl));
-
-    kdb_setup_opt_functions(*lib);
-
-    if ((status = (*lib)->vftabl.init_library())) {
-	/* ERROR. library not initialized cleanly */
-	snprintf(buf, sizeof(buf),
-		 "%s library initialization failed, error code %ld\n",
-		 lib_name, status);
-	status = KRB5_KDB_DBTYPE_INIT;
-	krb5_db_set_err(kcontext, krb5_err_have_str, status, buf);
-	goto clean_n_exit;
-    }
-
-  clean_n_exit:
-    if (status) {
-	free(*lib), *lib = NULL;
-    }
+cleanup:
+    free(lib);
     return status;
 }
 
@@ -424,11 +392,6 @@
     filebases[0] = lib_name;
     filebases[1] = NULL;
 
-    if (!strcmp(DB2_NAME, lib_name) && (kdb_db2_pol_err_loaded == 0)) {
-	initialize_adb_error_table();
-	kdb_db2_pol_err_loaded = 1;
-    }
-
     *lib = calloc((size_t) 1, sizeof(**lib));
     if (*lib == NULL) {
 	status = ENOMEM;
@@ -527,7 +490,13 @@
     krb5_error_code status = 0;
     int     locked = 0;
     db_library curr_elt, prev_elt = NULL;
+    static int kdb_db2_pol_err_loaded = 0;
 
+    if (!strcmp(DB2_NAME, lib_name) && (kdb_db2_pol_err_loaded == 0)) {
+	initialize_adb_error_table();
+	kdb_db2_pol_err_loaded = 1;
+    }
+
     if ((status = kdb_lock_list()) != 0) {
 	goto clean_n_exit;
     }

Modified: trunk/src/plugins/authdata/greet/Makefile.in
===================================================================
--- trunk/src/plugins/authdata/greet/Makefile.in	2009-06-08 09:43:45 UTC (rev 22405)
+++ trunk/src/plugins/authdata/greet/Makefile.in	2009-06-08 10:01:57 UTC (rev 22406)
@@ -27,7 +27,7 @@
 
 SRCS=	greet_auth.c
 
-all-unix:: $(LIBBASE)$(SO_EXT)
+all-unix:: all-liblinks
 install-unix:: install-libs
 clean-unix:: clean-libs clean-libobjs
 

Modified: trunk/src/plugins/kdb/db2/Makefile.in
===================================================================
--- trunk/src/plugins/kdb/db2/Makefile.in	2009-06-08 09:43:45 UTC (rev 22405)
+++ trunk/src/plugins/kdb/db2/Makefile.in	2009-06-08 10:01:57 UTC (rev 22406)
@@ -68,7 +68,7 @@
 	pol_xdr.o \
 	db2_exp.o
 
-all-unix:: $(LIBBASE)$(SO_EXT)
+all-unix:: all-liblinks
 install-unix:: install-libs
 clean-unix:: clean-libs clean-libobjs
 

Modified: trunk/src/plugins/kdb/db2/db2_exp.c
===================================================================
--- trunk/src/plugins/kdb/db2/db2_exp.c	2009-06-08 09:43:45 UTC (rev 22405)
+++ trunk/src/plugins/kdb/db2/db2_exp.c	2009-06-08 10:01:57 UTC (rev 22406)
@@ -220,7 +220,7 @@
  *      Exposed API
  */
 
-kdb_vftabl kdb_function_table = {
+kdb_vftabl PLUGIN_SYMBOL_NAME(krb5_db2, kdb_function_table) = {
   1,                                      /* major version number 1 */
   0,                                      /* minor version number 0 */
   /* init_library */			       hack_init,

Modified: trunk/src/plugins/kdb/ldap/Makefile.in
===================================================================
--- trunk/src/plugins/kdb/ldap/Makefile.in	2009-06-08 09:43:45 UTC (rev 22405)
+++ trunk/src/plugins/kdb/ldap/Makefile.in	2009-06-08 10:01:57 UTC (rev 22406)
@@ -38,7 +38,7 @@
 STOBJLISTS=OBJS.ST
 STLIBOBJS= ldap_exp.o
 
-all-unix:: $(LIBBASE)$(SO_EXT)
+all-unix:: all-liblinks
 install-unix:: install-libs
 clean-unix:: clean-libs clean-libobjs
 

Modified: trunk/src/plugins/kdb/ldap/ldap_exp.c
===================================================================
--- trunk/src/plugins/kdb/ldap/ldap_exp.c	2009-06-08 09:43:45 UTC (rev 22405)
+++ trunk/src/plugins/kdb/ldap/ldap_exp.c	2009-06-08 10:01:57 UTC (rev 22406)
@@ -45,7 +45,7 @@
  *      Exposed API
  */
 
-kdb_vftabl kdb_function_table = {
+kdb_vftabl PLUGIN_SYMBOL_NAME(krb5_ldap, kdb_function_table) = {
   1,                                      /* major version number 1 */
   0,                                      /* minor version number 0 */
   /* init_library */			       krb5_ldap_lib_init,

Modified: trunk/src/plugins/locate/python/Makefile.in
===================================================================
--- trunk/src/plugins/locate/python/Makefile.in	2009-06-08 09:43:45 UTC (rev 22405)
+++ trunk/src/plugins/locate/python/Makefile.in	2009-06-08 10:01:57 UTC (rev 22406)
@@ -21,7 +21,7 @@
 STOBJLISTS=OBJS.ST
 STLIBOBJS= py-locate.o
 
-all-unix:: $(LIBBASE)$(SO_EXT)
+all-unix:: all-liblinks
 install-unix:: install-libs
 clean-unix:: clean-libs clean-libobjs
 

Modified: trunk/src/plugins/preauth/encrypted_challenge/Makefile.in
===================================================================
--- trunk/src/plugins/preauth/encrypted_challenge/Makefile.in	2009-06-08 09:43:45 UTC (rev 22405)
+++ trunk/src/plugins/preauth/encrypted_challenge/Makefile.in	2009-06-08 10:01:57 UTC (rev 22406)
@@ -29,7 +29,7 @@
 
 SRCS= $(srcdir)/encrypted_challenge_main.c
 
-all-unix:: $(LIBBASE)$(SO_EXT)
+all-unix:: all-liblinks
 install-unix:: install-libs
 clean-unix:: clean-libs clean-libobjs
 

Modified: trunk/src/plugins/preauth/pkinit/Makefile.in
===================================================================
--- trunk/src/plugins/preauth/pkinit/Makefile.in	2009-06-08 09:43:45 UTC (rev 22405)
+++ trunk/src/plugins/preauth/pkinit/Makefile.in	2009-06-08 10:01:57 UTC (rev 22406)
@@ -46,7 +46,7 @@
 	$(srcdir)/pkinit_matching.c \
 	$(srcdir)/pkinit_crypto_openssl.c
 
-all-unix:: $(LIBBASE)$(SO_EXT)
+all-unix:: all-liblinks
 install-unix:: install-libs
 clean-unix:: clean-libs clean-libobjs
 

Modified: trunk/src/plugins/preauth/pkinit/pkinit_clnt.c
===================================================================
--- trunk/src/plugins/preauth/pkinit/pkinit_clnt.c	2009-06-08 09:43:45 UTC (rev 22405)
+++ trunk/src/plugins/preauth/pkinit/pkinit_clnt.c	2009-06-08 10:01:57 UTC (rev 22406)
@@ -1489,7 +1489,11 @@
     return 0;
 }
 
-struct krb5plugin_preauth_client_ftable_v1 preauthentication_client_1 = {
+/* Only necessary for static plugin linking support. */
+#include "k5-plugin.h"
+
+struct krb5plugin_preauth_client_ftable_v1
+PLUGIN_SYMBOL_NAME(krb5_preauth, preauthentication_client_1) = {
     "pkinit",			/* name */
     supported_client_pa_types,	/* pa_type_list */
     NULL,			/* enctype_list */

Modified: trunk/src/plugins/preauth/pkinit/pkinit_srv.c
===================================================================
--- trunk/src/plugins/preauth/pkinit/pkinit_srv.c	2009-06-08 09:43:45 UTC (rev 22405)
+++ trunk/src/plugins/preauth/pkinit/pkinit_srv.c	2009-06-08 10:01:57 UTC (rev 22406)
@@ -1409,7 +1409,11 @@
     free(reqctx);
 }
 
-struct krb5plugin_preauth_server_ftable_v1 preauthentication_server_1 = {
+/* Only necessary for static plugin linking support. */
+#include "k5-plugin.h"
+
+struct krb5plugin_preauth_server_ftable_v1
+PLUGIN_SYMBOL_NAME(krb5_pkinit, preauthentication_server_1) = {
     "pkinit",			/* name */
     supported_server_pa_types,	/* pa_type_list */
     pkinit_server_plugin_init,	/* (*init_proc) */




More information about the cvs-krb5 mailing list