From 95d1f782e772c5dd39d718409edabe1eca92690d Mon Sep 17 00:00:00 2001 From: Philip Hazel Date: Mon, 12 Sep 2005 14:03:42 +0000 Subject: [PATCH] Fix @[] prefix matching bug. --- doc/doc-txt/ChangeLog | 5 ++++- src/src/match.c | 6 ++++-- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/doc/doc-txt/ChangeLog b/doc/doc-txt/ChangeLog index e510820be..5ad040e4c 100644 --- a/doc/doc-txt/ChangeLog +++ b/doc/doc-txt/ChangeLog @@ -1,4 +1,4 @@ -$Cambridge: exim/doc/doc-txt/ChangeLog,v 1.222 2005/09/12 13:55:54 ph10 Exp $ +$Cambridge: exim/doc/doc-txt/ChangeLog,v 1.223 2005/09/12 14:03:42 ph10 Exp $ Change log file for Exim from version 4.21 ------------------------------------------- @@ -167,6 +167,9 @@ PH/40 RM_COMMAND is now used in the building process. PH/41 Added a "distclean" target to the top-level Makefile; it deletes all the "build-* directories that it finds. +PH/42 (But a TF fix): In a domain list, Exim incorrectly matched @[] if the IP + address in a domain literal was a prefix of an interface address. + Exim version 4.52 ----------------- diff --git a/src/src/match.c b/src/src/match.c index 18787e8ac..ace8e016e 100644 --- a/src/src/match.c +++ b/src/src/match.c @@ -1,4 +1,4 @@ -/* $Cambridge: exim/src/src/match.c,v 1.9 2005/09/12 13:39:31 ph10 Exp $ */ +/* $Cambridge: exim/src/src/match.c,v 1.10 2005/09/12 14:03:42 ph10 Exp $ */ /************************************************* * Exim - an Internet mail transport agent * @@ -174,7 +174,9 @@ if (cb->at_is_special && pattern[0] == '@') int slen = Ustrlen(s); if (s[0] != '[' && s[slen-1] != ']') return FAIL; for (ip = host_find_interfaces(); ip != NULL; ip = ip->next) - if (Ustrncmp(ip->address, s+1, slen - 2) == 0) return OK; + if (Ustrncmp(ip->address, s+1, slen - 2) == 0 + && ip->address[slen - 2] == 0) + return OK; return FAIL; } -- 2.25.1