EXPERIMENTAL_DCC: make build without WITH_CONTENT_SCAN fail
authorJeremy Harris <jgh146exb@wizmail.org>
Fri, 2 Sep 2022 10:15:33 +0000 (11:15 +0100)
committerJeremy Harris <jgh146exb@wizmail.org>
Fri, 2 Sep 2022 10:18:51 +0000 (11:18 +0100)
rather than auto-include the support

src/src/EDITME
src/src/acl.c
src/src/buildconfig.c
src/src/dcc.c

index 3c33dc5f30f2cff0b8da79aecdedb4224b7590b3..80bd078170793d4aea3d43ccc958d5500ea6e82e 100644 (file)
@@ -596,7 +596,7 @@ DISABLE_MAL_MKS=yes
 
 # Uncomment the following line to add support for talking to dccifd.  This
 # defaults the socket path to /usr/local/dcc/var/dccifd.
-# Doing so will also explicitly turn on the WITH_CONTENT_SCAN option.
+# This support also requires WITH_CONTENT_SCAN enabled.
 
 # EXPERIMENTAL_DCC=yes
 
index 3af3a4eee7d67b3757abed2c44ae18e11ff6dee4..1e7d28a907d4857f1df27b32c8f8f65e2fa9cbcb 100644 (file)
@@ -3125,12 +3125,9 @@ acl_check_condition(int verb, acl_condition_block *cb, int where,
   address_item *addr, int level, BOOL *epp, uschar **user_msgptr,
   uschar **log_msgptr, int *basic_errno)
 {
-uschar *user_message = NULL;
-uschar *log_message = NULL;
+uschar * user_message = NULL;
+uschar * log_message = NULL;
 int rc = OK;
-#ifdef WITH_CONTENT_SCAN
-int sep = -'/';
-#endif
 
 for (; cb; cb = cb->next)
   {
@@ -3646,12 +3643,13 @@ for (; cb; cb = cb->next)
       break;
       }
 
-    #ifdef EXPERIMENTAL_DCC
+#ifdef EXPERIMENTAL_DCC
     case ACLC_DCC:
       {
       /* Separate the regular expression and any optional parameters. */
       const uschar * list = arg;
-      uschar *ss = string_nextinlist(&list, &sep, NULL, 0);
+      int sep = -'/';
+      uschar * ss = string_nextinlist(&list, &sep, NULL, 0);
       /* Run the dcc backend. */
       rc = dcc_process(&ss);
       /* Modify return code based upon the existence of options. */
@@ -3660,13 +3658,13 @@ for (; cb; cb = cb->next)
           rc = FAIL;   /* FAIL so that the message is passed to the next ACL */
       break;
       }
-    #endif
+#endif
 
-    #ifdef WITH_CONTENT_SCAN
+#ifdef WITH_CONTENT_SCAN
     case ACLC_DECODE:
       rc = mime_decode(&arg);
       break;
-    #endif
+#endif
 
     case ACLC_DELAY:
       {
@@ -3813,11 +3811,10 @@ for (; cb; cb = cb->next)
 
     case ACLC_LOG_REJECT_TARGET:
       {
-      int logbits = 0;
-      int sep = 0;
-      const uschar *s = arg;
-      uschar * ss;
-      while ((ss = string_nextinlist(&s, &sep, NULL, 0)))
+      int logbits = 0, sep = 0;
+      const uschar * s = arg;
+
+      for (uschar * ss; ss = string_nextinlist(&s, &sep, NULL, 0); )
         {
         if (Ustrcmp(ss, "main") == 0) logbits |= LOG_MAIN;
         else if (Ustrcmp(ss, "panic") == 0) logbits |= LOG_PANIC;
@@ -3865,17 +3862,16 @@ for (; cb; cb = cb->next)
       break;
       }
 
-    #ifdef WITH_CONTENT_SCAN
+#ifdef WITH_CONTENT_SCAN
     case ACLC_MALWARE:                 /* Run the malware backend. */
       {
       /* Separate the regular expression and any optional parameters. */
       const uschar * list = arg;
-      uschar * ss = string_nextinlist(&list, &sep, NULL, 0);
-      uschar * opt;
       BOOL defer_ok = FALSE;
-      int timeout = 0;
+      int timeout = 0, sep = -'/';
+      uschar * ss = string_nextinlist(&list, &sep, NULL, 0);
 
-      while ((opt = string_nextinlist(&list, &sep, NULL, 0)))
+      for (uschar * opt; opt = string_nextinlist(&list, &sep, NULL, 0); )
         if (strcmpic(opt, US"defer_ok") == 0)
          defer_ok = TRUE;
        else if (  strncmpic(opt, US"tmo=", 4) == 0
@@ -3895,7 +3891,7 @@ for (; cb; cb = cb->next)
     case ACLC_MIME_REGEX:
       rc = mime_regex(&arg, textonly);
       break;
-    #endif
+#endif
 
     case ACLC_QUEUE:
       if (is_tainted(arg))
@@ -3979,7 +3975,8 @@ for (; cb; cb = cb->next)
       {
       /* Separate the regular expression and any optional parameters. */
       const uschar * list = arg;
-      uschar *ss = string_nextinlist(&list, &sep, NULL, 0);
+      int sep = -'/';
+      uschar * ss = string_nextinlist(&list, &sep, NULL, 0);
 
       rc = spam(CUSS &ss);
       /* Modify return code based upon the existence of options. */
index f9a8febdf31af41e8fcff06077c350c81aaebfb5..bbbaefe9c4e16dfdc3c36dbe9635ad54d0c8f635 100644 (file)
@@ -740,19 +740,6 @@ else if (isgroup)
     continue;
     }
 
-  /* WITH_CONTENT_SCAN is another special case: it must be set if it or
-  EXPERIMENTAL_DCC is set. */
-
-  if (strcmp(name, "WITH_CONTENT_SCAN") == 0)
-    {
-    char *wcs = getenv("WITH_CONTENT_SCAN");
-    char *dcc = getenv("EXPERIMENTAL_DCC");
-    fprintf(new, wcs || dcc
-      ? "#define WITH_CONTENT_SCAN     yes\n"
-      : "/* WITH_CONTENT_SCAN not set */\n");
-    continue;
-    }
-
   /* DISABLE_DKIM is special; must be forced if DISABLE_TLS */
   if (strcmp(name, "DISABLE_DKIM") == 0)
     {
index a9124a013a7b177addab97352cfd3f132a66fdb9..56dd6d570c1da1bf99e8d96e1cda51b0befb5a6e 100644 (file)
@@ -7,13 +7,17 @@
  * wbreyha@gmx.net
  * See the file NOTICE for conditions of use and distribution.
  *
- * Copyright (c) The Exim Maintainers 2015 - 2021
+ * Copyright (c) The Exim Maintainers 2015 - 2022
  */
 
 /* Code for calling dccifd. Called from acl.c. */
 
 #include "exim.h"
 #ifdef EXPERIMENTAL_DCC
+#ifndef WITH_CONTENT_SCAN
+# error EXPERIMENTAL_DCC requires WITH_CONTENT_SCAN
+#endif
+
 #include "dcc.h"
 #include "unistd.h"