From: Jeremy Harris Date: Fri, 2 Sep 2022 10:15:33 +0000 (+0100) Subject: EXPERIMENTAL_DCC: make build without WITH_CONTENT_SCAN fail X-Git-Tag: exim-4.97-RC0~240 X-Git-Url: https://git.exim.org/exim.git/commitdiff_plain/04644f4ca7c85d5e4dff1bd9e48b3429130e4fdd EXPERIMENTAL_DCC: make build without WITH_CONTENT_SCAN fail rather than auto-include the support --- diff --git a/src/src/EDITME b/src/src/EDITME index 3c33dc5f3..80bd07817 100644 --- a/src/src/EDITME +++ b/src/src/EDITME @@ -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 diff --git a/src/src/acl.c b/src/src/acl.c index 3af3a4eee..1e7d28a90 100644 --- a/src/src/acl.c +++ b/src/src/acl.c @@ -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. */ diff --git a/src/src/buildconfig.c b/src/src/buildconfig.c index f9a8febdf..bbbaefe9c 100644 --- a/src/src/buildconfig.c +++ b/src/src/buildconfig.c @@ -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) { diff --git a/src/src/dcc.c b/src/src/dcc.c index a9124a013..56dd6d570 100644 --- a/src/src/dcc.c +++ b/src/src/dcc.c @@ -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"