Your message dated Thu, 28 Jul 2005 11:22:59 +0100
with message-id <[EMAIL PROTECTED]>
and subject line Bug#159168: Please split off lookup methods from the main
binary
has caused the attached Bug report to be marked as done.
This means that you claim that the problem has been dealt with.
If this is not the case it is now your responsibility to reopen the
Bug report if necessary, and/or fix the problem forthwith.
(NB: If you are a system administrator and have no idea what I am
talking about this indicates a serious mail system misconfiguration
somewhere. Please contact me immediately.)
Debian bug tracking system administrator
(administrator, Debian Bugs database)
--------------------------------------
Received: (at submit) by bugs.debian.org; 1 Sep 2002 17:13:16 +0000
>From [EMAIL PROTECTED] Sun Sep 01 12:13:16 2002
Return-path: <[EMAIL PROTECTED]>
Received: from mailout07.sul.t-online.com [194.25.134.83]
by master.debian.org with esmtp (Exim 3.12 1 (Debian))
id 17lYHj-0007Fd-00; Sun, 01 Sep 2002 12:13:16 -0500
Received: from fwd01.sul.t-online.de
by mailout07.sul.t-online.com with smtp
id 17lYHi-0001fa-04; Sun, 01 Sep 2002 19:13:14 +0200
Received: from stargate.galaxy ([EMAIL PROTECTED]) by fmrl01.sul.t-online.com
with esmtp id 17lYHa-14C6wSC; Sun, 1 Sep 2002 19:13:06 +0200
Received: (from [EMAIL PROTECTED])
by stargate.galaxy (8.9.3/8.9.3/Debian 8.9.3-21) id SAA19805
for [EMAIL PROTECTED]; Sun, 1 Sep 2002 18:54:50 +0200
Date: Sun, 1 Sep 2002 18:54:50 +0200
From: Torsten Landschoff <[EMAIL PROTECTED]>
To: [EMAIL PROTECTED]
Subject: Please split off lookup methods from the main binary
Message-ID: <[EMAIL PROTECTED]>
Mime-Version: 1.0
Content-Type: multipart/mixed; boundary="RASg3xLB4tUQ4RcS"
Content-Disposition: inline
User-Agent: Mutt/1.2.5i
X-Sender: [EMAIL PROTECTED]
Delivered-To: [EMAIL PROTECTED]
--RASg3xLB4tUQ4RcS
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
Package: exim
Version: 3.36-1
Severity: wishlist
Tags: patch
Hi Mark,
I just hacked around for quite a while on exim to check if it would
be possible to split off all those lookup methods from the main binary.
I came up with the attached patch. I know it is not ready for prime time
but I first wanted to know if it would be feasible at all.
The idea is to remove the dependency exim -> libldap2. That way I can
build ldap with TLS enabled. My idea to seperate out the TLS support
into libldap2-tls is not going to work it seems, I got all but trouble
with that approach. Therefore I propose that exim does no longer depend
on libldap2 so that can become a lower priority.
Thanks
Torsten
--RASg3xLB4tUQ4RcS
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment; filename=eximdiff
diff -u exim-3.36/OS/Makefile-Base exim-3.36/OS/Makefile-Base
--- exim-3.36/OS/Makefile-Base
+++ exim-3.36/OS/Makefile-Base
@@ -218,11 +218,11 @@
$(OBJ_EXIM) version.c
awk '{ print ($$1+1) }' cnumber.h > cnumber.temp
/bin/rm -f cnumber.h; mv cnumber.temp cnumber.h
- $(CC) -c $(CFLAGS) $(INCLUDE) $(IPV6_INCLUDE) $(TLS_INCLUDE) version.c
+ $(CC) -rdynamic -c $(CFLAGS) $(INCLUDE) $(IPV6_INCLUDE) $(TLS_INCLUDE)
version.c
/bin/rm -f exim
$(PURIFY) $(CC) -o exim $(LFLAGS) $(OBJ_EXIM) version.o \
-lident -lpcre directors/directors.a \
- routers/routers.a transports/transports.a lookups/lookups.a \
+ routers/routers.a transports/transports.a \
auths/auths.a \
$(LIBS) $(LIBS_EXIM) $(IPV6_LIBS) $(EXTRALIBS) $(EXTRALIBS_EXIM) \
$(DBMLIB) $(LIBRESOLV) $(LOOKUP_LIBS) $(PERL_LIBS) $(TLS_LIBS)
diff -u exim-3.36/src/exim.c exim-3.36/src/exim.c
--- exim-3.36/src/exim.c
+++ exim-3.36/src/exim.c
@@ -1950,6 +1950,12 @@
}
}
+/* Load the lookup methods if they were build as plugins */
+
+#ifdef LOOKUP_PLUGINS
+init_lookup_list();
+#endif
+
/* Read the main runtime configuration data; this gives up if there
is a failure. It leaves the configuration file open so that the subsequent
configuration data for delivery can be read if needed. */
diff -u exim-3.36/debian/changelog exim-3.36/debian/changelog
--- exim-3.36/debian/changelog
+++ exim-3.36/debian/changelog
@@ -1,3 +1,9 @@
+exim (3.36-2) unstable; urgency=low
+
+ * Hack around to split off plugins...
+
+ -- Torsten Landschoff <[EMAIL PROTECTED]> Sun, 1 Sep 2002 18:16:28 +0200
+
exim (3.36-1) unstable; urgency=low
* New upstream version (Closes: #150662)
diff -u exim-3.36/debian/rules exim-3.36/debian/rules
--- exim-3.36/debian/rules
+++ exim-3.36/debian/rules
@@ -46,6 +46,8 @@
install -d debian/tmp/usr/sbin
install -d debian/tmp/usr/bin
install -d debian/tmp/usr/lib
+ install -d debian/tmp/usr/lib/exim
+ install -d debian/tmp/usr/lib/exim/lookups
install -d debian/tmp/usr/share/doc/exim
install -d debian/tmp/usr/share/man/man8
install -d debian/tmp/etc/exim
@@ -58,6 +60,9 @@
inst_dest=`pwd`/debian/tmp/usr/sbin install
# But eximon wants to go in a different package
mv debian/tmp/usr/sbin/eximon* .
+ # Install the plugins
+ find build-* -name \*.so -exec \
+ install -m 0644 \{\} debian/tmp/usr/lib/exim/lookups \;
# Install other files
install debian/config debian/tmp/usr/sbin/eximconfig
install util/convert4r3 debian/tmp/usr/sbin/exim-upgrade-to-r3
only in patch2:
unchanged:
--- exim-3.36.orig/src/drtables.c
+++ exim-3.36/src/drtables.c
@@ -76,6 +76,140 @@
#endif
+#ifdef LOOKUP_PLUGINS
+#include <sys/types.h>
+#include <dirent.h>
+#include <dlfcn.h>
+
+static void
+init_lookup_type(const char *name, void *plugin,
+ const char *open, const char *check,
+ const char *find, const char *close,
+ const char *tidy, const char *quote)
+{
+lookup_info *li;
+const char *err;
+
+for (li = lookup_list; li->name[0] != 0; li++)
+ {
+ if (strcmp(name, li->name) == 0)
+ {
+ dlerror(); /* reset error state */
+ li->open = open != NULL ? dlsym(plugin, open) : NULL;
+ li->check = check != NULL ? dlsym(plugin, check) : NULL;
+ li->find = find != NULL ? dlsym(plugin, find) : NULL;
+ li->close = close != NULL ? dlsym(plugin, close) : NULL;
+ li->tidy = tidy != NULL ? dlsym(plugin, tidy) : NULL;
+ li->quote = quote != NULL ? dlsym(plugin, quote) : NULL;
+
+ err = dlerror();
+ if (err != NULL)
+ log_write(0, LOG_PANIC_DIE, "Error loading plugin %s: %s", name, err);
+ else
+ log_write(0, LOG_MAIN, "Completed loading plugin %s", name);
+ return;
+ }
+ }
+}
+
+void
+init_lookup_list(void)
+{
+DIR *dirhandle;
+struct dirent *entry;
+void *plugin;
+
+dirhandle = opendir(PLUGIN_DIRECTORY "/lookups");
+if (dirhandle == NULL)
+ {
+ log_write(0, LOG_MAIN, "Failed to open plugin directory %s/lookups: %s",
+ PLUGIN_DIRECTORY, strerror(errno));
+ return;
+ }
+
+while (errno = 0, (entry = readdir(dirhandle)) != NULL)
+ {
+ char fullname[128];
+ if (entry->d_name[0] == '.')
+ continue;
+ sprintf(fullname, "%s/lookups/%s", PLUGIN_DIRECTORY, entry->d_name);
+ plugin = dlopen(fullname, RTLD_NOW);
+ if (plugin == NULL)
+ {
+ const char *err = dlerror();
+ log_write(0, LOG_MAIN, "Failed to load lookup plugin from %s: %s",
+ fullname, err != NULL ? err : "No info");
+ continue;
+ }
+
+ if (0)
+ ;
+#ifdef LOOKUP_CDB
+ else if (strcmp(entry->d_name, "cdb.so") == 0)
+ init_lookup_type("cdb", plugin,
+ "cdb_open", "cdb_check", "cdb_find", "cdb_close", NULL, NULL);
+#endif
+#ifdef LOOKUP_DBM
+ else if (strcmp(entry->d_name, "dbmdb.so") == 0)
+ {
+ init_lookup_type("dbm", plugin,
+ "dbmdb_open", "dbmdb_check", "dbmdb_find", "dbmdb_close", NULL, NULL);
+ init_lookup_type("dbmnz", plugin,
+ "dbmdb_open", "dbmdb_check", "dbmnz_find", "dbmdb_close", NULL, NULL);
+ }
+#endif
+#ifdef LOOKUP_DNSDB
+ else if (strcmp(entry->d_name, "dnsdb.so") == 0)
+ init_lookup_type("dnsdb", plugin,
+ "dnsdb_open", NULL, "dnsdb_find", NULL, NULL, NULL);
+#endif
+#ifdef LOOKUP_LDAP
+ else if (strcmp(entry->d_name, "ldap.so") == 0)
+ {
+ init_lookup_type("ldap", plugin,
+ "eldap_open", NULL, "eldap_find", NULL, "eldap_tidy", "eldap_quote");
+ init_lookup_type("ldapm", plugin,
+ "eldap_open", NULL, "eldapm_find", NULL, "eldap_tidy", "eldap_quote");
+ init_lookup_type("ldapdn", plugin,
+ "eldap_open", NULL, "eldapdn_find", NULL, "eldap_tidy", "eldap_quote");
+ }
+#endif
+#ifdef LOOKUP_LSEARCH
+ else if (strcmp(entry->d_name, "lsearch.so") == 0)
+ init_lookup_type("lsearch", plugin,
+ "lsearch_open", "lsearch_check", "lsearch_find", "lsearch_close",
+ NULL, NULL);
+#endif
+#ifdef LOOKUP_MYSQL
+ else if (strcmp(entry->d_name, "mysql.so") == 0)
+ init_lookup_type("mysql", plugin,
+ "mysql_open", NULL, "mysql_find", NULL, "mysql_tidy", "mysql_quote");
+#endif
+#ifdef LOOKUP_NIS
+ else if (strcmp(entry->d_name, "nis.so") == 0)
+ {
+ init_lookup_type("nis", plugin,
+ "nis_open", NULL, "nis_find", NULL, NULL, NULL);
+ init_lookup_type("nis0", plugin,
+ "nis_open", NULL, "nis0_find", NULL, NULL, NULL);
+ }
+#endif
+#ifdef LOOKUP_NISPLUS
+ else if (strcmp(entry->d_name, "nisplus.so") == 0)
+ init_lookup_type("nisplus", plugin,
+ "nisplus_open", NULL, "nisplus_find", NULL, NULL, "nisplus_quote");
+#endif
+#ifdef LOOKUP_PGSQL
+ else if (strcmp(entry->d_name, "pgsql.so") == 0)
+ init_lookup_type("pgsql", plugin,
+ "pgsql_open", NULL, "pgsql_find", NULL, "pgsql_tidy", "pgsql_quote");
+#endif
+ }
+
+closedir(dirhandle);
+}
+#endif
+
/* The second field in each item below is a set of bit flags:
lookup_querystyle => this is a query-style lookup,
@@ -92,7 +226,7 @@
{
"cdb", /* lookup name */
lookup_absfile, /* uses absolute file name */
-#ifdef LOOKUP_CDB
+#if defined LOOKUP_CDB && ! defined LOOKUP_PLUGINS
cdb_open, /* open function */
cdb_check, /* check function */
cdb_find, /* find function */
@@ -110,7 +244,7 @@
{
"dbm", /* lookup name */
lookup_absfile, /* uses absolute file name */
-#ifdef LOOKUP_DBM
+#if defined LOOKUP_DBM && ! defined LOOKUP_PLUGINS
dbmdb_open, /* open function */
dbmdb_check, /* check function */
dbmdb_find, /* find function */
@@ -128,7 +262,7 @@
{
"dbmnz", /* lookup name */
lookup_absfile, /* uses absolute file name */
-#ifdef LOOKUP_DBM
+#if defined LOOKUP_DBM && ! defined LOOKUP_PLUGINS
dbmdb_open, /* sic */ /* open function */
dbmdb_check, /* sic */ /* check function */
dbmnz_find, /* find function */
@@ -145,7 +279,7 @@
{
"dnsdb", /* lookup name */
lookup_querystyle, /* query style */
-#ifdef LOOKUP_DNSDB
+#if defined LOOKUP_DNSDB && ! defined LOOKUP_PLUGINS
dnsdb_open, /* open function */
NULL, /* check function */
dnsdb_find, /* find function */
@@ -162,7 +296,7 @@
{
"ldap", /* lookup name */
lookup_querystyle, /* query-style lookup */
-#ifdef LOOKUP_LDAP
+#if defined LOOKUP_LDAP && ! defined LOOKUP_PLUGINS
eldap_open, /* open function */
NULL, /* check function */
eldap_find, /* find function */
@@ -179,7 +313,7 @@
{
"ldapm", /* lookup name */
lookup_querystyle, /* query-style lookup */
-#ifdef LOOKUP_LDAP
+#if defined LOOKUP_LDAP && ! defined LOOKUP_PLUGINS
eldap_open, /* sic */ /* open function */
NULL, /* check function */
eldapm_find, /* find function */
@@ -196,7 +330,7 @@
{
"ldapdn", /* lookup name */
lookup_querystyle, /* query-style lookup */
-#ifdef LOOKUP_LDAP
+#if defined LOOKUP_LDAP && ! defined LOOKUP_PLUGINS
eldap_open, /* sic */ /* open function */
NULL, /* check function */
eldapdn_find, /* find function */
@@ -213,7 +347,7 @@
{
"lsearch", /* lookup name */
lookup_absfile, /* uses absolute file name */
-#ifdef LOOKUP_LSEARCH
+#if defined LOOKUP_LSEARCH && ! defined LOOKUP_PLUGINS
lsearch_open, /* open function */
lsearch_check, /* check function */
lsearch_find, /* find function */
@@ -230,7 +364,7 @@
{
"mysql", /* lookup name */
lookup_querystyle, /* query-style lookup */
-#ifdef LOOKUP_MYSQL
+#if defined LOOKUP_MYSQL && ! defined LOOKUP_PLUGINS
mysql_open, /* open function */
NULL, /* no check function */
mysql_find, /* find function */
@@ -247,7 +381,7 @@
{
"nis", /* lookup name */
0, /* not abs file, not query style*/
-#ifdef LOOKUP_NIS
+#if defined LOOKUP_NIS && ! defined LOOKUP_PLUGINS
nis_open, /* open function */
NULL, /* check function */
nis_find, /* find function */
@@ -264,7 +398,7 @@
{
"nis0", /* lookup name */
0, /* not absfile, not query style */
-#ifdef LOOKUP_NIS
+#if defined LOOKUP_NIS && ! defined LOOKUP_PLUGINS
nis_open, /* sic */ /* open function */
NULL, /* check function */
nis0_find, /* find function */
@@ -281,7 +415,7 @@
{
"nisplus", /* lookup name */
lookup_querystyle, /* query-style lookup */
-#ifdef LOOKUP_NISPLUS
+#if defined LOOKUP_NISPLUS && ! defined LOOKUP_PLUGINS
nisplus_open, /* open function */
NULL, /* check function */
nisplus_find, /* find function */
@@ -298,7 +432,7 @@
{
"pgsql", /* lookup name */
lookup_querystyle, /* query-style lookup */
-#ifdef LOOKUP_PGSQL
+#if defined LOOKUP_PGSQL && ! defined LOOKUP_PLUGINS
pgsql_open, /* open function */
NULL, /* no check function */
pgsql_find, /* find function */
@@ -319,12 +453,16 @@
{
"testdb", /* lookup name */
lookup_querystyle, /* query-style lookup */
+#if ! defined LOOKUP_PLUGINS
testdb_open, /* open function */
NULL, /* check function */
testdb_find, /* find function */
NULL, /* no close function */
NULL, /* no tidy function */
NULL /* no quoting function */
+#else
+ NULL, NULL, NULL, NULL, NULL, NULL /* lookup not present */
+#endif
},
#endif
only in patch2:
unchanged:
--- exim-3.36.orig/src/EDITME
+++ exim-3.36/src/EDITME
@@ -333,6 +333,8 @@
# a general database facility (not common). For details of cdb files and the
# tools to build them, see http://www.pobox.com/~djb/cdb.html.
+LOOKUP_PLUGINS=yes
+PLUGIN_DIRECTORY=/usr/lib/exim
LOOKUP_DBM=yes
LOOKUP_LSEARCH=yes
only in patch2:
unchanged:
--- exim-3.36.orig/src/config.h.defaults
+++ exim-3.36/src/config.h.defaults
@@ -45,6 +45,8 @@
#define LOG_FILE_PATH
#define LOG_MODE 0640
+#define LOOKUP_PLUGINS
+#define PLUGIN_DIRECTORY
#define LOOKUP_CDB
#define LOOKUP_DBM
#define LOOKUP_DNSDB
only in patch2:
unchanged:
--- exim-3.36.orig/src/functions.h
+++ exim-3.36/src/functions.h
@@ -16,6 +16,10 @@
extern char *init_perl(char *);
#endif
+#ifdef LOOKUP_PLUGINS
+extern void init_lookup_list(void);
+#endif
+
#ifdef SUPPORT_TLS
extern BOOL tls_client_start(int, host_item *, address_item *, char *,
char *, char *, char *, char *, int);
only in patch2:
unchanged:
--- exim-3.36.orig/src/lookups/Makefile
+++ exim-3.36/src/lookups/Makefile
@@ -5,25 +5,33 @@
OBJ = cdb.o dbmdb.o dnsdb.o ldap.o lsearch.o mysql.o nis.o nisplus.o pgsql.o \
testdb.o
+SOBJ = $(patsubst %.o,%.so,$(OBJ))
-lookups.a: $(OBJ)
+lookups.a: $(OBJ) $(SOBJ)
/bin/rm -f lookups.a
$(AR) lookups.a $(OBJ)
$(RANLIB) $@
/bin/rm -rf ../drtables.o
-.SUFFIXES: .o .c
+.SUFFIXES: .o .so .c
.c.o:; $(CC) -c $(CFLAGS) $(INCLUDE) $*.c
+.c.so:; $(CC) -shared $(CFLAGS) $(INCLUDE) $*.c -o $*.so
cdb.o: $(HDRS) cdb.c cdb.h
dbmdb.o: $(HDRS) dbmdb.c dbmdb.h
dnsdb.o: $(HDRS) dnsdb.c dnsdb.h
ldap.o: $(HDRS) ldap.c ldap.h
+ldap.so: $(HDRS) ldap.c ldap.h
+ $(CC) -shared $(CFLAGS) $(INCLUDE) $*.c -o $*.so -lldap
lsearch.o: $(HDRS) lsearch.c lsearch.h
mysql.o: $(HDRS) mysql.c mysql.h
+mysql.so: $(HDRS) mysql.c mysql.h
+ $(CC) -shared $(CFLAGS) $(INCLUDE) $*.c -o $*.so -lmysqlclient
nis.o: $(HDRS) nis.c nis.h
nisplus.o: $(HDRS) nisplus.c nisplus.h
-pgsql.o: $(HDRS) pgsql.c pgsql.h
+pgsql.o: $(HDRS) pgsql.c pgsql.h
+pgsql.so: $(HDRS) pgsql.c pgsql.h
+ $(CC) -shared $(CFLAGS) $(INCLUDE) $*.c -o $*.so -lpq
testdb.o: $(HDRS) testdb.c testdb.h
# End
--RASg3xLB4tUQ4RcS--
---------------------------------------
Received: (at 159168-done) by bugs.debian.org; 28 Jul 2005 10:23:30 +0000
>From [EMAIL PROTECTED] Thu Jul 28 03:23:30 2005
Return-path: <[EMAIL PROTECTED]>
Received: from mail0.avcosystems.co.uk [195.224.236.86]
by spohr.debian.org with esmtp (Exim 3.36 1 (Debian))
id 1Dy5Y2-0007yh-00; Thu, 28 Jul 2005 03:23:30 -0700
Received: from lexx.avco ([192.168.0.1] helo=andromeda)
by mail0.avcosystems.co.uk with esmtp (Exim 4.52 #1 (Debian))
id 1Dy5XY-0004xy-3z
for <[EMAIL PROTECTED]>; Thu, 28 Jul 2005 11:23:00 +0100
Received: from 127.0.0.1 (AVG SMTP 7.0.338 [267.9.6]); Thu, 28 Jul 2005
11:23:00 +0100
Message-ID: <[EMAIL PROTECTED]>
From: "Adam D. Barratt" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
References: <[EMAIL PROTECTED]>
Subject: Re: Bug#159168: Please split off lookup methods from the main binary
Date: Thu, 28 Jul 2005 11:22:59 +0100
MIME-Version: 1.0
Content-Type: text/plain;
charset="iso-8859-1"
Content-Transfer-Encoding: 7bit
X-Priority: 3
X-MSMail-Priority: Normal
X-Mailer: Microsoft Outlook Express 6.00.2800.1506
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1506
X-AVCO-Scan-Signature: 8c5c9e3163aaecc9ee583e3821395d84
Delivered-To: [EMAIL PROTECTED]
X-Spam-Checker-Version: SpamAssassin 2.60-bugs.debian.org_2005_01_02
(1.212-2003-09-23-exp) on spohr.debian.org
X-Spam-Level:
X-Spam-Status: No, hits=-5.0 required=4.0 tests=BAYES_01,HAS_BUG_NUMBER
autolearn=no version=2.60-bugs.debian.org_2005_01_02
On Sunday, September 01, 2002 5:54 PM, Torsten Landschoff
<[EMAIL PROTECTED]> wrote:
> Package: exim
> Version: 3.36-1
> Severity: wishlist
> Tags: patch
>
> Hi Mark,
>
> I just hacked around for quite a while on exim to check if it would
> be possible to split off all those lookup methods from the main
> binary. I came up with the attached patch. I know it is not ready for
> prime time but I first wanted to know if it would be feasible at all.
>
> The idea is to remove the dependency exim -> libldap2. That way I can
> build ldap with TLS enabled. My idea to seperate out the TLS support
> into libldap2-tls is not going to work it seems, I got all but trouble
> with that approach. Therefore I propose that exim does no longer
> depend on libldap2 so that can become a lower priority.
Upstream development on exim3 stopped more than three years ago. As Sarge
has been released, Debian's default MTA is now exim4. The maintainer of the
exim 3 packages has stated that he will not be changing the functionality of
the packages in any significant way, so I'm closing this report. (c.f.
http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=204492)
Regards,
Adam
--
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]