diff options
Diffstat (limited to 'debian/patches')
-rw-r--r-- | debian/patches/00list | 11 | ||||
-rw-r--r-- | debian/patches/10_daemon_close_fds.dpatch | 47 | ||||
-rwxr-xr-x | debian/patches/20_authplaincrash.dpatch | 34 | ||||
-rw-r--r-- | debian/patches/30_dontoverridecflags.dpatch | 36 | ||||
-rw-r--r-- | debian/patches/31_eximmanpage.dpatch | 197 | ||||
-rwxr-xr-x | debian/patches/32_exim4.dpatch | 126 | ||||
-rwxr-xr-x | debian/patches/33_eximon.binary.dpatch | 33 | ||||
-rwxr-xr-x | debian/patches/34_eximstatsmanpage.dpatch | 36 | ||||
-rwxr-xr-x | debian/patches/35_install.dpatch | 37 | ||||
-rwxr-xr-x | debian/patches/36_pcre.dpatch | 91 | ||||
-rw-r--r-- | debian/patches/40_boolean_redefine_protect.dpatch | 47 | ||||
-rw-r--r-- | debian/patches/50_localscan_dlopen.dpatch | 303 |
12 files changed, 998 insertions, 0 deletions
diff --git a/debian/patches/00list b/debian/patches/00list new file mode 100644 index 0000000..6408ad8 --- /dev/null +++ b/debian/patches/00list @@ -0,0 +1,11 @@ +10_daemon_close_fds +20_authplaincrash +30_dontoverridecflags +31_eximmanpage +32_exim4 +33_eximon.binary +34_eximstatsmanpage +35_install +36_pcre +40_boolean_redefine_protect +50_localscan_dlopen diff --git a/debian/patches/10_daemon_close_fds.dpatch b/debian/patches/10_daemon_close_fds.dpatch new file mode 100644 index 0000000..3da77b6 --- /dev/null +++ b/debian/patches/10_daemon_close_fds.dpatch @@ -0,0 +1,47 @@ +#! /bin/sh -e +## 10_daemon_close_fds.dpatch by Steve Haslam <araqnid@debian.org> +## +## All lines beginning with `## DP:' are a description of the patch. +## DP: Close FDs 0-254 when going into background + +if [ $# -ne 1 ]; then + echo >&2 "`basename $0`: script expects -patch|-unpatch as argument" + exit 1 +fi +case "$1" in + -patch) patch -f --no-backup-if-mismatch --dry-run -p0 < $0 && patch -f --no-backup-if-mismatch -p0 < $0;; + -unpatch) patch -f --no-backup-if-mismatch -R -p0 < $0;; + *) + echo >&2 "`basename $0`: script expects -patch|-unpatch as argument" + exit 1;; +esac +exit 0 + +@DPATCH@ +--- ../old/src/daemon.c 2002-12-18 10:28:01.000000000 +0000 ++++ src/daemon.c 2003-01-19 06:24:18.000000000 +0000 +@@ -42,6 +42,13 @@ + static smtp_slot *smtp_slots; + + ++static void close_fds(void) ++{ ++ int fd; ++ for (fd = 0; fd < 255; fd++) { ++ close(fd); ++ } ++} + + /************************************************* + * SIGALRM Handler * +@@ -662,9 +669,7 @@ + { + log_close_all(); /* Just in case anything was logged earlier */ + search_tidyup(); /* Just in case any were used in reading the config. */ +- close(0); /* Get rid of stdin/stdout/stderr */ +- close(1); +- close(2); ++ close_fds(); + log_stderr = NULL; /* So no attempt to copy paniclog output */ + + /* If the parent process of this one has pid == 1, we are re-initializing the diff --git a/debian/patches/20_authplaincrash.dpatch b/debian/patches/20_authplaincrash.dpatch new file mode 100755 index 0000000..932d97e --- /dev/null +++ b/debian/patches/20_authplaincrash.dpatch @@ -0,0 +1,34 @@ +#! /bin/sh -e +## 20_authplaincrash.dpatch by Philip Hazel <ph10@cus.cam.ac.uk> +## +## All lines beginning with `## DP:' are a description of the patch. +## DP: exim crashes on special AUTH PLAIN dialog. +## DP: http://www.exim.org/pipermail/exim-users/Week-of-Mon-20030317/051346.html + +if [ $# -ne 1 ]; then + echo >&2 "`basename $0`: script expects -patch|-unpatch as argument" + exit 1 +fi +case "$1" in + -patch) patch -f --no-backup-if-mismatch -p1 < $0;; + -unpatch) patch -f --no-backup-if-mismatch -R -p1 < $0;; + *) + echo >&2 "`basename $0`: script expects -patch|-unpatch as argument" + exit 1;; +esac + +exit 0 + +@DPATCH@ +diff -urNad 10.exim4.tmp/src/auths/plaintext.c 10.exim4/src/auths/plaintext.c +--- 10.exim4.tmp/src/auths/plaintext.c Thu Mar 13 13:29:58 2003 ++++ 10.exim4/src/auths/plaintext.c Wed Mar 19 18:27:55 2003 +@@ -93,7 +93,7 @@ + if (Ustrcmp(data, "=") == 0) + { + expand_nstring[++expand_nmax] = US""; +- expand_nstring[expand_nmax] = 0; ++ expand_nlength[expand_nmax] = 0; + } + else + { diff --git a/debian/patches/30_dontoverridecflags.dpatch b/debian/patches/30_dontoverridecflags.dpatch new file mode 100644 index 0000000..cf7bc7b --- /dev/null +++ b/debian/patches/30_dontoverridecflags.dpatch @@ -0,0 +1,36 @@ +#! /bin/sh -e +## 30_dontoverridecflags.dpatch by Andreas Metzler +## +## All lines beginning with `## DP:' are a description of the patch. +## DP: Don't override CFLAGS in OS/Makefile-Linux, allow to set them +## DP: e.g. in debian/rules + +if [ $# -ne 1 ]; then + echo >&2 "`basename $0`: script expects -patch|-unpatch as argument" + exit 1 +fi +case "$1" in + -patch) patch -f --no-backup-if-mismatch -p1 < $0;; + -unpatch) patch -f --no-backup-if-mismatch -R -p1 < $0;; + *) + echo >&2 "`basename $0`: script expects -patch|-unpatch as argument" + exit 1;; +esac + +exit 0 + +@DPATCH@ +diff -urNad 30.tmp/OS/Makefile-Linux 30/OS/Makefile-Linux +--- 30.tmp/OS/Makefile-Linux Mon Dec 30 10:06:45 2002 ++++ 30/OS/Makefile-Linux Mon Dec 30 10:07:07 2002 +@@ -3,8 +3,9 @@ + + BASENAME_COMMAND=look_for_it + +-CFLAGS=-O ++# Assume Linuxes use gcc too + ++CFLAGS ?= -O + DBMLIB = -ldb + USE_DB = yes + diff --git a/debian/patches/31_eximmanpage.dpatch b/debian/patches/31_eximmanpage.dpatch new file mode 100644 index 0000000..207e524 --- /dev/null +++ b/debian/patches/31_eximmanpage.dpatch @@ -0,0 +1,197 @@ +#! /bin/sh -e +## 31_newpatch.dpatch by <ametzler@logic.univie.ac.at> +## +## All lines beginning with `## DP:' are a description of the patch. +## DP: Add info about rmail, mailq, etc. to exim(8). + +if [ $# -ne 1 ]; then + echo >&2 "`basename $0`: script expects -patch|-unpatch as argument" + exit 1 +fi +case "$1" in + -patch) patch -f --no-backup-if-mismatch -p1 < $0;; + -unpatch) patch -f --no-backup-if-mismatch -R -p1 < $0;; + *) + echo >&2 "`basename $0`: script expects -patch|-unpatch as argument" + exit 1;; +esac + +exit 0 + +@DPATCH@ +diff -urNad 31.exim4.tmp/doc/exim.8 31.exim4/doc/exim.8 +--- 31.exim4.tmp/doc/exim.8 Wed Dec 18 11:28:05 2002 ++++ 31.exim4/doc/exim.8 Sat Mar 1 09:30:34 2003 +@@ -3,6 +3,11 @@ + exim - a Mail Transfer Agent + .SH SYNOPSIS + .B exim [options] arguments ... ++.B mailq [options] arguments ... ++.B rsmtp [options] arguments ... ++.B rmail [options] arguments ... ++.B runq [options] arguments ... ++.B newaliases [options] arguments ... + + .SH DESCRIPTION + Exim is a mail transport agent (MTA) developed at the University of Cambridge. +@@ -11,6 +16,27 @@ + line options. It has been automatically generated from the reference manual + source, which is why the formatting is poor in some places. + ++.SH SETTING OPTIONS BY PROGRAM NAME ++.TP 10 ++\fBmailq\fR ++Behave as if the option \-bp were present before any other options. ++.TP ++\fBrsmtp\fR ++Behaves as if the option \-bS were present before any other options, ++for compatibility with Smail ++.TP ++\fBrmail\fR ++Behave as if the \-i and \-oee options were present before any other options, ++for compatibility with Smail. ++.TP ++\fBrunq\fR ++Behave as if the option \-q were present before any other options, for ++compatibility with Smail. ++.TP ++\fBnewaliases\fR ++Behave as if the option \-bi were present before any other options, for ++compatibility with Sendmail. ++ + .SH OPTIONS + .TP 10 + \fB--\fR +@@ -53,7 +79,7 @@ + When -oX is used on the command to start a listening daemon, the process id + is not written to the normal pid file path. However, -oP can be used to + specify a path on the command line if a pid file is required. +-.nem ++.ne + + .em + The SIGHUP signal can be used to cause the daemon to re-exec itself. This +@@ -62,7 +88,7 @@ + whenever a new version of Exim is installed. It is not necessary to do this + when other files that are referenced from the configuration (for example, alias + files) are changed, because these are reread each time they are used. +-.nem ++.ne + .TP + \fB-bdf\fR + This option has the same effect as -bd except that it never disconnects from +@@ -129,7 +155,7 @@ + .em + Warning: You cannot test features of the configuration that rely on ident + (RFC 1413) callouts, because these are not done when testing using -bh. +-.nem ++.ne + + Messages supplied during the testing session are discarded, and nothing is + written to any of the real log files. There may be pauses when DNS (and other) +@@ -523,7 +549,7 @@ + White space between -f and the <address> is optional + .em + (that is, they can be given as two arguments or one combined argument). +-.nem ++.ne + The sender of a locally-generated message can also be set (when permitted) by + an initial `From ' line in the message -- see the description of -bm above + -- but if -f is also present, it overrides `From '. +@@ -577,7 +603,7 @@ + This option is not intended for use by external callers. It is used internally + by Exim in conjunction with the -MC option. It signifies that the server to + which Exim is connected supports pipelining. +-.nem ++.ne + .TP + \fB-MCQ <process id> <pipe fd>\fR + This option is not intended for use by external callers. It is used internally +@@ -734,7 +760,7 @@ + effect. + .em + This option overrides any setting of "queue_smtp_domains" or -odqs. +-.nem ++.ne + .TP + \fB-odqs\fR + This option is a hybrid between -odb and -odq. A background delivery +@@ -789,7 +815,7 @@ + over TCP/IP). These options can be used by any caller in conjunction with the + -bh, -bf, -bF, -bt, or -bv testing options. In other + circumstances, they are ignored unless the caller is trusted. +-.nem ++.ne + + The -oMa option sets the sender host address. This may include a port number + at the end, after a full stop (period). For example: +@@ -829,7 +855,7 @@ + input, the protocol is determined by whether EHLO or HELO is used, and + is always either `local-esmtp' or `local-smtp'. For -bS (batch SMTP) + however, the protocol can be set by -oMr. +-.nem ++.ne + .TP + \fB-oMs <host name>\fR + See -oMa above for general remarks about the -oM options. The -oMs +@@ -857,7 +883,7 @@ + written. When -oX is used with -bd, or when -q with a time is used + without -bd, this is the only way of causing Exim to write a pid file, + because in those cases, the normal pid file is not used. +-.nem ++.ne + .TP + \fB-or <time>\fR + This option sets a timeout value for incoming non-SMTP messages. If it is not +@@ -885,7 +911,7 @@ + optionally ports) on which the daemon is to listen. In this case, the data is + in the same format as the value of "local_interfaces", and it overrides that + option. +-.nem ++.ne + .TP + \fB-pd\fR + This option applies when an embedded Perl interpreter is linked with Exim. It overrides the setting of the "perl_at_start" option, +@@ -997,7 +1023,7 @@ + .em + When a daemon is started by -q with a time value, but without -db, no pid + file is written unless one is explicitly requested by the -oP option. +-.nem ++.ne + .TP + \fB-qR<rsflags> <string>\fR + This option is synonymous with -R. It is provided for Sendmail +@@ -1092,7 +1118,7 @@ + way and some the other. With only a few clients that need the legacy support, a + convenient approach is to use a daemon for normal SMTP (with or without + STARTTLS) and inetd with "-tls-on-connect-" for the legacy clients. +-.nem ++.ne + .TP + \fB-U\fR + Sendmail uses this option for `initial message submission', and its +@@ -1114,3 +1140,24 @@ + It sets -x when calling the MTA from its "mail" command. Exim ignores this + option. + .TP ++ ++.SH SEE ALSO ++.BR exicyclog (8), ++.BR exigrep (8), ++.BR exim_checkaccess (8), ++.BR exim_convert4r4 (8), ++.BR exim_db (8), ++.BR exim_dbmbuild (8), ++.BR exim_lock (8), ++.BR eximon (8), ++.BR exinext (8), ++.BR exiqgrep (8), ++.BR exiqsumm (8), ++.BR exiwhat (8), ++.BR update\-exim4.conf (8), ++.BR update\-exim4defaults (8), ++/usr/share/doc/exim4\-base/. ++ ++.SH AUTHOR ++This manual page was provided with the upstream Exim source package. ++It was enhanced for the Debian GNU/Linux system. diff --git a/debian/patches/32_exim4.dpatch b/debian/patches/32_exim4.dpatch new file mode 100755 index 0000000..9ef7965 --- /dev/null +++ b/debian/patches/32_exim4.dpatch @@ -0,0 +1,126 @@ +#! /bin/sh -e +## 32_exim4.dpatch by Andreas Metzler +## +## All lines beginning with `## DP:' are a description of the patch. +## DP: The main binary is installed as /usr/sbin/exim4 + +if [ $# -ne 1 ]; then + echo >&2 "`basename $0`: script expects -patch|-unpatch as argument" + exit 1 +fi +case "$1" in + -patch) patch -f --no-backup-if-mismatch -p1 < $0;; + -unpatch) patch -f --no-backup-if-mismatch -R -p1 < $0;; + *) + echo >&2 "`basename $0`: script expects -patch|-unpatch as argument" + exit 1;; +esac + +exit 0 + +@DPATCH@ +diff -urNad 30.tmp/OS/Makefile-Linux 30/OS/Makefile-Linux +--- 30.tmp/OS/Makefile-Linux Mon Dec 30 10:35:43 2002 ++++ 30/OS/Makefile-Linux Mon Dec 30 10:37:17 2002 +@@ -19,7 +19,7 @@ + EXIWHAT_PS_ARG=ax + EXIWHAT_EGREP_ARG='/exim( |$$)' + EXIWHAT_MULTIKILL_CMD=killall +-EXIWHAT_MULTIKILL_ARG=exim ++EXIWHAT_MULTIKILL_ARG=exim4 + EXIWHAT_KILL_SIGNAL=-USR1 + + # End +diff -urNad 30.tmp/src/exicyclog.src 30/src/exicyclog.src +--- 30.tmp/src/exicyclog.src Mon Dec 30 10:35:43 2002 ++++ 30/src/exicyclog.src Mon Dec 30 10:37:17 2002 +@@ -72,7 +72,7 @@ + + st=' ' + exim_path=`grep "^[$st]*exim_path" $config | sed "s/.*=[$st]*//"` +-if test "$exim_path" = ""; then exim_path=BIN_DIRECTORY/exim; fi ++if test "$exim_path" = ""; then exim_path=BIN_DIRECTORY/exim4; fi + + spool_directory=`$exim_path -C $config -bP spool_directory | sed 's/.*=[ ]*//'` + log_file_path=`$exim_path -C $config -bP log_file_path | sed 's/.*=[ ]*//'` +diff -urNad 30.tmp/src/exim_checkaccess.src 30/src/exim_checkaccess.src +--- 30.tmp/src/exim_checkaccess.src Mon Dec 30 10:35:43 2002 ++++ 30/src/exim_checkaccess.src Mon Dec 30 10:37:17 2002 +@@ -43,7 +43,7 @@ + + st=' ' + exim_path=`grep "^[$st]*exim_path" $config | sed "s/.*=[$st]*//"` +-if test "$exim_path" = ""; then exim_path=BIN_DIRECTORY/exim; fi ++if test "$exim_path" = ""; then exim_path=BIN_DIRECTORY/exim4; fi + + + ######################################################################### +diff -urNad 30.tmp/src/eximon.src 30/src/eximon.src +--- 30.tmp/src/eximon.src Mon Dec 30 10:35:43 2002 ++++ 30/src/eximon.src Mon Dec 30 10:37:17 2002 +@@ -49,7 +49,7 @@ + + st=' ' + EXIM_PATH=`grep "^[$st]*exim_path" $config | sed "s/.*=[$st]*//"` +-if test "$EXIM_PATH" = ""; then EXIM_PATH=BIN_DIRECTORY/exim; fi ++if test "$EXIM_PATH" = ""; then EXIM_PATH=BIN_DIRECTORY/exim4; fi + + SPOOL_DIRECTORY=`$EXIM_PATH -C $config -bP spool_directory | sed 's/.*=[ ]*//'` + LOG_FILE_PATH=`$EXIM_PATH -C $config -bP log_file_path | sed 's/.*=[ ]*//'` +diff -urNad 30.tmp/src/exinext.src 30/src/exinext.src +--- 30.tmp/src/exinext.src Mon Dec 30 10:35:43 2002 ++++ 30/src/exinext.src Mon Dec 30 10:37:17 2002 +@@ -46,7 +46,7 @@ + + st=' ' + exim_path=`grep "^[$st]*exim_path" $config | sed "s/.*=[$st]*//"` +-if test "$exim_path" = ""; then exim_path=BIN_DIRECTORY/exim; fi ++if test "$exim_path" = ""; then exim_path=BIN_DIRECTORY/exim4; fi + spool_directory=`$exim_path -C $config -bP spool_directory | sed 's/.*=[ ]*//'` + qualify_domain=`$exim_path -C $config -bP qualify_domain | sed 's/.*=[ ]*//'` + +@@ -123,7 +123,7 @@ + + # Run exim_dumpdb to get out the retry data and pick off what we want + +- open(DATA, "${exim}_dumpdb $spool retry |") || ++ open(DATA, "/usr/sbin/exim_dumpdb $spool retry |") || + die "can't run exim_dumpdb"; + + while (<DATA>) +diff -urNad 30.tmp/src/exiqgrep.src 30/src/exiqgrep.src +--- 30.tmp/src/exiqgrep.src Mon Dec 30 10:35:43 2002 ++++ 30/src/exiqgrep.src Mon Dec 30 10:37:17 2002 +@@ -12,7 +12,7 @@ + use Getopt::Std; + + # Have this variable point to your exim binary. +-my $exim = 'BIN_DIRECTORY/exim'; ++my $exim = 'BIN_DIRECTORY/exim4'; + my $eargs = '-bpu'; + my %id; + my %opt; +diff -urNad 30.tmp/src/exiwhat.src 30/src/exiwhat.src +--- 30.tmp/src/exiwhat.src Mon Dec 30 10:35:43 2002 ++++ 30/src/exiwhat.src Mon Dec 30 10:37:17 2002 +@@ -68,7 +68,7 @@ + + st=' ' + exim_path=`grep "^[$st]*exim_path" $config | sed "s/.*=[$st]*//"` +-if test "$exim_path" = ""; then exim_path=BIN_DIRECTORY/exim; fi ++if test "$exim_path" = ""; then exim_path=BIN_DIRECTORY/exim4; fi + spool_directory=`$exim_path -C $config -bP spool_directory | sed 's/.*=[ ]*//'` + + # The file that Exim writes when sent the SIGUSR1 signal is called +diff -urNad 30.tmp/src/globals.c 30/src/globals.c +--- 30.tmp/src/globals.c Mon Dec 30 10:35:43 2002 ++++ 30/src/globals.c Mon Dec 30 10:37:17 2002 +@@ -413,7 +413,7 @@ + + gid_t exim_gid = EXIM_GID; + BOOL exim_gid_set = TRUE; /* This gid is always set */ +-uschar *exim_path = US BIN_DIRECTORY "/exim" ++uschar *exim_path = US BIN_DIRECTORY "/exim4" + "\0<---------------Space to patch exim_path->"; + uid_t exim_uid = EXIM_UID; + BOOL exim_uid_set = TRUE; /* This uid is always set */ diff --git a/debian/patches/33_eximon.binary.dpatch b/debian/patches/33_eximon.binary.dpatch new file mode 100755 index 0000000..31568d0 --- /dev/null +++ b/debian/patches/33_eximon.binary.dpatch @@ -0,0 +1,33 @@ +#! /bin/sh -e +## 33_eximon.binary.dpatch by Andreas Piesk +## +## All lines beginning with `## DP:' are a description of the patch. +## DP: eximon.bin is installed in /usr/lib/exim4/ and not in path. + +if [ $# -ne 1 ]; then + echo >&2 "`basename $0`: script expects -patch|-unpatch as argument" + exit 1 +fi +case "$1" in + -patch) patch -f --no-backup-if-mismatch -p1 < $0;; + -unpatch) patch -f --no-backup-if-mismatch -R -p1 < $0;; + *) + echo >&2 "`basename $0`: script expects -patch|-unpatch as argument" + exit 1;; +esac + +exit 0 + +@DPATCH@ +diff -urNad 30.tmp/OS/eximon.conf-Default 30/OS/eximon.conf-Default +--- 30.tmp/OS/eximon.conf-Default Mon Dec 30 10:14:03 2002 ++++ 30/OS/eximon.conf-Default Mon Dec 30 10:15:04 2002 +@@ -5,7 +5,7 @@ + # The name of the eximon binary, usually the same as the eximon script, + # with .bin stuck on the end. + +-EXIMON_BINARY=${EXIMON_BINARY-$0.bin} ++EXIMON_BINARY=/usr/lib/exim4/${EXIMON_BINARY-${0##*/}.bin} + + # The remaining parameters are values likely to be changed to suit the + # user's taste. They are documented in the EDITME file. diff --git a/debian/patches/34_eximstatsmanpage.dpatch b/debian/patches/34_eximstatsmanpage.dpatch new file mode 100755 index 0000000..bd7c44a --- /dev/null +++ b/debian/patches/34_eximstatsmanpage.dpatch @@ -0,0 +1,36 @@ +#! /bin/sh -e +## 34_eximstatsmanpage.dpatch by Andreas Metzler <ametzler@downhill.at.eu.org> +## +## All lines beginning with `## DP:' are a description of the patch. +## DP: Add note about installing perl-modules on Debian to +## DP: generated manpage + +if [ $# -ne 1 ]; then + echo >&2 "`basename $0`: script expects -patch|-unpatch as argument" + exit 1 +fi +case "$1" in + -patch) patch -f --no-backup-if-mismatch -p1 < $0;; + -unpatch) patch -f --no-backup-if-mismatch -R -p1 < $0;; + *) + echo >&2 "`basename $0`: script expects -patch|-unpatch as argument" + exit 1;; +esac + +exit 0 + +@DPATCH@ +diff -urNad 30.tmp/src/eximstats.src 30/src/eximstats.src +--- 30.tmp/src/eximstats.src Wed Dec 18 11:28:01 2002 ++++ 30/src/eximstats.src Sun Jan 12 14:50:23 2003 +@@ -277,6 +277,10 @@ + make test + make install + ++On B<Debian GNU/Linux> you can use ++C<apt-get install libgd-perl libgd-text-perl libgd-graph-perl> ++instead. ++ + =item B<-chartdir>I <dir> + + Create the charts in the directory <dir> diff --git a/debian/patches/35_install.dpatch b/debian/patches/35_install.dpatch new file mode 100755 index 0000000..161861b --- /dev/null +++ b/debian/patches/35_install.dpatch @@ -0,0 +1,37 @@ +#! /bin/sh -e +## 35_install.dpatch by Andreas Metzler +## +## All lines beginning with `## DP:' are a description of the patch. +## DP: Exim's installation scripts install the binary as exim-<version> +## DP: - disable this feature. + +if [ $# -ne 1 ]; then + echo >&2 "`basename $0`: script expects -patch|-unpatch as argument" + exit 1 +fi +case "$1" in + -patch) patch -f --no-backup-if-mismatch -p1 < $0;; + -unpatch) patch -f --no-backup-if-mismatch -R -p1 < $0;; + *) + echo >&2 "`basename $0`: script expects -patch|-unpatch as argument" + exit 1;; +esac + +exit 0 + +@DPATCH@ +diff -urNad 30.tmp/scripts/exim_install 30/scripts/exim_install +--- 30.tmp/scripts/exim_install Mon Dec 30 10:19:59 2002 ++++ 30/scripts/exim_install Mon Dec 30 10:20:21 2002 +@@ -172,8 +172,9 @@ + # The exim binary is handled specially + + if [ $name = exim${EXE} ]; then +- version=exim-`./exim -bV -C /dev/null | \ +- awk '/Exim version/ { OFS=""; print $3,"-",substr($4,2,length($4)-1) }'`${EXE} ++ version=exim ++# version=exim-`./exim -bV -C /dev/null | \ ++# awk '/Exim version/ { OFS=""; print $3,"-",substr($4,2,length($4)-1) }'`${EXE} + + # Do something only if newer than existing file, or no existing file + diff --git a/debian/patches/36_pcre.dpatch b/debian/patches/36_pcre.dpatch new file mode 100755 index 0000000..0480b95 --- /dev/null +++ b/debian/patches/36_pcre.dpatch @@ -0,0 +1,91 @@ +#! /bin/sh -e +## 36_pcre.dpatch by Andreas Metzler +## +## All lines beginning with `## DP:' are a description of the patch. +## DP: Link exim and eximon dynamically instead of statically +## DP: pcre. + +if [ $# -ne 1 ]; then + echo >&2 "`basename $0`: script expects -patch|-unpatch as argument" + exit 1 +fi +case "$1" in + -patch) patch -f --no-backup-if-mismatch -p1 < $0;; + -unpatch) patch -f --no-backup-if-mismatch -R -p1 < $0;; + *) + echo >&2 "`basename $0`: script expects -patch|-unpatch as argument" + exit 1;; +esac + +exit 0 + +@DPATCH@ +diff -urNad 30.tmp/OS/Makefile-Base 30/OS/Makefile-Base +--- 30.tmp/OS/Makefile-Base Mon Dec 30 10:28:54 2002 ++++ 30/OS/Makefile-Base Mon Dec 30 10:29:28 2002 +@@ -94,7 +94,7 @@ + # This is the real default target for all the various exim binaries and + # scripts, once the configuring stuff is done. + +-allexim: config.h buildpcre $(EXIM_MONITOR) exicyclog exinext exiwhat \ ++allexim: config.h $(EXIM_MONITOR) exicyclog exinext exiwhat \ + exigrep eximstats exiqgrep exiqsumm \ + transport-filter.pl convert4r3 convert4r4 \ + exim_checkaccess \ +@@ -255,7 +255,7 @@ + store.o string.o tls.o tod.o transport.o tree.o verify.o \ + local_scan.o $(EXIM_PERL) + +-exim: pcre/libpcre.a lookups/lookups.a auths/auths.a \ ++exim: lookups/lookups.a auths/auths.a \ + routers/routers.a transports/transports.a \ + $(OBJ_EXIM) version.c + @echo " " +@@ -264,7 +264,7 @@ + $(CC) -c $(CFLAGS) $(INCLUDE) $(IPV6_INCLUDE) $(TLS_INCLUDE) version.c + rm -f exim + $(PURIFY) $(LNCC) -o exim $(LFLAGS) $(OBJ_EXIM) version.o \ +- pcre/libpcre.a \ ++ -lpcre \ + routers/routers.a transports/transports.a lookups/lookups.a \ + auths/auths.a \ + $(LIBRESOLV) $(LIBS) $(LIBS_EXIM) $(IPV6_LIBS) $(EXTRALIBS) \ +@@ -366,12 +366,12 @@ + + OBJ_MONBIN = util-spool_in.o util-store.o util-string.o tod.o tree.o $(MONBIN) + +-eximon.bin: $(EXIMON_EDITME) eximon $(OBJ_MONBIN) pcre/libpcre.a \ ++eximon.bin: $(EXIMON_EDITME) eximon $(OBJ_MONBIN) \ + ../exim_monitor/em_version.c + $(CC) -o em_version.o -c \ + $(CFLAGS) $(XINCLUDE) -I. ../exim_monitor/em_version.c + $(PURIFY) $(LNCC) -o eximon.bin em_version.o $(LFLAGS) $(XLFLAGS) \ +- $(OBJ_MONBIN) -lXaw -lXmu -lXt -lXext -lX11 pcre/libpcre.a \ ++ $(OBJ_MONBIN) -lXaw -lXmu -lXt -lXext -lX11 -lpcre \ + $(LIBS) $(LIBS_EXIMON) $(EXTRALIBS) $(EXTRALIBS_EXIMON) -lc + @if [ x"$(STRIP_COMMAND)" != x"" ]; then \ + echo $(STRIP_COMMAND) eximon.bin; \ +diff -urNad 30.tmp/exim_monitor/em_hdr.h 30/exim_monitor/em_hdr.h +--- 30.tmp/exim_monitor/em_hdr.h Mon Dec 30 10:28:54 2002 ++++ 30/exim_monitor/em_hdr.h Mon Dec 30 10:29:28 2002 +@@ -85,7 +85,7 @@ + + /* Regular expression include */ + +-#include "pcre/pcre.h" ++#include <pcre.h> + + /* Includes from the main source of Exim. We need to have MAXPACKET defined for + the benefit of structs.h. One of these days I should tidy up this interface so +diff -urNad 30.tmp/src/exim.h 30/src/exim.h +--- 30.tmp/src/exim.h Mon Dec 30 10:28:54 2002 ++++ 30/src/exim.h Mon Dec 30 10:29:28 2002 +@@ -322,7 +322,7 @@ + + /* The header from the PCRE regex package */ + +-#include "pcre/pcre.h" ++#include <pcre.h> + + /* Exim includes are in several files */ + diff --git a/debian/patches/40_boolean_redefine_protect.dpatch b/debian/patches/40_boolean_redefine_protect.dpatch new file mode 100644 index 0000000..8523b2c --- /dev/null +++ b/debian/patches/40_boolean_redefine_protect.dpatch @@ -0,0 +1,47 @@ +#! /bin/sh -e +## 40_boolean_redefine_protect.dpatch by Steve Haslam +## +## All lines beginning with `## DP:' are a description of the patch. +## DP: boolean_redefine_protect +## DP: [src/mytypes.h] +## DP: Surround the definition of TRUE and FALSE macros with #ifndef +## DP: /#endif, in case some other header defines them (from mixing +## DP: Perl and Exim, istr) +## DP: http://www.arise.demon.co.uk/exim-patches/ + +if [ $# -ne 1 ]; then + echo >&2 "`basename $0`: script expects -patch|-unpatch as argument" + exit 1 +fi +case "$1" in + -patch) patch -f --no-backup-if-mismatch -p1 < $0;; + -unpatch) patch -f --no-backup-if-mismatch -R -p1 < $0;; + *) + echo >&2 "`basename $0`: script expects -patch|-unpatch as argument" + exit 1;; +esac + +exit 0 + +@DPATCH@ +diff -urNad 40.tmp/src/mytypes.h 40/src/mytypes.h +--- 40.tmp/src/mytypes.h Sun Dec 29 14:31:27 2002 ++++ 40/src/mytypes.h Sun Dec 29 14:40:41 2002 +@@ -14,9 +14,17 @@ + #define MYTYPES_H + + ++#ifndef FALSE + #define FALSE 0 ++#endif ++ ++#ifndef TRUE + #define TRUE 1 ++#endif ++ ++#ifndef TRUE_UNSET + #define TRUE_UNSET 2 ++#endif + + + /* If gcc is being used to compile Exim, we can use its facility for checking diff --git a/debian/patches/50_localscan_dlopen.dpatch b/debian/patches/50_localscan_dlopen.dpatch new file mode 100644 index 0000000..5e9f9d9 --- /dev/null +++ b/debian/patches/50_localscan_dlopen.dpatch @@ -0,0 +1,303 @@ +#! /bin/sh -e +## 50_localscan_dlopen.dpatch by Marc MERLIN +## +## All lines beginning with `## DP:' are a description of the patch. +## DP: Allow to use and switch between different local_scan functions without +## DP: recompiling exim. +## DP: http://marc.merlins.org/linux/exim/files/sa-exim-current/ +## DP: Original patch from David Woodhouse, modified first by Derrick 'dman' +## DP: Hudson and then by Marc MERLIN for SA-Exim and minor/major API version +## DP: tracking + + +if [ $# -ne 1 ]; then + echo >&2 "`basename $0`: script expects -patch|-unpatch as argument" + exit 1 +fi +case "$1" in + -patch) patch -f --no-backup-if-mismatch -p1 < $0;; + -unpatch) patch -f --no-backup-if-mismatch -R -p1 < $0;; + *) + echo >&2 "`basename $0`: script expects -patch|-unpatch as argument" + exit 1;; +esac + +exit 0 + +@DPATCH@ +diff -urN exim-4.14-0/src/EDITME exim-4.14-1/src/EDITME +--- exim-4.14-0/src/EDITME Tue Mar 11 04:20:18 2003 ++++ exim-4.14-1/src/EDITME Sun Mar 23 15:34:15 2003 +@@ -388,6 +388,20 @@ + + + #------------------------------------------------------------------------------ ++# On systems which support dynamic loading of shared libraries, Exim can ++# load a local_scan function specified in its config file instead of having ++# to be recompiled with the desired local_scan function. For a full ++# description of the API to this function, see the Exim specification. ++ ++DLOPEN_LOCAL_SCAN=yes ++ ++# If you set DLOPEN_LOCAL_SCAN, then you need to include -rdynamic in the ++# linker flags. Without it, the loaded .so won't be able to access any ++# functions from exim. ++ ++LFLAGS=-rdynamic ++ ++#------------------------------------------------------------------------------ + # The default distribution of Exim contains only the plain text form of the + # documentation. Other forms are available separately. If you want to install + # the documentation in "info" format, first fetch the Texinfo documentation +diff -urNad 50_localscan_dlopen.tmp/src/config.h.defaults 50_localscan_dlopen/src/config.h.defaults +--- 50_localscan_dlopen.tmp/src/config.h.defaults Sun Dec 29 11:55:42 2002 ++++ 50_localscan_dlopen/src/config.h.defaults Sun Dec 29 11:56:44 2002 +@@ -17,6 +17,8 @@ + #define AUTH_PLAINTEXT + #define AUTH_SPA + ++#define DLOPEN_LOCAL_SCAN ++ + #define BIN_DIRECTORY + + #define CONFIGURE_FILE +diff -urN exim-4.14-0/src/globals.c exim-4.14-1/src/globals.c +--- exim-4.14-0/src/globals.c Tue Mar 11 04:20:20 2003 ++++ exim-4.14-1/src/globals.c Sun Mar 23 15:34:15 2003 +@@ -103,6 +103,9 @@ + uschar *tls_verify_hosts = NULL; + #endif + ++#ifdef DLOPEN_LOCAL_SCAN ++uschar *local_scan_path = NULL; ++#endif + + /* Input-reading functions for messages, so we can use special ones for + incoming TCP/IP. The defaults use stdin. We never need these for any +diff -urN exim-4.14-0/src/globals.h exim-4.14-1/src/globals.h +--- exim-4.14-0/src/globals.h Tue Mar 11 04:20:20 2003 ++++ exim-4.14-1/src/globals.h Sun Mar 23 15:34:15 2003 +@@ -67,6 +67,9 @@ + extern uschar *tls_verify_hosts; /* Mandatory client verification */ + #endif + ++#ifdef DLOPEN_LOCAL_SCAN ++extern uschar *local_scan_path; /* Path to local_scan() library */ ++#endif + + /* Input-reading functions for messages, so we can use special ones for + incoming TCP/IP. */ +diff -urN exim-4.14-0/src/local_scan.c exim-4.14-1/src/local_scan.c +--- exim-4.14-0/src/local_scan.c Tue Mar 11 04:20:20 2003 ++++ exim-4.14-1/src/local_scan.c Sun Mar 23 15:34:15 2003 +@@ -5,60 +5,131 @@ + /* Copyright (c) University of Cambridge 1995 - 2003 */ + /* See the file NOTICE for conditions of use and distribution. */ + ++#include "exim.h" + +-/****************************************************************************** +-This file contains a template local_scan() function that just returns ACCEPT. +-If you want to implement your own version, you should copy this file to, say +-Local/local_scan.c, and edit the copy. To use your version instead of the +-default, you must set +- +-LOCAL_SCAN_SOURCE=Local/local_scan.c +- +-in your Local/Makefile. This makes it easy to copy your version for use with +-subsequent Exim releases. +- +-For a full description of the API to this function, see the Exim specification. +-******************************************************************************/ +- +- +-/* This is the only Exim header that you should include. The effect of +-including any other Exim header is not defined, and may change from release to +-release. Use only the documented interface! */ +- +-#include "local_scan.h" +- +- +-/* This is a "do-nothing" version of a local_scan() function. The arguments +-are: +- +- fd The file descriptor of the open -D file, which contains the +- body of the message. The file is open for reading and +- writing, but modifying it is dangerous and not recommended. +- +- return_text A pointer to an unsigned char* variable which you can set in +- order to return a text string. It is initialized to NULL. +- +-The return values of this function are: +- +- LOCAL_SCAN_ACCEPT +- The message is to be accepted. The return_text argument is +- saved in $local_scan_data. +- +- LOCAL_SCAN_REJECT +- The message is to be rejected. The returned text is used +- in the rejection message. +- +- LOCAL_SCAN_TEMPREJECT +- This specifies a temporary rejection. The returned text +- is used in the rejection message. +-*/ ++#ifdef DLOPEN_LOCAL_SCAN ++#include <dlfcn.h> ++static int (*local_scan_fn)(int fd, uschar **return_text) = NULL; ++static int load_local_scan_library(void); ++#endif + + int + local_scan(int fd, uschar **return_text) + { + fd = fd; /* Keep picky compilers happy */ + return_text = return_text; +-return LOCAL_SCAN_ACCEPT; ++#ifdef DLOPEN_LOCAL_SCAN ++/* local_scan_path is defined AND not the empty string */ ++if (local_scan_path && *local_scan_path) ++ { ++ if (!local_scan_fn) ++ { ++ if (!load_local_scan_library()) ++ { ++ char *base_msg , *error_msg , *final_msg ; ++ int final_length = -1 ; ++ ++ base_msg=US"Local configuration error - local_scan() library failure\n"; ++ error_msg = dlerror() ; ++ ++ final_length = strlen(base_msg) + strlen(error_msg) + 1 ; ++ final_msg = (char*)malloc( final_length*sizeof(char) ) ; ++ *final_msg = '\0' ; ++ ++ strcat( final_msg , base_msg ) ; ++ strcat( final_msg , error_msg ) ; ++ ++ *return_text = final_msg ; ++ return LOCAL_SCAN_TEMPREJECT; ++ } ++ } ++ return local_scan_fn(fd, return_text); ++ } ++else ++#endif ++ return LOCAL_SCAN_ACCEPT; ++} ++ ++#ifdef DLOPEN_LOCAL_SCAN ++ ++static int load_local_scan_library(void) ++{ ++/* No point in keeping local_scan_lib since we'll never dlclose() anyway */ ++void *local_scan_lib = NULL; ++int (*local_scan_version_fn)(void); ++int vers_maj; ++int vers_min; ++ ++local_scan_lib = dlopen(local_scan_path, RTLD_NOW); ++if (!local_scan_lib) ++ { ++ log_write(0, LOG_MAIN|LOG_REJECT, "local_scan() library open failed - " ++ "message temporarily rejected"); ++ return FALSE; ++ } ++ ++local_scan_version_fn = dlsym(local_scan_lib, "local_scan_version_major"); ++if (!local_scan_version_fn) ++ { ++ dlclose(local_scan_lib); ++ log_write(0, LOG_MAIN|LOG_REJECT, "local_scan() library doesn't contain " ++ "local_scan_version_major() function - message temporarily rejected"); ++ return FALSE; ++ } ++ ++/* The major number is increased when the ABI is changed in a non ++ backward compatible way. */ ++vers_maj = local_scan_version_fn(); ++ ++local_scan_version_fn = dlsym(local_scan_lib, "local_scan_version_minor"); ++if (!local_scan_version_fn) ++ { ++ dlclose(local_scan_lib); ++ log_write(0, LOG_MAIN|LOG_REJECT, "local_scan() library doesn't contain " ++ "local_scan_version_minor() function - message temporarily rejected"); ++ return FALSE; ++ } ++ ++/* The minor number is increased each time a new feature is added (in a ++ way that doesn't break backward compatibility) -- Marc */ ++vers_min = local_scan_version_fn(); ++ ++ ++if (vers_maj != LOCAL_SCAN_ABI_VERSION_MAJOR) ++ { ++ dlclose(local_scan_lib); ++ local_scan_lib = NULL; ++ log_write(0, LOG_MAIN|LOG_REJECT, "local_scan() has an incompatible major" ++ "version number, you need to recompile your module for this version" ++ "of exim (The module was compiled for version %d.%d and this exim provides" ++ "ABI version %d.%d)", vers_maj, vers_min, LOCAL_SCAN_ABI_VERSION_MAJOR, ++ LOCAL_SCAN_ABI_VERSION_MINOR); ++ return FALSE; ++ } ++else if (vers_min > LOCAL_SCAN_ABI_VERSION_MINOR) ++ { ++ dlclose(local_scan_lib); ++ local_scan_lib = NULL; ++ log_write(0, LOG_MAIN|LOG_REJECT, "local_scan() has an incompatible minor" ++ "version number, you need to recompile your module for this version" ++ "of exim (The module was compiled for version %d.%d and this exim provides" ++ "ABI version %d.%d)", vers_maj, vers_min, LOCAL_SCAN_ABI_VERSION_MAJOR, ++ LOCAL_SCAN_ABI_VERSION_MINOR); ++ return FALSE; ++ } ++ ++local_scan_fn = dlsym(local_scan_lib, "local_scan"); ++if (!local_scan_fn) ++ { ++ dlclose(local_scan_lib); ++ log_write(0, LOG_MAIN|LOG_REJECT, "local_scan() library doesn't contain " ++ "local_scan() function - message temporarily rejected"); ++ return FALSE; ++ } ++ ++return TRUE; + } ++ ++#endif /* DLOPEN_LOCAL_SCAN */ + + /* End of local_scan.c */ +diff -urN exim-4.14-0/src/local_scan.h exim-4.14-1/src/local_scan.h +--- exim-4.14-0/src/local_scan.h Tue Mar 11 04:20:20 2003 ++++ exim-4.14-1/src/local_scan.h Sun Mar 23 15:34:57 2003 +@@ -71,6 +71,15 @@ + + #define SPOOL_DATA_START_OFFSET (MESSAGE_ID_LENGTH+3) + ++/* local_scan() ABI version number for dynamic libraries ++ The major number is increased when the ABI is changed in a non ++ backward compatible way. ++ The minor number is increased each time a new feature is added (in a ++ way that doesn't break backward compatibility) -- Marc */ ++#define LOCAL_SCAN_ABI_VERSION_MAJOR 1 ++#define LOCAL_SCAN_ABI_VERSION_MINOR 0 ++#define LOCAL_SCAN_ABI_VERSION \ ++ LOCAL_SCAN_ABI_VERSION_MAJOR.LOCAL_SCAN_ABI_VERSION_MINOR + + /* Structure definitions that are documented as visible in the function. */ + +diff -urN exim-4.14-0/src/readconf.c exim-4.14-1/src/readconf.c +--- exim-4.14-0/src/readconf.c Tue Mar 11 04:20:22 2003 ++++ exim-4.14-1/src/readconf.c Sun Mar 23 15:34:15 2003 +@@ -182,6 +182,9 @@ + { "local_from_prefix", opt_stringptr, &local_from_prefix }, + { "local_from_suffix", opt_stringptr, &local_from_suffix }, + { "local_interfaces", opt_stringptr, &local_interfaces }, ++#ifdef DLOPEN_LOCAL_SCAN ++ { "local_scan_path", opt_stringptr, &local_scan_path }, ++#endif + { "local_scan_timeout", opt_time, &local_scan_timeout }, + { "local_sender_retain", opt_bool, &local_sender_retain }, + { "localhost_number", opt_stringptr, &host_number_string }, |