]> git.ipfire.org Git - thirdparty/pdns.git/commitdiff
auth: pdnsutil edit-zone, detect capitalization changes in LUA, TXT and SPF records 12028/head
authorKees Monshouwer <mind04@monshouwer.org>
Tue, 27 Sep 2022 11:05:54 +0000 (13:05 +0200)
committermind04 <mind04@monshouwer.org>
Tue, 27 Sep 2022 11:20:58 +0000 (13:20 +0200)
pdns/dnsparser.hh

index 3636677720ee2f3492d965ffbfb5d34ceb22cd64..e990b60206ca7f3b97bb1cd341629f7c6de47945 100644 (file)
@@ -365,11 +365,20 @@ struct DNSRecord
 
     string lzrp, rzrp;
     if(a.d_content)
-      lzrp=toLower(a.d_content->getZoneRepresentation());
+      lzrp = a.d_content->getZoneRepresentation();
     if(b.d_content)
-      rzrp=toLower(b.d_content->getZoneRepresentation());
-
-    return lzrp < rzrp;
+      rzrp = b.d_content->getZoneRepresentation();
+
+    switch (a.d_type) {
+    case QType::TXT:
+    case QType::SPF:
+#if !defined(RECURSOR)
+    case QType::LUA:
+#endif
+      return lzrp < rzrp;
+    default:
+      return toLower(lzrp) < toLower(rzrp);
+    }
   }
 
   bool operator==(const DNSRecord& rhs) const