[exim-cvs] SPF: fix looking at RRs when dns lookup does not …

Góra strony
Delete this message
Reply to this message
Autor: Exim Git Commits Mailing List
Data:  
Dla: exim-cvs
Temat: [exim-cvs] SPF: fix looking at RRs when dns lookup does not return success
Gitweb: https://git.exim.org/exim.git/commitdiff/8ab9474f03559cc0700b85bc8c4c3581275e9f8e
Commit:     8ab9474f03559cc0700b85bc8c4c3581275e9f8e
Parent:     ad67e5dbf792558b1a2ea3619746a6848415b41a
Author:     Jeremy Harris <jgh146exb@???>
AuthorDate: Thu Oct 5 17:43:45 2023 +0100
Committer:  Jeremy Harris <jgh146exb@???>
CommitDate: Thu Oct 5 17:43:45 2023 +0100


    SPF: fix looking at RRs when dns lookup does not return success
---
 src/src/spf.c | 14 +++++++-------
 1 file changed, 7 insertions(+), 7 deletions(-)


diff --git a/src/src/spf.c b/src/src/spf.c
index 3d83f07ba..100e22243 100644
--- a/src/src/spf.c
+++ b/src/src/spf.c
@@ -71,7 +71,6 @@ SPF_dns_rr_t srr = {
   .hook = NULL,                /* misc information */
   .source = spf_dns_server
 };
-int dns_rc;


DEBUG(D_receive) debug_printf("SPF_dns_exim_lookup '%s'\n", domain);

@@ -87,20 +86,21 @@ if (rr_type == T_SPF)
return spfrr;
}

-switch (dns_rc = dns_lookup(dnsa, US domain, rr_type, NULL))
+switch (dns_lookup(dnsa, US domain, rr_type, NULL))
   {
-  case DNS_SUCCEED:    srr.herrno = NETDB_SUCCESS;    break;
   case DNS_AGAIN:    srr.herrno = TRY_AGAIN;        break;
   case DNS_NOMATCH:    srr.herrno = HOST_NOT_FOUND;    break;
   case DNS_NODATA:    srr.herrno = NO_DATA;        break;
   case DNS_FAIL:
   default:        srr.herrno = NO_RECOVERY;    break;
+  case DNS_SUCCEED:
+    srr.herrno = NETDB_SUCCESS;
+    for (dns_record * rr = dns_next_rr(dnsa, &dnss, RESET_ANSWERS); rr;
+     rr = dns_next_rr(dnsa, &dnss, RESET_NEXT))
+      if (rr->type == rr_type) { found++; break; }
+    break;
   }


-for (dns_record * rr = dns_next_rr(dnsa, &dnss, RESET_ANSWERS); rr;
-     rr = dns_next_rr(dnsa, &dnss, RESET_NEXT))
-  if (rr->type == rr_type) found++;
-
 if (found == 0)
   {
   SPF_dns_rr_dup(&spfrr, &srr);


--
## subscription configuration (requires account):
## https://lists.exim.org/mailman3/postorius/lists/exim-cvs.lists.exim.org/
## unsubscribe (doesn't require an account):
## exim-cvs-unsubscribe@???
## Exim details at http://www.exim.org/
## Please use the Wiki with this list - http://wiki.exim.org/