diff options
author | Jeremy Harris <jgh146exb@wizmail.org> | 2022-08-31 17:17:59 +0100 |
---|---|---|
committer | Jeremy Harris <jgh146exb@wizmail.org> | 2022-08-31 17:20:59 +0100 |
commit | 158dff9936e36a2d31d037d3988b9353458d6471 (patch) | |
tree | 17f9853e08563e20c6eef5ca0aae03f1e634b8c2 /src | |
parent | d8ecc7bf97934a1e2244788c610c958cacd740bd (diff) |
Fix non-WITH_CONTENT_SCAN build (2)
Broken-by: d8ecc7bf97
Diffstat (limited to 'src')
-rw-r--r-- | src/src/exim.c | 13 | ||||
-rw-r--r-- | src/src/functions.h | 2 | ||||
-rw-r--r-- | src/src/globals.h | 2 | ||||
-rw-r--r-- | src/src/regex.c | 10 | ||||
-rw-r--r-- | src/src/smtp_in.c | 2 |
5 files changed, 15 insertions, 14 deletions
diff --git a/src/src/exim.c b/src/src/exim.c index 82e833067..f2a787e8a 100644 --- a/src/src/exim.c +++ b/src/src/exim.c @@ -1678,17 +1678,6 @@ else } -/* reset regex expansion variables */ -void -regex_vars_clear(void) -{ -regex_match_string = NULL; -for (int i = 0; i < REGEX_VARS; i++) regex_vars[i] = NULL; -} - - - - /************************************************* * Entry point and high-level code * @@ -6092,13 +6081,13 @@ MORELOOP: dnslist_domain = dnslist_matched = NULL; #ifdef WITH_CONTENT_SCAN malware_name = NULL; + regex_vars_clear(); #endif callout_address = NULL; sending_ip_address = NULL; deliver_localpart_data = deliver_domain_data = recipient_data = sender_data = NULL; acl_var_m = NULL; - regex_vars_clear(); store_reset(reset_point); } diff --git a/src/src/functions.h b/src/src/functions.h index 345d7bce6..d5164547a 100644 --- a/src/src/functions.h +++ b/src/src/functions.h @@ -440,6 +440,7 @@ extern int_eximarith_t receive_statvfs(BOOL, int *); extern void receive_swallow_smtp(void); #ifdef WITH_CONTENT_SCAN extern int regex(const uschar **, BOOL); +extern void regex_vars_clear(void); #endif extern void regex_at_daemon(const uschar *); extern BOOL regex_match(const pcre2_code *, const uschar *, int, uschar **); @@ -447,7 +448,6 @@ extern BOOL regex_match_and_setup(const pcre2_code *, const uschar *, int, in extern const pcre2_code *regex_compile(const uschar *, mcs_flags, uschar **, pcre2_compile_context *); extern const pcre2_code *regex_must_compile(const uschar *, mcs_flags, BOOL); -extern void regex_vars_clear(void); extern void retry_add_item(address_item *, uschar *, int); extern BOOL retry_check_address(const uschar *, host_item *, uschar *, BOOL, uschar **, uschar **); diff --git a/src/src/globals.h b/src/src/globals.h index c40ae4beb..ae74147d4 100644 --- a/src/src/globals.h +++ b/src/src/globals.h @@ -904,12 +904,12 @@ extern const pcre2_code *regex_EARLY_PIPE; /* For recognizing PIPE_CONNCT */ extern int regex_cachesize; /* number of entries */ extern const pcre2_code *regex_ismsgid; /* Compiled r.e. for message ID */ extern const pcre2_code *regex_smtp_code; /* For recognizing SMTP codes */ -extern const uschar *regex_vars[]; /* $regexN variables */ #ifdef WHITELIST_D_MACROS extern const pcre2_code *regex_whitelisted_macro; /* For -D macro values */ #endif #ifdef WITH_CONTENT_SCAN extern uschar *regex_match_string; /* regex that matched a line (regex ACL condition) */ +extern const uschar *regex_vars[]; #endif extern int remote_delivery_count; /* Number of remote addresses */ extern int remote_max_parallel; /* Maximum parallel delivery */ diff --git a/src/src/regex.c b/src/src/regex.c index 3088f0066..25496f950 100644 --- a/src/src/regex.c +++ b/src/src/regex.c @@ -93,6 +93,16 @@ return FAIL; } +/* reset expansion variables */ +void +regex_vars_clear(void) +{ +regex_match_string = NULL; +for (int i = 0; i < REGEX_VARS; i++) regex_vars[i] = NULL; +} + + + int regex(const uschar ** listptr, BOOL cacheable) { diff --git a/src/src/smtp_in.c b/src/src/smtp_in.c index a15280bdc..28e529bae 100644 --- a/src/src/smtp_in.c +++ b/src/src/smtp_in.c @@ -2157,7 +2157,9 @@ prdr_requested = FALSE; #ifdef SUPPORT_I18N message_smtputf8 = FALSE; #endif +#ifdef WITH_CONTENT_SCAN regex_vars_clear(); +#endif body_linecount = body_zerocount = 0; lookup_value = NULL; /* Can be set by ACL */ |