[exim-dev] [Bug 139] Dynamically loadable lookup modules

Góra strony
Delete this message
Reply to this message
Autor: Serge Demonchaux
Data:  
Dla: exim-dev
Temat: [exim-dev] [Bug 139] Dynamically loadable lookup modules
------- You are receiving this mail because: -------
You are the QA contact for the bug.

http://bugs.exim.org/show_bug.cgi?id=139

Serge Demonchaux <serge-exim@???> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |serge-exim@???





--- Comment #26 from Serge Demonchaux <serge-exim@???> 2009-11-06 12:34:45 ---
(In reply to comment #19)
> Created an attachment (id=239)

--> (http://bugs.exim.org/attachment.cgi?id=239) [details]
> updated patch for 4.69
>
> Updated to 4.69
>
> We should probably do with adding the list of loaded lookups to 'exim -bV'
> output somehow. And it would be nice if we could avoid using RTLD_NOW.
>


The cosmetic path called in show_whats_supported() function to
display list of loadable lookup modules possible.


-----------<start>---------
--- exim-4.70.lookup/src/exim.c 2009-11-06 13:18:19 +0100
+++ exim-4.70.lookup2/src/exim.c        2009-11-06 13:19:02 +0100
@@ -976,6 +976,34 @@
 #endif
 fprintf(f, "\n");


+/* List of loadable lookup modules possible.
+   NOTE: this is not an real list of dl, to this point
+         in time the module was not yet tested!
+ */
+#ifdef LOOKUP_MODULE_DIR
+  DIR *dd;
+  struct dirent *ent;
+
+  dd = opendir(LOOKUP_MODULE_DIR);
+  if (dd != NULL) {
+    fprintf(f, "Lookups (as-module):");
+    while ((ent = readdir(dd)) != NULL) {
+      char *name = ent->d_name;
+      int len = (int)strlen(name);
+      /* The length of a name is be greater or equal than
+         length of 'cdb' module and the module must end as '.so'.
+       */
+      if ( len >= 3 + 3 && strncmp(name + (len-3), ".so", 3) == 0 ) {
+         /* Remove '.so' at the end of module name.
+          */
+         name[len-3] = '\0';
+         fprintf(f, " %s", name);
+      };
+    };
+  };
+  fprintf(f, "\n");
+#endif
+
 fprintf(f, "Authenticators:");
 #ifdef AUTH_CRAM_MD5
   fprintf(f, " cram_md5");
-----------<end>---------



% /usr/sbin/exim -bV
Exim version 4.70 #1 built 06-Nov-2009 12:32:58
Copyright (c) University of Cambridge 2006
Berkeley DB: Sleepycat Software: Berkeley DB 4.3.29: (September 6, 2005)
Support for: crypteq iconv() Expand_dlfunc OpenSSL move_frozen_messages
Experimental_SPF
Lookups (built-in): lsearch wildlsearch nwildlsearch iplsearch dbm dbmnz passwd
Lookups (as-module): mysql dnsdb
Authenticators: cram_md5 plaintext
Routers: accept dnslookup manualroute queryprogram redirect
Transports: appendfile/maildir autoreply lmtp pipe smtp
Fixed never_users: 0
Size of off_t: 4
OpenSSL compile-time version: OpenSSL 0.9.7m 23 Feb 2007
OpenSSL runtime version: OpenSSL 0.9.7m 23 Feb 2007
Configuration file is /etc/exim/exim.conf


Regards,

--Serge


--
Configure bugmail: http://bugs.exim.org/userprefs.cgi?tab=email