summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTony Finch <dot@dotat.at>2012-12-06 19:11:28 +0000
committerTony Finch <dot@dotat.at>2012-12-06 19:11:28 +0000
commit326cdc37059420d73ba121daaf74def9b53b9e3b (patch)
treeab32e246d1a1657a02f328ca152ae95e3bd6aafd
parentd4f09789499b5a665a0e79d6ed0086806fc7b648 (diff)
Correct gecos expansion when From: is a prefix of the username.
Test 0254 submits a message to Exim with the header Resent-From: f When I ran the test suite under the user fanf2, Exim expanded the header to contain my full name, whereas it should have added a Resent-Sender: header. It erroneously treats any prefix of the username as equal to the username. This change corrects that bug.
-rw-r--r--doc/doc-txt/ChangeLog13
-rw-r--r--src/src/receive.c2
2 files changed, 14 insertions, 1 deletions
diff --git a/doc/doc-txt/ChangeLog b/doc/doc-txt/ChangeLog
index 577ac39f0..b516a7118 100644
--- a/doc/doc-txt/ChangeLog
+++ b/doc/doc-txt/ChangeLog
@@ -120,6 +120,19 @@ TF/01 Fix ultimate retry timeouts for intermittently deliverable recipients.
I suspect this new check makes the old local delivery cutoff check
redundant, but I have not verified this so I left the code in place.
+TF/02 Correct gecos expansion when From: is a prefix of the username.
+
+ Test 0254 submits a message to Exim with the header
+
+ Resent-From: f
+
+ When I ran the test suite under the user fanf2, Exim expanded
+ the header to contain my full name, whereas it should have added
+ a Resent-Sender: header. It erroneously treats any prefix of the
+ username as equal to the username.
+
+ This change corrects that bug.
+
Exim version 4.80.1
-------------------
diff --git a/src/src/receive.c b/src/src/receive.c
index 1943a74c7..4d77bcd96 100644
--- a/src/src/receive.c
+++ b/src/src/receive.c
@@ -2037,7 +2037,7 @@ for (h = header_list->next; h != NULL; h = h->next)
{
uschar *s = Ustrchr(h->text, ':') + 1;
while (isspace(*s)) s++;
- if (strncmpic(s, originator_login, h->slen - (s - h->text) - 1) == 0)
+ if (strcmpic(s, originator_login) == 0)
{
uschar *name = is_resent? US"Resent-From" : US"From";
header_add(htype_from, "%s: %s <%s@%s>\n", name, originator_name,