X-Git-Url: https://git.netwichtig.de/gitweb/?a=blobdiff_plain;f=src%2Fsrc%2Fdrtables.c;h=563670a38add5b6d5820c0195a912c8f7cf956b1;hb=33191679e1a86ba6d9c38a74d0795d00c300f2c5;hp=92b4878caa597f3eb4e16c086971f7cfb4c492ea;hpb=e6d225ae6e6811d3c88dc201642a2127ff6c11bd;p=user%2Fhenk%2Fcode%2Fexim.git diff --git a/src/src/drtables.c b/src/src/drtables.c index 92b4878ca..563670a38 100644 --- a/src/src/drtables.c +++ b/src/src/drtables.c @@ -10,7 +10,6 @@ #include "exim.h" -#include #include /* This module contains tables that define the lookup methods and drivers @@ -22,6 +21,8 @@ all described in src/EDITME. */ lookup_info **lookup_list; int lookup_list_count = 0; +static int lookup_list_init_done = 0; + /* Table of information about all possible authentication mechamisms. All entries are always present if any mechanism is declared, but the functions are set to NULL for those that are not compiled into the binary. */ @@ -399,6 +400,10 @@ void init_lookup_list(void) int moduleerrors = 0; struct lookupmodulestr *p; + if (lookup_list_init_done) + return; + lookup_list_init_done = 1; + #if defined(LOOKUP_CDB) && LOOKUP_CDB!=2 extern lookup_module_info cdb_lookup_module_info; addlookupmodule(NULL, &cdb_lookup_module_info); @@ -519,6 +524,13 @@ extern lookup_module_info whoson_lookup_module_info; continue; } + /* FreeBSD nsdispatch() can trigger dlerror() errors about + * _nss_cache_cycle_prevention_function; we need to clear the dlerror() + * state before calling dlsym(), so that any error afterwards only + * comes from dlsym(). + */ + errormsg = dlerror(); + info = (struct lookup_module_info*) dlsym(dl, "_lookup_module_info"); if ((errormsg = dlerror()) != NULL) { fprintf(stderr, "%s does not appear to be a lookup module (%s)\n", name, errormsg);