Copyright updates:
[exim.git] / src / src / readconf.c
index 907ffeb71b87f7b16624c48866df31ea89e9b29f..06bc50fd88a5e8e946c5b1a10cc87bf3f9c25d6f 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 - 2018 */
-/* Copyright (c) The Exim Maintainers 2020 - 2021 */
 /* See the file NOTICE for conditions of use and distribution. */
 
 /* Functions for reading the configuration file, and for displaying
@@ -68,9 +68,6 @@ static optionlist optionlist_config[] = {
   { "add_environment",          opt_stringptr,   {&add_environment} },
   { "admin_groups",             opt_gidlist,     {&admin_groups} },
   { "allow_domain_literals",    opt_bool,        {&allow_domain_literals} },
-#ifdef ALLOW_INSECURE_TAINTED_DATA
-  { "allow_insecure_tainted_data", opt_bool,     {&allow_insecure_tainted_data} },
-#endif
   { "allow_mx_to_ip",           opt_bool,        {&allow_mx_to_ip} },
   { "allow_utf8_domains",       opt_bool,        {&allow_utf8_domains} },
   { "auth_advertise_hosts",     opt_stringptr,   {&auth_advertise_hosts} },
@@ -348,15 +345,6 @@ static optionlist optionlist_config[] = {
 #ifdef LOOKUP_SQLITE
   { "sqlite_dbfile",            opt_stringptr,   {&sqlite_dbfile} },
   { "sqlite_lock_timeout",      opt_int,         {&sqlite_lock_timeout} },
-#endif
-#ifdef EXPERIMENTAL_SRS_ALT
-  { "srs_config",               opt_stringptr,   {&srs_config} },
-  { "srs_hashlength",           opt_int,         {&srs_hashlength} },
-  { "srs_hashmin",              opt_int,         {&srs_hashmin} },
-  { "srs_maxage",               opt_int,         {&srs_maxage} },
-  { "srs_secrets",              opt_stringptr,   {&srs_secrets} },
-  { "srs_usehash",              opt_bool,        {&srs_usehash} },
-  { "srs_usetimestamp",         opt_bool,        {&srs_usetimestamp} },
 #endif
   { "strict_acl_vars",          opt_bool,        {&strict_acl_vars} },
   { "strip_excess_angle_brackets", opt_bool,     {&strip_excess_angle_brackets} },
@@ -658,7 +646,7 @@ Args:
 macro_item *
 macro_create(const uschar * name, const uschar * val, BOOL command_line)
 {
-macro_item * m = store_get(sizeof(macro_item), FALSE);
+macro_item * m = store_get(sizeof(macro_item), GET_UNTAINTED);
 
 READCONF_DEBUG fprintf(stderr, "%s: '%s' '%s'\n", __FUNCTION__, name, val);
 m->next = NULL;
@@ -1088,7 +1076,7 @@ for (;;)
 
     if (config_lines)
       save_config_position(config_filename, config_lineno);
-    save = store_get(sizeof(config_file_item), FALSE);
+    save = store_get(sizeof(config_file_item), GET_UNTAINTED);
     save->next = config_file_stack;
     config_file_stack = save;
     save->file = config_file;
@@ -1437,7 +1425,7 @@ Returns:      the control block for the parsed rule.
 static rewrite_rule *
 readconf_one_rewrite(const uschar *p, int *existflags, BOOL isglobal)
 {
-rewrite_rule *next = store_get(sizeof(rewrite_rule), FALSE);
+rewrite_rule * next = store_get(sizeof(rewrite_rule), GET_UNTAINTED);
 
 next->next = NULL;
 next->key = string_dequote(&p);
@@ -3033,7 +3021,7 @@ if (*numberp >= max)
 Uskip_whitespace(&s);
 ss = s;
 while (isalnum(*s) || *s == '_') s++;
-t = store_get(sizeof(tree_node) + s-ss, is_tainted(ss));
+t = store_get(sizeof(tree_node) + s-ss, ss);
 Ustrncpy(t->name, ss, s-ss);
 t->name[s-ss] = 0;
 Uskip_whitespace(&s);
@@ -3291,7 +3279,7 @@ if (f.trusted_config && Ustrcmp(filename, US"/dev/null"))
   if (statbuf.st_size > 8192)
     {
     rmark r = store_mark();
-    void * dummy = store_get((int)statbuf.st_size, FALSE);
+    void * dummy = store_get((int)statbuf.st_size, GET_UNTAINTED);
     store_reset(r);
     }
   }
@@ -3781,6 +3769,8 @@ while ((buffer = get_config_line()))
     *p = d;
     p = &d->next;
     d->name = string_copy(name);
+    d->srcfile = config_filename;
+    d->srcline = config_lineno; 
 
     /* Clear out the "set" bits in the generic options */
 
@@ -4068,7 +4058,7 @@ while ((p = get_config_line()))
   const uschar *pp;
   uschar *error;
 
-  next = store_get(sizeof(retry_config), FALSE);
+  next = store_get(sizeof(retry_config), GET_UNTAINTED);
   next->next = NULL;
   *chain = next;
   chain = &(next->next);
@@ -4112,7 +4102,7 @@ while ((p = get_config_line()))
 
   while (*p)
     {
-    retry_rule *rule = store_get(sizeof(retry_rule), FALSE);
+    retry_rule * rule = store_get(sizeof(retry_rule), GET_UNTAINTED);
     *rchain = rule;
     rchain = &(rule->next);
     rule->next = NULL;
@@ -4206,6 +4196,18 @@ f.smtp_in_early_pipe_no_auth = nauths > 16;
 }
 
 
+/* For error messages, a string describing the config location associated
+with current processing.  NULL if we are not in an authenticator. */
+
+uschar *
+authenticator_current_name(void)
+{
+if (!authenticator_name) return NULL;
+return string_sprintf(" (authenticator %s, %s %d)", authenticator_name, driver_srcfile, driver_srcline);
+}
+
+
+
 
 
 /*************************************************
@@ -4262,7 +4264,7 @@ while(acl_line)
   if (*p != ':' || name[0] == 0)
     log_write(0, LOG_PANIC_DIE|LOG_CONFIG_IN, "missing or malformed ACL name");
 
-  node = store_get_perm(sizeof(tree_node) + Ustrlen(name), is_tainted(name));
+  node = store_get_perm(sizeof(tree_node) + Ustrlen(name), name);
   Ustrcpy(node->name, name);
   if (!tree_insertnode(&acl_anchor, node))
     log_write(0, LOG_PANIC_DIE|LOG_CONFIG_IN,
@@ -4407,7 +4409,7 @@ save_config_line(const uschar* line)
 static config_line_item *current;
 config_line_item *next;
 
-next = (config_line_item*) store_get(sizeof(config_line_item), FALSE);
+next = (config_line_item*) store_get(sizeof(config_line_item), GET_UNTAINTED);
 next->line = string_copy(line);
 next->next = NULL;