Tidying: explicit (de)tainting copies
authorJeremy Harris <jgh146exb@wizmail.org>
Sat, 19 Mar 2022 19:11:17 +0000 (19:11 +0000)
committerJeremy Harris <jgh146exb@wizmail.org>
Mon, 28 Mar 2022 11:33:18 +0000 (12:33 +0100)
src/src/dmarc.c
src/src/exim.c
src/src/lookups/dsearch.c
src/src/route.c
src/src/search.c
src/src/spool_out.c
src/src/transports/appendfile.c
src/src/verify.c

index f1b18bd59976935a8ee637cb749fd79d85c74890..1bbaa7718daec0c900abde0d4ed88b3e0aff525f 100644 (file)
@@ -231,7 +231,7 @@ if (rc == DNS_SUCCEED)
     if (rr->type == T_TXT && rr->size > 3)
       {
       store_free_dns_answer(dnsa);
-      return string_copyn_taint(US rr->data, rr->size, TRUE);
+      return string_copyn_taint(US rr->data, rr->size, GET_TAINTED);
       }
 store_free_dns_answer(dnsa);
 return NULL;
index ade96fe206736d72fa39e00e7adfcd20161abd8d..40955a9da1c9449839a5d7f94a57b0830cb1176d 100644 (file)
@@ -5262,7 +5262,7 @@ if (expansion_test)
     message_id = US exim_str_fail_toolong(argv[msg_action_arg], MESSAGE_ID_LENGTH, "message-id");
     /* Checking the length of the ID is sufficient to validate it.
     Get an untainted version so file opens can be done. */
-    message_id = string_copy_taint(message_id, FALSE);
+    message_id = string_copy_taint(message_id, GET_UNTAINTED);
 
     spoolname = string_sprintf("%s-H", message_id);
     if ((deliver_datafile = spool_open_datafile(message_id)) < 0)
index 80000f14a3575e2ff92cb34045182961e386ef55..2c4f13426d563633d6dd5d6b0d182633c4b38711 100644 (file)
@@ -124,7 +124,7 @@ if (  Ulstat(filename, &statbuf) >= 0
   {
   /* Since the filename exists in the filesystem, we can return a
   non-tainted result. */
-  *result = string_copy_taint(flags & RET_FULL ? filename : keystring, FALSE);
+  *result = string_copy_taint(flags & RET_FULL ? filename : keystring, GET_UNTAINTED);
   return OK;
   }
 
index ae04c7917a648128e27af8e8caee98cd1ca2a37b..74a7922587a510f7b83038b62862cfa7a708afde 100644 (file)
@@ -1670,7 +1670,7 @@ for (r = addr->start_router ? addr->start_router : routers; r; r = nextr)
        addr->prefix_v = string_copyn(addr->local_part, vlen);
        }
       else
-       addr->prefix = string_copyn_taint(addr->local_part, plen, FALSE);
+       addr->prefix = string_copyn_taint(addr->local_part, plen, GET_UNTAINTED);
       addr->local_part += plen;
       DEBUG(D_route) debug_printf("stripped prefix %s\n", addr->prefix);
       }
index 979dae739638946d5e5686a8381442b371010c76..bf709763c730ef68c8e487c59fb42ad40e07a6dd 100644 (file)
@@ -959,7 +959,7 @@ than the result.  Return a de-tainted version of the key on the grounds that
 it have been validated by the lookup. */
 
 if (yield && ret_key)
-  yield = string_copy_taint(keystring, FALSE);
+  yield = string_copy_taint(keystring, GET_UNTAINTED);
 
 return yield;
 }
index d5cad86d48f8cc918f76fa0a54f5e75b283905e9..bfa935eb060665399125278979cf153301bda5e7 100644 (file)
@@ -529,7 +529,7 @@ spool_move_message(uschar *id, uschar *subdir, uschar *from, uschar *to)
 uschar * dest_qname = queue_name_dest ? queue_name_dest : queue_name;
 
 /* Since we are working within the spool, de-taint the dest queue name */
-dest_qname = string_copy_taint(dest_qname, FALSE);
+dest_qname = string_copy_taint(dest_qname, GET_UNTAINTED);
 
 /* Create any output directories that do not exist. */
 
index 43fe883f6a064ecedcac290a70d99038f0d3100b..77115acc7ae3aa335e77b2d502676fe7c121ce81 100644 (file)
@@ -1347,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;
@@ -2186,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;
index 12e39d6038760f85fce47c567d2a46fb14314f5d..d1c4af275b5f15bfe6538fe0a3a680d4c99a705f 100644 (file)
@@ -3546,13 +3546,13 @@ else
     if (n > 4)
       save_errno = (buf[1] << 24) | (buf[2] << 16) | (buf[3] << 8) | buf[4];
     if ((recipient_verify_failure = n > 5
-       ? string_copyn_taint(buf+5, n-5, FALSE) : NULL))
+       ? string_copyn_taint(buf+5, n-5, GET_UNTAINTED) : NULL))
       {
       int m;
       s = buf + 5 + Ustrlen(recipient_verify_failure) + 1;
       m = n - (s - buf);
       acl_verify_message = *msg =
-       m > 0 ? string_copyn_taint(s, m, FALSE) : NULL;
+       m > 0 ? string_copyn_taint(s, m, GET_UNTAINTED) : NULL;
       }
 
     DEBUG(D_verify) debug_printf_indent("verify call response:"