From 7102e136b439b6e92317b484192f1357b1e1121a Mon Sep 17 00:00:00 2001 From: Philip Hazel Date: Tue, 21 Dec 2004 12:21:46 +0000 Subject: [PATCH] Check dnsdb PTR key for IP address before playing the reversing game. --- doc/doc-txt/ChangeLog | 7 ++++++- doc/doc-txt/NewStuff | 6 +++++- src/src/lookups/dnsdb.c | 10 ++++++---- 3 files changed, 17 insertions(+), 6 deletions(-) diff --git a/doc/doc-txt/ChangeLog b/doc/doc-txt/ChangeLog index 021b61bcc..2b75b4656 100644 --- a/doc/doc-txt/ChangeLog +++ b/doc/doc-txt/ChangeLog @@ -1,4 +1,4 @@ -$Cambridge: exim/doc/doc-txt/ChangeLog,v 1.52 2004/12/21 12:00:59 ph10 Exp $ +$Cambridge: exim/doc/doc-txt/ChangeLog,v 1.53 2004/12/21 12:21:46 ph10 Exp $ Change log file for Exim from version 4.21 ------------------------------------------- @@ -234,6 +234,11 @@ Exim version 4.50 But simultaneously result of request was absolutely normal ldap result, so I produce this patch..." +55. Some experimental protocols are using DNS PTR records for new purposes. The + keys for these records are domain names, not reversed IP addresses. The + dnsdb lookup now tests whether it's key is an IP address. If not, it leaves + it alone. Component reversal etc. now happens only for IP addresses. + Exim version 4.43 ----------------- diff --git a/doc/doc-txt/NewStuff b/doc/doc-txt/NewStuff index 3109ea96f..11d7b3cc3 100644 --- a/doc/doc-txt/NewStuff +++ b/doc/doc-txt/NewStuff @@ -1,4 +1,4 @@ -$Cambridge: exim/doc/doc-txt/NewStuff,v 1.21 2004/12/20 15:24:27 ph10 Exp $ +$Cambridge: exim/doc/doc-txt/NewStuff,v 1.22 2004/12/21 12:21:46 ph10 Exp $ New Features in Exim -------------------- @@ -234,6 +234,10 @@ Version 4.50 19. The Exiscan patch is now merged into the main source. See src/EDITME for parameters for the build. +20. If the key for a dnsdb lookup is not an IP address, it is used verbatim, + without component reversal and without the addition of in-addr.arpa or + ip6.arpa. + Version 4.43 ------------ diff --git a/src/src/lookups/dnsdb.c b/src/src/lookups/dnsdb.c index 9cd8612b1..756247d35 100644 --- a/src/src/lookups/dnsdb.c +++ b/src/src/lookups/dnsdb.c @@ -1,4 +1,4 @@ -/* $Cambridge: exim/src/src/lookups/dnsdb.c,v 1.6 2004/12/20 15:24:28 ph10 Exp $ */ +/* $Cambridge: exim/src/src/lookups/dnsdb.c,v 1.7 2004/12/21 12:21:46 ph10 Exp $ */ /************************************************* * Exim - an Internet mail transport agent * @@ -231,10 +231,12 @@ while ((domain = string_nextinlist(&keystring, &sep, buffer, sizeof(buffer))) int searchtype = (type == T_ZNS)? T_NS : /* record type we want */ (type == T_MXH)? T_MX : type; - /* If the type is PTR, we have to construct the relevant magic lookup - key. This code is now in a separate function. */ + /* If the type is PTR, we have to construct the relevant magic lookup key if + the original is an IP address (some experimental protocols are using PTR + records for different purposes where the key string is a host name). This + code for doing the reversal is now in a separate function. */ - if (type == T_PTR) + if (type == T_PTR && string_is_ip_address(domain, NULL)) { dns_build_reverse(domain, rbuffer); domain = rbuffer; -- 2.30.2