[exim-cvs] Correct gecos expansion when From: is a prefix of…

Top Page
Delete this message
Reply to this message
Author: Exim Git Commits Mailing List
Date:  
To: exim-cvs
Subject: [exim-cvs] Correct gecos expansion when From: is a prefix of the username.
Gitweb: http://git.exim.org/exim.git/commitdiff/326cdc37059420d73ba121daaf74def9b53b9e3b
Commit:     326cdc37059420d73ba121daaf74def9b53b9e3b
Parent:     d4f09789499b5a665a0e79d6ed0086806fc7b648
Author:     Tony Finch <dot@???>
AuthorDate: Thu Dec 6 19:11:28 2012 +0000
Committer:  Tony Finch <dot@???>
CommitDate: Thu Dec 6 19:11:28 2012 +0000


    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.
---
 doc/doc-txt/ChangeLog |   13 +++++++++++++
 src/src/receive.c     |    2 +-
 2 files changed, 14 insertions(+), 1 deletions(-)


diff --git a/doc/doc-txt/ChangeLog b/doc/doc-txt/ChangeLog
index 577ac39..b516a71 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 1943a74..4d77bcd 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,