Skip to content
Snippets Groups Projects
Unverified Commit ec4968fe authored by Andreas Metzler's avatar Andreas Metzler
Browse files

Fix ${srs_encode ..}.

Previously it would give a bad result for one day every 1024 days.

(cherry picked from commit b1b4e42c)
parent 0656dcd5
No related branches found
Tags 4.96-15+deb12u1
No related merge requests found
exim4 (4.96-16) UNRELEASED; urgency=medium
exim4 (4.96-15+deb12u1) bookworm; urgency=medium
* 75_42-Fix-run-arg-parsing.patch (From upstream GIT master, backported by
Bryce Harrington for Ubuntu): Fix argument parsing for ${run } expansion.
Previously, when an argument included a close-brace character (eg. it
itself used an expansion) an error occurred. Closes: #1025420
* 75_68-Fix-srs_encode-.-for-mod-1024-day-zero.patch from upstream GIT
master: Fix ${srs_encode ..}. Previously it would give a bad result for
one day every 1024 days.
-- Andreas Metzler <ametzler@debian.org> Sat, 10 Jun 2023 16:00:41 +0200
-- Andreas Metzler <ametzler@debian.org> Sun, 02 Jul 2023 14:56:17 +0200
exim4 (4.96-15) unstable; urgency=medium
......
From 51f9c07cd341c9c1a09b3816df988c6f44477c99 Mon Sep 17 00:00:00 2001
From: Jeremy Harris <jgh146exb@wizmail.org>
Date: Tue, 11 Apr 2023 11:59:08 +0100
Subject: [PATCH] Fix ${srs_encode ..} for mod-1024 day zero
---
doc/ChangeLog | 3 +++
src/expand.c | 10 ++++------
2 files changed, 7 insertions(+), 6 deletions(-)
--- a/doc/ChangeLog
+++ b/doc/ChangeLog
@@ -54,10 +54,13 @@ JH/20 Fix TLSA lookups. Previously dns_
JH/23 Fix crash in string expansions. Previously, if an empty variable was
immediately followed by an expansion operator, a null-indirection read
was done, killing the process.
+JH/27 Fix ${srs_encode ..}. Previously it would give a bad result for one day
+ every 1024 days.
+
Exim version 4.96
-----------------
JH/01 Move the wait-for-next-tick (needed for unique message IDs) from
--- a/src/expand.c
+++ b/src/expand.c
@@ -3440,11 +3440,11 @@ switch(cond_type = identify_operator(&s,
case 3: return NULL;
}
/* Match the given local_part against the SRS-encoded pattern */
- re = regex_must_compile(US"^(?i)SRS0=([^=]+)=([A-Z2-7]+)=([^=]*)=(.*)$",
+ re = regex_must_compile(US"^(?i)SRS0=([^=]+)=([A-Z2-7]{2})=([^=]*)=(.*)$",
TRUE, FALSE);
md = pcre2_match_data_create(4+1, pcre_gen_ctx);
if (pcre2_match(re, sub[0], PCRE2_ZERO_TERMINATED, 0, PCRE_EOPT,
md, pcre_mtc_ctx) < 0)
{
@@ -6957,17 +6957,15 @@ while (*s)
/* ${base32:${eval:$tod_epoch/86400&0x3ff}}= */
{
struct timeval now;
unsigned long i;
- gstring * h = NULL;
gettimeofday(&now, NULL);
- for (unsigned long i = (now.tv_sec / 86400) & 0x3ff; i; i >>= 5)
- h = string_catn(h, &base32_chars[i & 0x1f], 1);
- if (h) while (h->ptr > 0)
- g = string_catn(g, &h->s[--h->ptr], 1);
+ i = (now.tv_sec / 86400) & 0x3ff;
+ g = string_catn(g, &base32_chars[i >> 5], 1);
+ g = string_catn(g, &base32_chars[i & 0x1f], 1);
}
g = string_catn(g, US"=", 1);
/* ${domain:$return_path}=${local_part:$return_path} */
{
......@@ -10,12 +10,12 @@ Subject: [PATCH 1/3] Fix variable initialisation in smtp transport. Bug 2996
--- a/doc/ChangeLog
+++ b/doc/ChangeLog
@@ -54,10 +54,18 @@ JH/20 Fix TLSA lookups. Previously dns_
JH/23 Fix crash in string expansions. Previously, if an empty variable was
immediately followed by an expansion operator, a null-indirection read
@@ -61,10 +61,18 @@ JH/23 Fix crash in string expansions. Pr
was done, killing the process.
JH/27 Fix ${srs_encode ..}. Previously it would give a bad result for one day
every 1024 days.
+JH/28 Bug 2996: Fix a crash in the smtp transport. When finding that the
+ message being considered for delivery was already being handled by
+ another process, and having an SMTP connection already open, the function
......
......@@ -31,5 +31,6 @@
75_63-OpenSSL-log-conns-rejected-for-bad-ALPN-with-the-off.patch
75_64-DANE-do-not-check-dns_again_means_nonexist-for-TLSA-.patch
75_66-Fix-crash-in-expansions.patch
75_68-Fix-srs_encode-.-for-mod-1024-day-zero.patch
75_70-Fix-variable-initialisation-in-smtp-transport.-Bug-2.patch
90_localscan_dlopen.dpatch
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment