File: 88_23-Local-scan-fix-API.patch

package info (click to toggle)
exim4 4.99-6
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 26,076 kB
  • sloc: ansic: 119,292; sh: 4,071; xml: 2,112; perl: 918; makefile: 532
file content (100 lines) | stat: -rw-r--r-- 3,747 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
From 66a452cb6128ddc0805eac37230afd77d6fb168c Mon Sep 17 00:00:00 2001
From: Jeremy Harris <jgh146exb@wizmail.org>
Date: Sun, 23 Nov 2025 14:18:54 +0000
Subject: [PATCH] Local-scan: fix API

Broken-by: 7b4e2a15a529
---
 doc/ChangeLog |  4 ++++
 src/functions.h   | 13 -------------
 src/local_scan.h  | 14 +++++++++++++-
 src/smtp_in.c     |  3 +++
 test/runtest          |  4 ++--
 5 files changed, 22 insertions(+), 16 deletions(-)

--- a/doc/ChangeLog
+++ b/doc/ChangeLog
@@ -33,10 +33,14 @@ JH/13 Bug 3175: Fix file open mode flags
 
 JH/15 Fix use of a verify held-open connection. When used with TLS the
       details of the connection were not being preoperly passed to a later
       delivery process, resulting in a null-indirection fault.
 
+JH/16: Fix local-scan API. Constification work done for 4.99 included a
+       function [ expand_string() ] replacement with a macro, but the latter
+       definition was not placed in the API .h file.
+
 Exim version 4.99
 -----------------
 
 JH/01 Use fewer forks & execs for sending many messages to a single host.
       By passing back more info from the transport to the delivery process,
--- a/src/functions.h
+++ b/src/functions.h
@@ -236,23 +236,10 @@ extern int     exp_bool(address_item *,
   const uschar *, const uschar *, unsigned, uschar *, BOOL bvalue,
   const uschar *, BOOL *);
 extern BOOL    expand_check_condition(const uschar *, const uschar *, const uschar *);
 extern uschar *expand_file_big_buffer(const uschar *);
 
-extern const uschar *expand_string_2(const uschar *, BOOL *);
-
-static inline uschar * expand_nc_string(uschar * s)
-{ return US expand_string_2(s, NULL); }
-static inline const uschar * expand_c_string(const uschar * s)
-{ return expand_string_2(s, NULL); }
-
-/* A macro that picks which function to use depending on the type of the arg */
-#define expand_string(X) _Generic((X),     \
-	      uschar *:		expand_nc_string, \
-	      const uschar *:	expand_c_string   \
-	      )(X)
-
 extern BOOL   expand_string_nonempty(const uschar *);
 extern uschar *expand_getkeyed(const uschar *, const uschar *);
 
 extern uschar *expand_hide_passwords(uschar * );
 extern uschar *expand_string_copy(const uschar *);
--- a/src/local_scan.h
+++ b/src/local_scan.h
@@ -194,11 +194,23 @@ extern BOOL    smtp_input;             /
 
 /* Functions that are documented as visible in local_scan(). */
 
 extern int     child_close(pid_t, int);
 extern void    debug_printf(const char *, ...) PRINTF_FUNCTION(1,2);
-extern uschar *expand_string(uschar *);
+
+extern const uschar * expand_string_2(const uschar *, BOOL *);
+static inline uschar * expand_nc_string(uschar * s)
+{ return US expand_string_2(s, NULL); }
+static inline const uschar * expand_c_string(const uschar * s)
+{ return expand_string_2(s, NULL); }
+
+/* A macro that picks which function to use depending on the type of the arg */
+#define expand_string(X) _Generic((X),     \
+	      uschar *:		expand_nc_string, \
+	      const uschar *:	expand_c_string   \
+	      )(X)
+
 extern void    header_add(int, const char *, ...);
 extern void    header_add_at_position(BOOL, uschar *, BOOL, int, const char *, ...);
 extern void    header_remove(int, const uschar *);
 extern BOOL    header_testname(const header_line *, const uschar *, int, BOOL);
 extern BOOL    header_testname_incomplete(const header_line *, const uschar *, int, BOOL);
--- a/src/smtp_in.c
+++ b/src/smtp_in.c
@@ -1799,10 +1799,13 @@ deliver_host = deliver_host_address = NU
  message_smtputf8 = FALSE;
 #endif
 #ifdef SUPPORT_SRS
  srs_recipient = NULL;
 #endif
+#ifdef HAVE_LOCAL_SCAN
+local_scan_data = NULL;
+#endif
 #ifdef WITH_CONTENT_SCAN
  regex_vars_clear();
  malware_name = NULL;
 #endif
 #ifdef EXPERIMENTAL_DCC