[Exim] TCP_WRAPPERS_DAEMON_NAME

Top Page
Delete this message
Reply to this message
Author: Michael Kosowsky
Date:  
To: exim-users
Subject: [Exim] TCP_WRAPPERS_DAEMON_NAME
Here's a patch to 4.24 that allows setting,
as a compile time option, a different name
to use in tcpwrappers. e.g. If you build
with TCP_WRAPPERS_DAEMON_NAME="exim2",
then in /etc/hosts.allow you can refer to
this daemon as exim2. The rationale is
to be able to build different versions
with differing access policies.

Having finished it, I see that a runtime option
probably makes more sense, so I'll certainly
understand if you just toss this ...

MK


--------------------------------------------------------------

diff -Naur exim-4.24-orig/doc/OptionLists.txt exim-4.24/doc/OptionLists.txt
--- exim-4.24-orig/doc/OptionLists.txt    Mon Sep 22 08:30:02 2003
+++ exim-4.24/doc/OptionLists.txt    Wed Oct  1 22:02:50 2003
@@ -816,6 +816,7 @@
 SYSLOG_LOG_PID               optional     add pid to syslog lines
 SYSLOG_LONG_LINES            optional     do not split long syslog lines
 SYSTEM_ALIASES_FILE          optional     defaults to /etc/aliases
+TCP_WRAPPERS_DAEMON_NAME     system*      daemon name used by tcpwrappers
 TIMEZONE_DEFAULT             optional     default for timezone option
 TLS_INCLUDE                  optional     path to include files for TLS
 TLS_LIBS                     optional     additional libraries for TLS
diff -Naur exim-4.24-orig/doc/spec.txt exim-4.24/doc/spec.txt
--- exim-4.24-orig/doc/spec.txt    Mon Sep 22 08:30:02 2003
+++ exim-4.24/doc/spec.txt    Thu Oct  2 11:22:29 2003
@@ -1820,8 +1820,12 @@


in your /etc/hosts.allow file allows connections from the local host, from the
subnet 192.168.1.0/24, and from all hosts in "friendly.domain.example". All
-other connections are denied. Consult the "tcpwrappers" documentation for
-further details.
+other connections are denied. The name to use in the config file
+can be changed by defining TCP_WRAPPERS_DAEMON_NAME, e.g.
+
+ TCP_WRAPPERS_DAEMON_NAME="exim2"
+
+Consult the "tcpwrappers" documentation for further details.


 4.7 Including support for IPv6
diff -Naur exim-4.24-orig/src/EDITME exim-4.24/src/EDITME
--- exim-4.24-orig/src/EDITME    Mon Sep 22 08:29:54 2003
+++ exim-4.24/src/EDITME    Thu Oct  2 11:22:27 2003
@@ -653,7 +653,12 @@
 #
 # but of course there may need to be other things in CFLAGS and EXTRALIBS_EXIM
 # as well.
-
+#
+# If you want to use a name other than exim in the tcpwrappers config file,
+# e.g. if you're running multiple daemons with different access lists,
+# define TCP_WRAPPERS_DAEMON_NAME accordingly
+#
+# TCP_WRAPPERS_DAEMON_NAME="exim"


 #------------------------------------------------------------------------------
 # The default action of the exim_install script (which is run by "make
diff -Naur exim-4.24-orig/src/buildconfig.c exim-4.24/src/buildconfig.c
--- exim-4.24-orig/src/buildconfig.c    Mon Sep 22 08:29:55 2003
+++ exim-4.24/src/buildconfig.c    Thu Oct  2 11:24:45 2003
@@ -560,10 +560,11 @@
         fprintf(new, "\"%s\"\n", value);
         }


-      /* Timezone values and HEADERS_CHARSET get quoted */
+      /* Timezone values and HEADERS_CHARSET and TCP_WRAPPERS_DAEMON_NAME get quoted */


       else if (strcmp(name, "TIMEZONE_DEFAULT") == 0||
-               strcmp(name, "HEADERS_CHARSET") == 0)
+               strcmp(name, "HEADERS_CHARSET") == 0||
+               strcmp(name, "TCP_WRAPPERS_DAEMON_NAME") == 0)
         fprintf(new, "\"%s\"\n", value);


       /* For others, quote any paths and don't quote anything else */
diff -Naur exim-4.24-orig/src/config.h.defaults exim-4.24/src/config.h.defaults
--- exim-4.24-orig/src/config.h.defaults    Mon Sep 22 08:29:55 2003
+++ exim-4.24/src/config.h.defaults    Wed Oct  1 22:04:48 2003
@@ -114,6 +114,8 @@
 #define SYSLOG_LOG_PID
 #define SYSLOG_LONG_LINES


+#define TCP_WRAPPERS_DAEMON_NAME "exim"
+
#define TIMEZONE_DEFAULT
#define TMPDIR

diff -Naur exim-4.24-orig/src/exim.c exim-4.24/src/exim.c
--- exim-4.24-orig/src/exim.c    Mon Sep 22 08:29:55 2003
+++ exim-4.24/src/exim.c    Wed Oct  1 23:35:13 2003
@@ -772,7 +772,7 @@
   fprintf(f, " Perl");
 #endif
 #ifdef USE_TCP_WRAPPERS
-  fprintf(f, " TCPwrappers");
+  fprintf(f, " TCPwrappers (daemon name " TCP_WRAPPERS_DAEMON_NAME ")" );
 #endif
 #ifdef SUPPORT_TLS
   #ifdef USE_GNUTLS
diff -Naur exim-4.24-orig/src/smtp_in.c exim-4.24/src/smtp_in.c
--- exim-4.24-orig/src/smtp_in.c    Mon Sep 22 08:29:59 2003
+++ exim-4.24/src/smtp_in.c    Wed Oct  1 22:05:22 2003
@@ -1360,7 +1360,7 @@
   /* Test with TCP Wrappers if so configured */


   #ifdef USE_TCP_WRAPPERS
-  if (!hosts_ctl("exim",
+  if (!hosts_ctl(TCP_WRAPPERS_DAEMON_NAME,
      (sender_host_name == NULL)? STRING_UNKNOWN : CS sender_host_name,
      (sender_host_address == NULL)? STRING_UNKNOWN : CS sender_host_address,
      (sender_ident == NULL)? STRING_UNKNOWN : CS sender_ident))