[exim-dev] bug matching @[] in host lists

Pàgina inicial
Delete this message
Reply to this message
Autor: Tony Finch
Data:  
A: exim-dev
Assumpte: [exim-dev] bug matching @[] in host lists
Exim incorrectly matches @[] if the IP address in the domain literal is a
prefix of an interface address.

19:36:25 29722 Actual local interface address is 127.0.0.1 (lo)
19:36:25 29722 Actual local interface address is 192.168.128.138 (eth0)
19:36:25 29722 Actual local interface address is 131.111.8.138 (eth1)
19:36:25 29722 Actual local interface address is 131.111.8.148 (eth1:1)
19:36:25 29722 Actual local interface address is 131.111.8.158 (eth1:2)
19:36:25 29722 [131.111.8.1] in "+our_names : @[]"? yes (matched "@[]")

Suggested fix:

--- match.c     1 Aug 2005 13:20:28 -0000       1.8
+++ match.c     6 Sep 2005 18:38:14 -0000
@@ -174,7 +174,8 @@
     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;
     }


Tony.
--
<fanf@???> <dot@???> http://dotat.at/ ${sg{\N${sg{\
N\}{([^N]*)(.)(.)(.*)}{\$1\$3\$2\$1\$3\n\$2\$3\$4\$3\n\$3\$2\$4}}\
\N}{([^N]*)(.)(.)(.*)}{\$1\$3\$2\$1\$3\n\$2\$3\$4\$3\n\$3\$2\$4}}