Workround compile error with old PCRE versions
[exim.git] / src / src / exim.c
index c8a5da12a70ae6cbbeb46eb0ca5657487e407926..b3035ca7c7f918acb2938f03a1c324e09dd894d9 100644 (file)
@@ -931,8 +931,13 @@ DEBUG(D_any) do {
              "                       Runtime: %s\n",
           PCRE_MAJOR, PCRE_MINOR,
           /* PRE_PRERELEASE is either defined and empty or a string.
-           * This should work: */
+           * unless its an ancient version of PCRE in which case it
+           * is not defined */
+#ifdef PCRE_PRERELEASE
           PCRE_PRERELEASE "",
+#else
+          "",
+#endif
           pcre_version());
 
   init_lookup_list();
@@ -942,6 +947,17 @@ DEBUG(D_any) do {
       lookup_list[i]->version_report(f);
     }
 
+#ifdef WHITELIST_D_MACROS
+  fprintf(f, "WHITELIST_D_MACROS: \"%s\"\n", WHITELIST_D_MACROS);
+#else
+  fprintf(f, "WHITELIST_D_MACROS unset\n");
+#endif
+#ifdef TRUSTED_CONFIG_LIST
+  fprintf(f, "TRUSTED_CONFIG_LIST: \"%s\"\n", TRUSTED_CONFIG_LIST);
+#else
+  fprintf(f, "TRUSTED_CONFIG_LIST unset\n");
+#endif
+
 } while (0);
 }
 
@@ -3327,9 +3343,13 @@ if ((                                            /* EITHER */
   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).
+
+  Note that if the invoker is Exim, the logs remain available. Messing with
+  this causes unlogged successful deliveries.  */
 
-  if (log_stderr != NULL) really_exim = FALSE;
+  if ((log_stderr != NULL) && (real_uid != exim_uid))
+    really_exim = FALSE;
   }
 
 /* Privilege is to be retained for the moment. It may be dropped later,