Debug: build a summary string tracking transport SMTP commands & responses
[exim.git] / src / src / drtables.c
index 67a2b8f52ec7679222a90aa74feeb5a1803758b3..39f58f803cb42ac04ff48b2d6caf572af5280aca 100644 (file)
@@ -3,7 +3,7 @@
 *************************************************/
 
 /* Copyright (c) University of Cambridge 1995 - 2018 */
-/* Copyright (c) The Exim Maintainers 2020 */
+/* Copyright (c) The Exim Maintainers 2020 - 2021 */
 /* See the file NOTICE for conditions of use and distribution. */
 
 
@@ -518,7 +518,7 @@ static struct lookupmodulestr *lookupmodules = NULL;
 static void
 addlookupmodule(void *dl, struct lookup_module_info *info)
 {
-struct lookupmodulestr *p = store_get(sizeof(struct lookupmodulestr), FALSE);
+struct lookupmodulestr *p = store_get(sizeof(struct lookupmodulestr), GET_UNTAINTED);
 
 p->dl = dl;
 p->info = info;
@@ -728,15 +728,15 @@ if (!(dd = exim_opendir(LOOKUP_MODULE_DIR)))
   }
 else
   {
-  const pcre *regex_islookupmod = regex_must_compile(
+  const pcre2_code *regex_islookupmod = regex_must_compile(
     US"\\." DYNLIB_FN_EXT "$", FALSE, TRUE);
 
   DEBUG(D_lookup) debug_printf("Loading lookup modules from %s\n", LOOKUP_MODULE_DIR);
   while ((ent = readdir(dd)))
     {
-    char *name = ent->d_name;
+    char * name = ent->d_name;
     int len = (int)strlen(name);
-    if (pcre_exec(regex_islookupmod, NULL, name, len, 0, PCRE_EOPT, NULL, 0) >= 0)
+    if (regex_match(regex_islookupmod, US name, len, NUL))
       {
       int pathnamelen = len + (int)strlen(LOOKUP_MODULE_DIR) + 2;
       void *dl;
@@ -764,10 +764,10 @@ else
        }
 
       /* FreeBSD nsdispatch() can trigger dlerror() errors about
-       * _nss_cache_cycle_prevention_function; we need to clear the dlerror()
-       * state before calling dlsym(), so that any error afterwards only
-       * comes from dlsym().
-       */
+      _nss_cache_cycle_prevention_function; we need to clear the dlerror()
+      state before calling dlsym(), so that any error afterwards only comes
+      from dlsym().  */
+
       errormsg = dlerror();
 
       info = (struct lookup_module_info*) dlsym(dl, "_lookup_module_info");