Copyright updates:
[exim.git] / src / src / transports / appendfile.c
index bbd4a161f23952b5c474c3c2915c2c5d72d80fc1..93281efdab245b5f65d39919785a201fff356bc6 100644 (file)
@@ -2,8 +2,8 @@
 *     Exim - an Internet mail transport agent    *
 *************************************************/
 
+/* Copyright (c) The Exim maintainers 2020 - 2022 */
 /* Copyright (c) University of Cambridge 1995 - 2020 */
-/* Copyright (c) The Exim maintainers 2020 */
 /* See the file NOTICE for conditions of use and distribution. */
 
 
@@ -174,9 +174,6 @@ Arguments:
 Returns:     OK, FAIL, or DEFER
 */
 
-void
-open_logs(void);
-
 static int
 appendfile_transport_setup(transport_instance *tblock, address_item *addrlist,
   transport_feedback *dummy, uid_t uid, gid_t gid, uschar **errmsg)
@@ -186,14 +183,6 @@ appendfile_transport_options_block *ob =
 uschar *q = ob->quota;
 double default_value = 0.0;
 
-addrlist = addrlist;    /* Keep picky compilers happy */
-dummy = dummy;
-uid = uid;
-gid = gid;
-
-/* we can't wait until we're not privileged anymore */
-open_logs();
-
 if (ob->expand_maildir_use_size_file)
        ob->maildir_use_size_file = expand_check_condition(ob->expand_maildir_use_size_file,
                US"`maildir_use_size_file` in transport", tblock->name);
@@ -435,7 +424,7 @@ if ((s = ob->create_file_string ) && *s)
   else if (Ustrcmp(s, "inhome") == 0)                  val = create_inhome;
   else
     log_write(0, LOG_PANIC_DIE|LOG_CONFIG,
-      "invalid value given for \"file_create\" for the %s transport: '%s'",
+      "invalid value given for \"create_file\" for the %s transport: '%s'",
       tblock->name, s);
   ob->create_file = val;
   }
@@ -1358,7 +1347,7 @@ if (!isdirectory)
     if (is_tainted(path))
       {
       DEBUG(D_transport) debug_printf("de-tainting path '%s'\n", path);
-      path = string_copy_taint(path, FALSE);
+      path = string_copy_taint(path, GET_UNTAINTED);
       }
 
   if (is_tainted(path)) goto tainted_ret_panic;
@@ -2197,7 +2186,7 @@ else
     if (ob->create_file == create_belowhome)
       {
       DEBUG(D_transport) debug_printf("de-tainting path '%s'\n", path);
-      path = string_copy_taint(path, FALSE);
+      path = string_copy_taint(path, GET_UNTAINTED);
       }
     else
       goto tainted_ret_panic;
@@ -2235,7 +2224,7 @@ else
        uschar errbuf[128];
        pcre2_get_error_message(err, errbuf, sizeof(errbuf));
         addr->message = string_sprintf("appendfile: regular expression "
-          "error: %s at offset %l while compiling %s", errbuf, (long)offset,
+          "error: %s at offset %ld while compiling %s", errbuf, (long)offset,
           ob->quota_size_regex);
         return FALSE;
         }
@@ -2324,7 +2313,7 @@ else
        uschar errbuf[128];
        pcre2_get_error_message(err, errbuf, sizeof(errbuf));
         addr->message = string_sprintf("appendfile: regular expression "
-          "error: %s at offset %l while compiling %s", errbuf, (long)offset,
+          "error: %s at offset %ld while compiling %s", errbuf, (long)offset,
           ob->maildir_dir_regex);
         return FALSE;
         }
@@ -3202,7 +3191,7 @@ else
           uschar *iptr = expand_string(nametag);
           if (iptr)
             {
-            uschar *etag = store_get(Ustrlen(iptr) + 2, is_tainted(iptr));
+            uschar *etag = store_get(Ustrlen(iptr) + 2, iptr);
             uschar *optr = etag;
             for ( ; *iptr; iptr++)
               if (mac_isgraph(*iptr) && *iptr != '/')