Compiler quietening
[exim.git] / src / src / rewrite.c
index f2a7ff273ae859e88950a6c44f9dc34bf92590b9..172f868374ef834390755b3b8e6a48bff17ccff7 100644 (file)
@@ -2,7 +2,7 @@
 *     Exim - an Internet mail transport agent    *
 *************************************************/
 
-/* Copyright (c) University of Cambridge 1995 - 2015 */
+/* Copyright (c) University of Cambridge 1995 - 2018 */
 /* See the file NOTICE for conditions of use and distribution. */
 
 /* Functions concerned with rewriting headers */
@@ -206,22 +206,7 @@ for (rule = rewrite_rules;
     if (expand_string_forcedfail)
       { if ((rule->flags & rewrite_quit) != 0) break; else continue; }
 
-    /* Avoid potentially exposing a password */
-
-    if (  (  Ustrstr(expand_string_message, "failed to expand") != NULL
-         || Ustrstr(expand_string_message, "expansion of ")    != NULL
-         )
-       && (  Ustrstr(expand_string_message, "mysql")   != NULL
-         || Ustrstr(expand_string_message, "pgsql")   != NULL
-         || Ustrstr(expand_string_message, "redis")   != NULL
-         || Ustrstr(expand_string_message, "sqlite")  != NULL
-         || Ustrstr(expand_string_message, "ldap:")   != NULL
-         || Ustrstr(expand_string_message, "ldaps:")  != NULL
-         || Ustrstr(expand_string_message, "ldapi:")  != NULL
-         || Ustrstr(expand_string_message, "ldapdn:") != NULL
-         || Ustrstr(expand_string_message, "ldapm:")  != NULL
-       )  )
-      expand_string_message = US"Temporary internal error";
+    expand_string_message = expand_hide_passwords(expand_string_message);
 
     log_write(0, LOG_MAIN|LOG_PANIC, "Expansion of %s failed while rewriting: "
       "%s", rule->replacement, expand_string_message);
@@ -324,7 +309,7 @@ for (rule = rewrite_rules;
 
         start = Ustrlen(pf1) + start + new - p1;
         end = start + Ustrlen(newparsed);
-        new = string_sprintf("%s%.*s%s", pf1, p2 - p1, p1, pf2);
+        new = string_sprintf("%s%.*s%s", pf1, (int)(p2 - p1), p1, pf2);
         }
 
       /* Now accept the whole thing */