]> git.ipfire.org Git - thirdparty/krb5.git/commitdiff
Avoid libdl dependencies in bundled libverto
authorGreg Hudson <ghudson@mit.edu>
Sun, 8 Jul 2012 22:04:56 +0000 (18:04 -0400)
committerGreg Hudson <ghudson@mit.edu>
Tue, 4 Sep 2012 05:31:46 +0000 (01:31 -0400)
The upstream libverto depends on dynamic loading and in particular on
dladdr(), which is not universal.  To avoid this dependency, stub out
support for module loading (by replacing module.c) and instead
integrate the k5ev module directly into the bundled verto library.

This change removes the need to link, include, and invoke libverto
differently depending on whether we're using the bundled library; we
can always just link with -lverto and call verto_default().

bigredbutton: whitespace
ticket: 7351 (new)

25 files changed:
src/config/pre.in
src/configure.in
src/lib/apputils/deps
src/lib/apputils/net-server.c
src/util/Makefile.in
src/util/depfix.pl
src/util/k5ev/Makefile.in [deleted file]
src/util/k5ev/README [deleted file]
src/util/k5ev/deps [deleted file]
src/util/k5ev/libverto-k5ev.exports [deleted file]
src/util/k5ev/verto-k5ev.h [deleted file]
src/util/verto/Makefile.in
src/util/verto/README
src/util/verto/Symbols.ev [moved from src/util/k5ev/Symbols.ev with 100% similarity]
src/util/verto/deps
src/util/verto/ev.c [moved from src/util/k5ev/ev.c with 100% similarity]
src/util/verto/ev.h [moved from src/util/k5ev/ev.h with 100% similarity]
src/util/verto/ev_poll.c [moved from src/util/k5ev/ev_poll.c with 100% similarity]
src/util/verto/ev_select.c [moved from src/util/k5ev/ev_select.c with 100% similarity]
src/util/verto/ev_vars.h [moved from src/util/k5ev/ev_vars.h with 100% similarity]
src/util/verto/ev_win32.c [moved from src/util/k5ev/ev_win32.c with 100% similarity]
src/util/verto/ev_wrap.h [moved from src/util/k5ev/ev_wrap.h with 100% similarity]
src/util/verto/module.c
src/util/verto/verto-k5ev.c [moved from src/util/k5ev/verto-k5ev.c with 97% similarity]
src/util/verto/verto-libev.c [moved from src/util/k5ev/verto-libev.c with 100% similarity]

index e5a087c02c177346cd3c954c6dfb3df2e489a296..1ba26d8502a5341067f4968eff546984f926a9b3 100644 (file)
@@ -369,9 +369,6 @@ VERTO_VERSION       = @VERTO_VERSION@
 VERTO_DEPS     = $(VERTO_DEPS-@VERTO_VERSION@)
 VERTO_DEPS-sys =
 VERTO_DEPS-k5  = $(BUILDTOP)/include/verto.h
-VERTO_K5EV_DEPS        = $(VERTO_K5EV_DEPS-@VERTO_VERSION@)
-VERTO_K5EV_DEPS-sys =
-VERTO_K5EV_DEPS-k5 = $(BUILDTOP)/include/verto-k5ev.h
 
 # LIBS gets substituted in... e.g. -lnsl -lsocket
 
@@ -389,7 +386,7 @@ KDB5_LIB    = -lkdb5 $(KDB5_PLUGIN_LIBS)
 
 VERTO_DEPLIB   = $(VERTO_DEPLIB-@VERTO_VERSION@)
 VERTO_DEPLIB-sys = # empty
-VERTO_DEPLIB-k5        = $(TOPLIBD)/libverto-k5ev$(DEPLIBEXT) $(TOPLIBD)/libverto$(DEPLIBEXT)
+VERTO_DEPLIB-k5        = $(TOPLIBD)/libverto$(DEPLIBEXT)
 VERTO_CFLAGS   = @VERTO_CFLAGS@
 VERTO_LIBS     = @VERTO_LIBS@
 
index 9e9c94ff998a42feb782b758039236cb3a335318..7154f686bd72f31b97f11207fddf681846fe3c85 100644 (file)
@@ -1219,7 +1219,7 @@ AC_ARG_WITH([system-verto],
   [AC_HELP_STRING([--with-system-verto], [always use system verto library])],
   [], [with_system_verto=default])
 VERTO_CFLAGS=
-VERTO_LIBS="-lverto-k5ev -lverto"
+VERTO_LIBS="-lverto"
 VERTO_VERSION=k5
 if test "x$with_system_verto" != xno; then
   if verto_cflags=`pkg-config --cflags libverto 2>&1`; then
@@ -1227,7 +1227,7 @@ if test "x$with_system_verto" != xno; then
     VERTO_LIBS=`pkg-config --libs libverto`
     VERTO_VERSION=sys
   else
-    AC_CHECK_LIB([verto], [verto_run], [VERTO_VERSION=sys; VERTO_LIBS=-lverto],
+    AC_CHECK_LIB([verto], [verto_run], [VERTO_VERSION=sys],
       [if test "x$with_system_verto" = xyes; then
         AC_MSG_ERROR([cannot detect system libverto])
       fi])
@@ -1237,7 +1237,6 @@ if test "x$VERTO_VERSION" = xsys; then
   AC_MSG_NOTICE([Using system libverto])
 else
   AC_MSG_RESULT([Using built-in libverto])
-  AC_DEFINE([INTERNAL_VERTO],[1],[Define if using bundled libverto])
 fi
 AC_SUBST([VERTO_CFLAGS])
 AC_SUBST([VERTO_LIBS])
@@ -1295,7 +1294,7 @@ AC_CONFIG_FILES(krb5-config, [chmod +x krb5-config])
 V5_AC_OUTPUT_MAKEFILE(.
 
        util util/support util/profile util/profile/testmod util/send-pr
-       util/verto util/k5ev
+       util/verto
 
        lib lib/kdb
 
index 586e1ef767c3027a8635e393ffcd64a2bc9ca000..a41563e78f07ad781969c21f3b4a71cd4d04bdd3 100644 (file)
@@ -16,7 +16,7 @@ net-server.so net-server.po $(OUTPRE)net-server.$(OBJEXT): \
   $(BUILDTOP)/include/autoconf.h $(BUILDTOP)/include/gssapi/gssapi.h \
   $(BUILDTOP)/include/gssrpc/types.h $(BUILDTOP)/include/krb5/krb5.h \
   $(BUILDTOP)/include/osconf.h $(BUILDTOP)/include/profile.h \
-  $(COM_ERR_DEPS) $(VERTO_DEPS) $(VERTO_K5EV_DEPS) $(top_srcdir)/include/adm_proto.h \
+  $(COM_ERR_DEPS) $(VERTO_DEPS) $(top_srcdir)/include/adm_proto.h \
   $(top_srcdir)/include/fake-addrinfo.h $(top_srcdir)/include/foreachaddr.h \
   $(top_srcdir)/include/gssrpc/auth.h $(top_srcdir)/include/gssrpc/auth_gss.h \
   $(top_srcdir)/include/gssrpc/auth_unix.h $(top_srcdir)/include/gssrpc/clnt.h \
index 0fd08eceea139b1e4ffa41e499b2c6e0ac756348..1f8a8f97ae0d8deca63fdf8d895d34cb64184971 100644 (file)
 
 #include "fake-addrinfo.h"
 #include "net-server.h"
-#ifdef INTERNAL_VERTO
-#include "verto-k5ev.h"
-#endif
-
 #include <signal.h>
 
 /* XXX */
@@ -269,12 +265,7 @@ loop_init(verto_ev_type types)
     types |= VERTO_EV_TYPE_IO;
     types |= VERTO_EV_TYPE_SIGNAL;
     types |= VERTO_EV_TYPE_TIMEOUT;
-
-#ifdef INTERNAL_VERTO
-    return verto_default_k5ev();
-#else
     return verto_default(NULL, types);
-#endif
 }
 
 static void
index f45bc70825a74482b2d41575aad4294c43d4f487..f2f6b75d1e0073252fb03486c4b36c7e94a902ea 100644 (file)
@@ -15,7 +15,7 @@ MAYBE_ET_sys =
 MAYBE_ET_intlsys =
 MAYBE_SS_sys =
 MAYBE_VERTO_sys =
-MAYBE_VERTO_k5 = verto k5ev
+MAYBE_VERTO_k5 = verto
 
 all-recurse:
 
index 4fc37890bf71dbcb0876ba875d8a8682f24f52e0..f648da894830bcb23fb807d2a23455693264d4cf 100644 (file)
@@ -141,7 +141,6 @@ sub do_subs_2 {
     s;\$\(BUILDTOP\)/include/com_err.h ;\$(COM_ERR_DEPS) ;g;
     s;\$\(BUILDTOP\)/include/ss/ss.h \$\(BUILDTOP\)/include/ss/ss_err.h ;\$(SS_DEPS) ;g;
     s;\$\(BUILDTOP\)/include/db-config.h \$\(BUILDTOP\)/include/db.h ;\$(DB_DEPS) ;g;
-    s;\$\(BUILDTOP\)/include/verto-k5ev.h ;\$(VERTO_K5EV_DEPS) ;g;
     s;\$\(BUILDTOP\)/include/verto.h ;\$(VERTO_DEPS) ;g;
     if ($thisdir eq "util/gss-kernel-lib") {
        # Here com_err.h is used from the current directory.
diff --git a/src/util/k5ev/Makefile.in b/src/util/k5ev/Makefile.in
deleted file mode 100644 (file)
index b80a60d..0000000
+++ /dev/null
@@ -1,52 +0,0 @@
-mydir=util$(S)k5ev
-BUILDTOP=$(REL)..$(S)..
-RELDIR=../util/k5ev
-DEFS=
-
-SED = sed
-
-LIBBASE=verto-k5ev
-LIBMAJOR=0
-LIBMINOR=0
-
-LOCALINCLUDES=-I. -I$(srcdir)/../verto
-
-# Turn off extra warnings since we're not going to clean up libev's code.
-WARN_CFLAGS=
-
-STLIBOBJS=verto-k5ev.o
-LIBOBJS=$(OUTPRE)verto-k5ev.$(OBJEXT)
-SRCS=verto-k5ev.c
-
-STOBJLISTS=OBJS.ST
-SHLIB_EXPLIBS= $(LIBS) -lverto -lm      # libm needed for ceil() currently.
-SHLIB_DIRS=-L$(TOPLIBD)
-SHLIB_RDIRS=$(KRB5_LIBDIR)
-
-VERTO_K5EV_HDR=$(BUILDTOP)$(S)include$(S)verto-k5ev.h
-
-all-unix:: all-liblinks includes
-
-install-unix:: install-libs
-
-clean-unix:: clean-liblinks clean-libs clean-libobjs
-       $(RM) $(VERTO_K5EV_HDR)
-
-includes:: $(VERTO_K5EV_HDR)
-depend:: $(VERTO_K5EV_HDR)
-
-$(VERTO_K5EV_HDR): $(srcdir)/verto-k5ev.h
-       $(RM) $@
-       $(CP) $(srcdir)/verto-k5ev.h $@
-
-rename.h: $(srcdir)/Symbols.ev
-       $(RM) $@
-       $(SED) -e 's/.*/#define & k5&/' < $(srcdir)/Symbols.ev > $@
-
-clean::
-       $(RM) rename.h
-
-depend:: rename.h
-
-@lib_frag@
-@libobj_frag@
diff --git a/src/util/k5ev/README b/src/util/k5ev/README
deleted file mode 100644 (file)
index 7a14f13..0000000
+++ /dev/null
@@ -1,31 +0,0 @@
-This directory builds a private libverto module using an embedded
-libev with renamed symbols (so we don't leak libev symbols into the
-namespace on platforms where we can't control the export list).
-
-libev has built-in support for this kind of embedding, so we don't
-have to modify the libev sources.  Following libev's documentation,
-the following files have been copied from the ev sources:
-
-  ev.h
-  ev_vars.h
-  ev_wrap.h
-  ev.c
-  ev_select.c
-  ev_poll.c
-  ev_win32.c
-  Symbols.ev
-
-(Symbols.ev wasn't included in the 4.04 tar file due to an oversight,
-so it is taken from the appropriate tag in libev's source repository.)
-
-To rename the exported symbols, we create rename.h from Symbols.ev.
-We also use Symbols.ev to construct the library export list.
-(Renaming libev's symbols would be unnecessary if libev's embedding
-had support for making its API symbols static, but it currently does
-not.)  The source file verto-k5ev.c wraps ev.c with appropriate
-embedding defines, and then defines the libverto module functions
-using the slightly modified contents of libverto's verto-ev.c.
-
-The libev upstream project page is at:
-
-  http://software.schmorp.de/pkg/libev.html
diff --git a/src/util/k5ev/deps b/src/util/k5ev/deps
deleted file mode 100644 (file)
index 5fd8552..0000000
+++ /dev/null
@@ -1,7 +0,0 @@
-# 
-# Generated makefile dependencies follow.
-#
-verto-k5ev.so verto-k5ev.po $(OUTPRE)verto-k5ev.$(OBJEXT): \
-  $(BUILDTOP)/include/autoconf.h $(VERTO_DEPS) $(srcdir)/../verto/verto-module.h \
-  ev.c ev.h ev_poll.c ev_select.c ev_vars.h ev_wrap.h \
-  rename.h verto-k5ev.c verto-k5ev.h
diff --git a/src/util/k5ev/libverto-k5ev.exports b/src/util/k5ev/libverto-k5ev.exports
deleted file mode 100644 (file)
index 7907fbe..0000000
+++ /dev/null
@@ -1,3 +0,0 @@
-verto_default_k5ev
-verto_module_table_k5ev
-verto_new_k5ev
diff --git a/src/util/k5ev/verto-k5ev.h b/src/util/k5ev/verto-k5ev.h
deleted file mode 100644 (file)
index 0b1ad19..0000000
+++ /dev/null
@@ -1,33 +0,0 @@
-/*
- * Copyright 2011 Red Hat, Inc.
- *
- * Permission is hereby granted, free of charge, to any person
- * obtaining a copy of this software and associated documentation files
- * (the "Software"), to deal in the Software without restriction,
- * including without limitation the rights to use, copy, modify, merge,
- * publish, distribute, sublicense, and/or sell copies of the Software,
- * and to permit persons to whom the Software is furnished to do so,
- * subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be
- * included in all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
- * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
- * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
- * NONINFRINGEMENT.  IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
- * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
- * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
- * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
- * SOFTWARE.
- */
-
-#ifndef VERTO_K5EV_H_
-#define VERTO_K5EV_H_
-
-#include <verto.h>
-
-verto_ctx *verto_new_k5ev(void);
-verto_ctx *verto_default_k5ev(void);
-
-#endif /* VERTO_K5EV_H_ */
index f7206c83d46c47ff038785b0c5a0189c4b47bfa5..ff1bd1af71aa713ec2bc44102f692b75f3a47ca9 100644 (file)
@@ -6,32 +6,38 @@ LIBBASE=verto
 LIBMAJOR=0
 LIBMINOR=0
 
-LOCALINCLUDES=-I$(srcdir)
-DEFINES=-DDEFAULT_LIBRARY=\"k5ev\"
+LOCALINCLUDES=-I$(srcdir) -I.
+DEFINES=-DDEFAULT_LIBRARY=\"k5ev\" -DBUILTIN_MODULE=k5ev
 
 # Turn off extra warnings since we're not going to clean up libverto's code.
 WARN_CFLAGS=
 
-STLIBOBJS=verto.o module.o
-LIBOBJS=$(OUTPRE)verto.$(OBJEXT) $(OUTPRE)module.$(OBJEXT)
-SRCS=verto.c module.c
+STLIBOBJS=verto.o module.o verto-k5ev.o
+LIBOBJS=$(OUTPRE)verto.$(OBJEXT) \
+       $(OUTPRE)module.$(OBJEXT) \
+       $(OUTPRE)verto-k5ev.$(OBJEXT)
+SRCS=verto.c module.c verto-k5ev.c
 
 STOBJLISTS=OBJS.ST
-SHLIB_EXPLIBS= $(DL_LIB) $(LIBS)
+SHLIB_EXPLIBS= $(LIBS) -lm    # libm needed for ceil() currently.
 SHLIB_DIRS=
 SHLIB_RDIRS=$(KRB5_LIBDIR)
 
 VERTO_HDR=$(BUILDTOP)$(S)include$(S)verto.h
 
+rename.h: $(srcdir)/Symbols.ev
+       $(RM) $@
+       $(SED) -e 's/.*/#define & k5&/' < $(srcdir)/Symbols.ev > $@
+
 all-unix:: all-liblinks includes
 
 install-unix:: install-libs
 
 clean-unix:: clean-liblinks clean-libs clean-libobjs
-       $(RM) $(VERTO_HDR)
+       $(RM) $(VERTO_HDR) rename.h
 
 includes:: $(VERTO_HDR)
-depend:: $(VERTO_HDR)
+depend:: $(VERTO_HDR) rename.h
 
 $(VERTO_HDR): $(srcdir)/verto.h
        $(RM) $@
index 8e47610565c1b2a1eadda801d77c69de525e643e..6de645f6fb15d93452891d0ff94bef6cc49155a2 100644 (file)
@@ -1,6 +1,40 @@
-This directory builds a verto library with only a private back-end
-module, for use when the system has no installed verto library.
+This directory builds a verto library with only a private built-in
+module, for use when the system has no installed verto library.  The
+bundled verto cannot dynamically load modules.  From the upstream
+libverto, we take only verto.c and verto-libev.c, and we only build
+the former; the latter is stored here for comparison purposes.  We use
+a stub implementation of module.c to disable dynamic loading support.
 
-The libverto upstream project page is at:
+This private module uses an embedded libev with renamed symbols (so we
+don't leak libev symbols into the namespace on platforms where we
+can't control the export list).  libev has built-in support for this
+kind of embedding, so we don't have to modify the libev sources.
+Following libev's documentation, the following files have been copied
+from the ev sources:
+
+  ev.h
+  ev_vars.h
+  ev_wrap.h
+  ev.c
+  ev_select.c
+  ev_poll.c
+  ev_win32.c
+  Symbols.ev
+
+(Symbols.ev wasn't included in the 4.04 tar file due to an oversight,
+so it is taken from the appropriate tag in libev's source repository.)
+
+To rename the exported symbols, we create rename.h from Symbols.ev.
+We also use Symbols.ev to construct the library export list.
+(Renaming libev's symbols would be unnecessary if libev's embedding
+had support for making its API symbols static, but it currently does
+not.)  The source file verto-k5ev.c wraps ev.c with appropriate
+embedding defines, and then defines the libverto module functions
+using the slightly modified contents of libverto's verto-libev.c.  The
+resulting module table is embedded into verto.c using the
+BUILTIN_MODULE define.
+
+The libverto and libev upstream project pages are at:
 
   https://fedorahosted.org/libverto/
+  http://software.schmorp.de/pkg/libev.html
index dad2f3aa634076b30a0eca4eea94e2a7b07b7725..3424d303824ecabbb4d9eb32da6543b471e6726b 100644 (file)
@@ -4,3 +4,7 @@
 verto.so verto.po $(OUTPRE)verto.$(OBJEXT): $(VERTO_DEPS) \
   module.h verto-module.h verto.c
 module.so module.po $(OUTPRE)module.$(OBJEXT): module.c
+verto-k5ev.so verto-k5ev.po $(OUTPRE)verto-k5ev.$(OBJEXT): \
+  $(BUILDTOP)/include/autoconf.h $(VERTO_DEPS) ev.c ev.h \
+  ev_poll.c ev_select.c ev_vars.h ev_wrap.h rename.h \
+  verto-k5ev.c verto-module.h
similarity index 100%
rename from src/util/k5ev/ev.c
rename to src/util/verto/ev.c
similarity index 100%
rename from src/util/k5ev/ev.h
rename to src/util/verto/ev.h
index d5977cbbc9840559ea44076357415a6ef5996fd0..68dc7093ded9bec7fa0e81332e9ab0e887270273 100644 (file)
  * SOFTWARE.
  */
 
-#ifdef WIN32
-#include <windows.h>
-#define dlltype HMODULE
-static char *
-dllerror(void) {
-    char *amsg;
-    LPTSTR msg;
+/* Stub implementation of module loading for MIT krb5 bundled libverto. */
 
-    FormatMessage(FORMAT_MESSAGE_ALLOCATE_BUFFER
-                      | FORMAT_MESSAGE_FROM_SYSTEM
-                      | FORMAT_MESSAGE_IGNORE_INSERTS,
-                  NULL, GetLastError(),
-                  MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT),
-                  (LPTSTR) &msg, 0, NULL);
-    amsg = strdup((const char*) msg);
-    LocalFree(msg);
-    return amsg;
-}
-#elif defined(aix)
-#include "sys/ldr.h"
-
-struct Dl_info {
-  const char* dli_fname;
-};
-
-static int
-dladdr(void* s, Dl_info* i)
-{
-    static const size_t bufSize = 4096;
-    G__FastAllocString buf(bufSize);
-    char* pldi = buf;
-    int r;
-
-    r = loadquery(L_GETINFO, pldi, bufSize);
-    if (r == -1) {
-        i->dli_fname = NULL;
-        return 0;
-    }
-
-    for (ld_info* ldi = (ld_info*) buf;
-         ldi->ldinfo_next;
-         ldi += ldi->ldinfo_next) {
-        char* textBegin = (char*) ldi->ldinfo_textorg;
-        if (textBegin < s) {
-            char* textEnd = textBegin + ldi->ldinfo_textsize;
-            if (textEnd > s) {
-                i->dli_fname = ldi->ldinfo_filename;
-                return 1;
-            }
-        }
-    }
-
-    // First is main(), skip.
-    ld_info* ldi = (ld_info*) pldi;
-    while (ldi->ldinfo_next) {
-        pldi += ldi->ldinfo_next;
-        ldi = (ld_info*) pldi;
-
-    }
-
-    i->dli_fname = NULL;
-    return 0;
-}
-#else
-#define _GNU_SOURCE
-#include <stdlib.h>
 #include <string.h>
-#include <dlfcn.h>
-#define dlltype void *
-#define dllerror() strdup(dlerror())
-#endif
 
 int
 module_symbol_is_present(const char *modname, const char *symbname)
 {
-#ifdef WIN32
-    return (GetProcAddress(GetModuleHandle(modname), symbname) != NULL ||
-            GetProcAddress(GetModuleHandle(NULL), symbname) != NULL);
-#else  /* WIN32 */
-    void* mod = dlopen(NULL, RTLD_LAZY | RTLD_LOCAL);
-    if (mod) {
-        void* sym = dlsym(mod, symbname);
-        dlclose(mod);
-        return sym != NULL;
-    }
-#endif /* WIN32 */
     return 0;
 }
 
 int
 module_get_filename_for_symbol(void *addr, char **filename)
 {
-#ifdef WIN32
-    MEMORY_BASIC_INFORMATION info;
-    HMODULE mod;
-    char tmp[MAX_PATH];
-
-    if (!VirtualQuery(addr, &info, sizeof(info)))
-        return 0;
-    mod = (HMODULE) info.AllocationBase;
-
-    if (!GetModuleFileNameA(mod, tmp, MAX_PATH))
-        return 0;
-#else
-    const char *tmp;
-    Dl_info dlinfo;
-
-    if (!dladdr(addr, &dlinfo))
-        return 0;
-    tmp = dlinfo.dli_fname;
-#endif
-
-    if (filename) {
-        *filename = strdup(tmp);
-        if (!*filename)
-            return 0;
-    }
-
-    return 1;
+    return 0;
 }
 
 void
 module_close(void *dll)
 {
-    if (!dll)
-        return;
-
-#ifdef WIN32
-    FreeLibrary((dlltype) dll);
-#else  /* WIN32 */
-    dlclose((dlltype) dll);
-#endif /* WIN32 */
 }
 
 char *
@@ -161,69 +48,9 @@ module_load(const char *filename, const char *symbname,
             int (*shouldload)(void *symb, void *misc, char **err), void *misc,
             void **dll, void **symb)
 {
-    dlltype intdll = NULL;
-    void *  intsym = NULL;
-    char *  interr = NULL;
-
     if (dll)
         *dll = NULL;
     if (symb)
         *symb = NULL;
-
-    /* Open the module library */
-#ifdef WIN32
-    /* NOTE: DONT_RESOLVE_DLL_REFERENCES is evil. Don't use this in your own
-     * code. However, our design pattern avoids all the issues surrounding a
-     * more general use of this evil flag. */
-    intdll = LoadLibraryEx(filename, NULL, DONT_RESOLVE_DLL_REFERENCES);
-#else  /* WIN32 */
-    intdll = dlopen(filename, RTLD_LAZY | RTLD_LOCAL);
-#endif /* WIN32 */
-    if (!intdll)
-        return dllerror();
-
-    /* Get the module symbol */
-#ifdef WIN32
-    intsym = (void *) GetProcAddress(intdll, symbname);
-#else /* WIN32 */
-    intsym = dlsym(intdll, symbname);
-#endif /* WIN32 */
-    if (!intsym) {
-        module_close(intdll);
-        return dllerror();
-    }
-
-    /* Figure out whether or not to load this module */
-    if (!shouldload(intsym, misc, &interr)) {
-        module_close(intdll);
-        return interr;
-    }
-
-    /* Re-open the module */
-    module_close(intdll);
-#ifdef WIN32
-    intdll = LoadLibrary(filename);
-#else  /* WIN32 */
-    intdll = dlopen(filename, RTLD_NOW | RTLD_LOCAL);
-#endif /* WIN32 */
-    if (!intdll) {
-        return dllerror();
-    }
-
-    /* Get the symbol again */
-#ifdef WIN32
-    intsym = (void *) GetProcAddress(intdll, symbname);
-#else /* WIN32 */
-    intsym = dlsym(intdll, symbname);
-#endif /* WIN32 */
-    if (!intsym) {
-        module_close(intdll);
-        return dllerror();
-    }
-
-    if (dll)
-        *dll = intdll;
-    if (symb)
-        *symb = intsym;
-    return NULL;
+    return strdup("module loading disabled");
 }
similarity index 97%
rename from src/util/k5ev/verto-k5ev.c
rename to src/util/verto/verto-k5ev.c
index 35c94d66ed254db1ecee7e73464121f231994190..f75e8aad6c938d56cf8953c5d1a7941a144f9821 100644 (file)
@@ -32,7 +32,7 @@
 #include <string.h>
 #include <errno.h>
 
-#include "verto-k5ev.h"
+#include <verto.h>
 #include <verto-module.h>
 #include "rename.h"
 #include "autoconf.h"
@@ -201,15 +201,12 @@ k5ev_ctx_del(verto_mod_ctx *ctx, const verto_ev *ev, verto_mod_ev *evpriv)
     free(evpriv);
 }
 
+verto_ctx *verto_new_k5ev(void);
+verto_ctx *verto_default_k5ev(void);
+
 VERTO_MODULE(k5ev, NULL,
              VERTO_EV_TYPE_IO |
              VERTO_EV_TYPE_TIMEOUT |
              VERTO_EV_TYPE_IDLE |
              VERTO_EV_TYPE_SIGNAL |
              VERTO_EV_TYPE_CHILD);
-
-verto_ctx *
-verto_convert_k5ev(struct ev_loop* loop)
-{
-    return verto_convert(k5ev, 0, loop);
-}