summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJeremy Harris <jgh146exb@wizmail.org>2021-11-09 21:23:45 +0000
committerJeremy Harris <jgh146exb@wizmail.org>2021-11-09 21:23:45 +0000
commit6e05345b427859b32248c75c6f179283f6cf0382 (patch)
tree1530fc95a2952365854a51716e9528ee2c9733b0
parent6db92eab5917e515c83fd773dad6111177a0207f (diff)
Fix -be macro definition
Broken-by: 753739fdef
-rw-r--r--doc/doc-txt/ChangeLog4
-rw-r--r--src/src/exim.c7
-rw-r--r--test/confs/06273
-rw-r--r--test/scripts/0000-Basic/062710
-rw-r--r--test/stdout/06274
5 files changed, 27 insertions, 1 deletions
diff --git a/doc/doc-txt/ChangeLog b/doc/doc-txt/ChangeLog
index a5712fce8..7f6814d5e 100644
--- a/doc/doc-txt/ChangeLog
+++ b/doc/doc-txt/ChangeLog
@@ -36,6 +36,10 @@ JH/08 Remove stripping of the binaries from the FreeBSD build. This was added
in 4.61 without a reason logged. Binaries will be bigger, which might
matter on diskspace-constrained systems, but debug is easier.
+JH/09 Fix macro-definition during "-be" expansion testing. The move to
+ write-protected store for macros had not accounted for these runtime
+ additions; fix by removing this protection for "-be" mode.
+
Exim version 4.95
-----------------
diff --git a/src/src/exim.c b/src/src/exim.c
index a31a8a1b9..133761de9 100644
--- a/src/src/exim.c
+++ b/src/src/exim.c
@@ -4588,7 +4588,12 @@ needed in transports so we lost the optimisation. */
store_pool = POOL_CONFIG;
readconf_rest();
store_pool = old_pool;
- store_writeprotect(POOL_CONFIG);
+
+ /* -be can add macro definitions, needing to link to the macro structure
+ chain. Otherwise, make the memory used for config data readonly. */
+
+ if (!expansion_test)
+ store_writeprotect(POOL_CONFIG);
#ifdef MEASURE_TIMING
report_time_since(&t0, US"readconf_rest (delta)");
diff --git a/test/confs/0627 b/test/confs/0627
new file mode 100644
index 000000000..466698af8
--- /dev/null
+++ b/test/confs/0627
@@ -0,0 +1,3 @@
+# Exim test configuration 0627
+CONFIG_MACRO = this
+# End
diff --git a/test/scripts/0000-Basic/0627 b/test/scripts/0000-Basic/0627
new file mode 100644
index 000000000..e5cd5b229
--- /dev/null
+++ b/test/scripts/0000-Basic/0627
@@ -0,0 +1,10 @@
+# -be and macro definitions
+#
+#
+exim -be
+FOO = bar
+baz foo FOO
+****
+#
+exim -be 'FOO_2 = baz'
+****
diff --git a/test/stdout/0627 b/test/stdout/0627
new file mode 100644
index 000000000..75f062f94
--- /dev/null
+++ b/test/stdout/0627
@@ -0,0 +1,4 @@
+> Defined macro 'FOO'
+> baz foo bar
+>
+Defined macro 'FOO_2'