summaryrefslogtreecommitdiff
path: root/debian/patches/80_4.74_deliverylogging.dpatch
blob: e9e9794dcc28485923d2a310ec303eddd0f1568d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
#! /bin/sh /usr/share/dpatch/dpatch-run
## 80_4.74_deliverylogging.dpatch by  Phil Pennock <pdp@exim.org>
##
## All lines beginning with `## DP:' are a description of the patch.
## DP: Bug 1071: fix delivery logging with untrusted macros.
## DP: 
## DP: If dropping privileges for untrusted macros, we disabled normal logging
## DP: on the basis that it would fail; for the Exim run-time user, this is not
## DP: the case, and it resulted in successful deliveries going unlogged.
## DP: b7487bcec431809cb7fc3c2b42fcd607e43d37e7

@DPATCH@
diff -urNad '--exclude=CVS' '--exclude=.svn' '--exclude=.git' '--exclude=.arch' '--exclude=.hg' '--exclude=_darcs' '--exclude=.bzr' exim-4.69~/build-tree/src/exim.c exim-4.69/build-tree/src/exim.c
--- exim-4.69~/build-tree/src/exim.c	2011-01-24 19:21:00.000000000 +0100
+++ exim-4.69/build-tree/src/exim.c	2011-01-24 19:21:50.000000000 +0100
@@ -3418,9 +3418,13 @@
   and should be used for any logging information because attempts to write
   to the log will usually fail. To arrange this, we unset really_exim. However,
   if no stderr is available there is no point - we might as well have a go
-  at the log (if it fails, syslog will be written). */
+  at the log (if it fails, syslog will be written).
 
-  if (log_stderr != NULL) really_exim = FALSE;
+  Note that if the invoker is Exim, the logs remain available. Messing with
+  this causes unlogged successful deliveries.  */
+
+  if ((log_stderr != NULL) && (real_uid != exim_uid))
+    really_exim = FALSE;
   }
 
 /* Privilege is to be retained for the moment. It may be dropped later,