From: Kees Monshouwer Date: Wed, 30 Jul 2014 15:22:22 +0000 (+0200) Subject: remove fancy-record options X-Git-Tag: auth-3.4.0-rc1~7^2 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=b6cab82e5407cf7c8f24089d7d1567e265aa0261;p=pdns remove fancy-record options --- diff --git a/pdns/common_startup.cc b/pdns/common_startup.cc index 5a556e96c..a218c696a 100644 --- a/pdns/common_startup.cc +++ b/pdns/common_startup.cc @@ -48,8 +48,6 @@ void declareArguments() ::arg().setSwitch("forward-2136","A global setting to allow RFC2136 packages that are for a Slave domain, to be forwarded to the master.")="yes"; ::arg().setSwitch("log-dns-details","If PDNS should log DNS non-erroneous details")="no"; ::arg().setSwitch("log-dns-queries","If PDNS should log all incoming DNS queries")="no"; - ::arg().set("urlredirector","Where we send hosts to that need to be url redirected")="127.0.0.1"; - ::arg().set("smtpredirector","Our smtpredir MX host")="a.misconfigured.powerdns.smtp.server"; ::arg().set("local-address","Local IP addresses to which we bind")="0.0.0.0"; ::arg().setSwitch("local-address-nonexist-fail","Fail to start if one or more of the local-address's do not exist on this server")="yes"; ::arg().set("local-ipv6","Local IP address to which we bind")=""; @@ -74,8 +72,6 @@ void declareArguments() ::arg().set("version-string","PowerDNS version in packets - full, anonymous, powerdns or custom")="full"; ::arg().set("control-console","Debugging switch - don't use")="no"; // but I know you will! - ::arg().set("fancy-records","Process URL and MBOXFW records")="no"; - ::arg().set("wildcard-url","Process URL and MBOXFW records")="no"; ::arg().set("loglevel","Amount of logging. Higher is more. Do not set below 3")="4"; ::arg().set("default-soa-name","name to insert in the SOA record if none set in the backend")="a.misconfigured.powerdns.server"; ::arg().set("default-soa-mail","mail address to insert in the SOA record if none set in the backend")=""; diff --git a/pdns/docs/pdns.xml b/pdns/docs/pdns.xml index ebaf7adad..b301fdad4 100644 --- a/pdns/docs/pdns.xml +++ b/pdns/docs/pdns.xml @@ -12914,6 +12914,14 @@ UPDATE records SET auth=1 WHERE auth IS NULL; + + fancy-records + + + Process URL and MBOXFW records + + + log-failed-updates @@ -12922,6 +12930,30 @@ UPDATE records SET auth=1 WHERE auth IS NULL; + + smtpredirector + + + Our smtpredir MX host + + + + + urlredirector + + + Where we send hosts to that need to be url redirected + + + + + wildcard-url + + + Process URL and MBOXFW records + + + Options with changed default values diff --git a/pdns/packethandler.cc b/pdns/packethandler.cc index b43e0dbe7..a864404db 100644 --- a/pdns/packethandler.cc +++ b/pdns/packethandler.cc @@ -61,7 +61,6 @@ enum root_referral { PacketHandler::PacketHandler():B(s_programname) { ++s_count; - d_doFancyRecords = (::arg()["fancy-records"]!="no"); d_doDNAME=::arg().mustDo("experimental-dname-processing"); d_doRecursion= ::arg().mustDo("recursor"); d_logDNSDetails= ::arg().mustDo("log-dns-details"); @@ -129,92 +128,6 @@ void PacketHandler::addRootReferral(DNSPacket* r) } } -int PacketHandler::findMboxFW(DNSPacket *p, DNSPacket *r, string &target) -{ - DNSResourceRecord rr; - bool wedoforward=false; - - SOAData sd; - int zoneId; - if(!B.getAuth(p, &sd, target, &zoneId)) - return false; - - B.lookup(QType(QType::MBOXFW),string("%@")+target,p, zoneId); - - while(B.get(rr)) - wedoforward=true; - - if(wedoforward) { - r->clearRecords(); - rr.content=::arg()["smtpredirector"]; - rr.priority=25; - rr.ttl=7200; - rr.qtype=QType::MX; - rr.qname=target; - - r->addRecord(rr); - } - - return wedoforward; -} - -int PacketHandler::findUrl(DNSPacket *p, DNSPacket *r, string &target) -{ - DNSResourceRecord rr; - - bool found=false; - - B.lookup(QType(QType::URL),target,p); // search for a URL before we search for an A - - while(B.get(rr)) { - if(!found) - r->clearRecords(); - found=true; - DLOG(L << "Found a URL!" << endl); - rr.content=::arg()["urlredirector"]; - rr.qtype=QType::A; - rr.qname=target; - - r->addRecord(rr); - } - - if(found) - return 1; - - // now try CURL - - B.lookup(QType(QType::CURL),target,p); // search for a URL before we search for an A - - while(B.get(rr)) { - if(!found) - r->clearRecords(); - found=true; - DLOG(L << "Found a CURL!" << endl); - rr.content=::arg()["urlredirector"]; - rr.qtype=1; // A - rr.qname=target; - rr.ttl=300; - r->addRecord(rr); - } - - if(found) - return found; - return 0; -} - -/** Returns 0 if nothing was found, -1 if an error occurred or 1 if the search - was satisfied */ -int PacketHandler::doFancyRecords(DNSPacket *p, DNSPacket *r, string &target) -{ - DNSResourceRecord rr; - if(p->qtype.getCode()==QType::MX) // check if this domain has smtp service from us - return findMboxFW(p,r,target); - - if(p->qtype.getCode()==QType::A) // search for a URL record for an A - return findUrl(p,r,target); - return 0; -} - /** This adds DNSKEY records. Returns true if one was added */ bool PacketHandler::addDNSKEY(DNSPacket *p, DNSPacket *r, const SOAData& sd) { @@ -1162,12 +1075,6 @@ DNSPacket *PacketHandler::questionOrRecurse(DNSPacket *p, bool *shouldRecurse) return r; } - // please don't query fancy records directly! - if(d_doFancyRecords && (p->qtype.getCode()==QType::URL || p->qtype.getCode()==QType::CURL || p->qtype.getCode()==QType::MBOXFW)) { - r->setRcode(RCode::ServFail); - return r; - } - // for qclass ANY the response should never be authoritative unless the response covers all classes. if(p->qclass==QClass::ANY) r->setA(false); diff --git a/pdns/packethandler.hh b/pdns/packethandler.hh index 630f4d939..a9eab5ba4 100644 --- a/pdns/packethandler.hh +++ b/pdns/packethandler.hh @@ -70,9 +70,6 @@ private: int processNotify(DNSPacket *); void addRootReferral(DNSPacket *r); int makeCanonic(DNSPacket *p, DNSPacket *r, string &target); - int findMboxFW(DNSPacket *p, DNSPacket *r, string &target); - int findUrl(DNSPacket *p, DNSPacket *r, string &target); - int doFancyRecords(DNSPacket *p, DNSPacket *r, string &target); int doChaosRequest(DNSPacket *p, DNSPacket *r, string &target); bool addDNSKEY(DNSPacket *p, DNSPacket *r, const SOAData& sd); bool addNSEC3PARAM(DNSPacket *p, DNSPacket *r, const SOAData& sd); @@ -106,7 +103,6 @@ private: static AtomicCounter s_count; static pthread_mutex_t s_rfc2136lock; - bool d_doFancyRecords; bool d_doRecursion; bool d_logDNSDetails; bool d_doIPv6AdditionalProcessing; diff --git a/pdns/pdns.conf-dist b/pdns/pdns.conf-dist index 1e29178c6..a1573fb1c 100644 --- a/pdns/pdns.conf-dist +++ b/pdns/pdns.conf-dist @@ -169,11 +169,6 @@ # # experimental-rfc2136=no -################################# -# fancy-records Process URL and MBOXFW records -# -# fancy-records=no - ################################# # forward-2136 A global setting to allow RFC2136 packages that are for a Slave domain, to be forwarded to the master. # @@ -414,11 +409,6 @@ # # slave-renotify=no -################################# -# smtpredirector Our smtpredir MX host -# -# smtpredirector=a.misconfigured.powerdns.smtp.server - ################################# # soa-expire-default Default SOA expire # @@ -484,11 +474,6 @@ # # udp-truncation-threshold=1680 -################################# -# urlredirector Where we send hosts to that need to be url redirected -# -# urlredirector=127.0.0.1 - ################################# # version-string PowerDNS version in packets - full, anonymous, powerdns or custom # @@ -524,9 +509,4 @@ # # webserver-print-arguments=no -################################# -# wildcard-url Process URL and MBOXFW records -# -# wildcard-url=no - diff --git a/pdns/receiver.cc b/pdns/receiver.cc index 28fe64904..af38f2bba 100644 --- a/pdns/receiver.cc +++ b/pdns/receiver.cc @@ -528,10 +528,6 @@ int main(int argc, char **argv) exit(99); } - if(::arg().mustDo("fancy-records")) { - reportFancyTypes(); - } - if(!::arg().asNum("local-port")) { L< lines; reportAllTypes(); - reportFancyTypes(); #if __GNUC__ >= 3 std::ios_base::sync_with_stdio(false); #endif diff --git a/pdns/zone2lmdb.cc b/pdns/zone2lmdb.cc index 52aa9a43d..f62ee8f57 100644 --- a/pdns/zone2lmdb.cc +++ b/pdns/zone2lmdb.cc @@ -197,7 +197,6 @@ int main(int argc, char **argv) try { reportAllTypes(); - reportFancyTypes(); #if __GNUC__ >= 3 std::ios_base::sync_with_stdio(false); #endif diff --git a/pdns/zone2sql.cc b/pdns/zone2sql.cc index e8670e2b1..003047622 100644 --- a/pdns/zone2sql.cc +++ b/pdns/zone2sql.cc @@ -280,7 +280,6 @@ int main(int argc, char **argv) try { reportAllTypes(); - reportFancyTypes(); #if __GNUC__ >= 3 std::ios_base::sync_with_stdio(false); #endif diff --git a/regression-tests.nobackend/edns-packet-cache/command b/regression-tests.nobackend/edns-packet-cache/command index 1c4414f16..ff5713e11 100755 --- a/regression-tests.nobackend/edns-packet-cache/command +++ b/regression-tests.nobackend/edns-packet-cache/command @@ -26,8 +26,7 @@ rm -f pdns*.pid ../pdns/pdns_server --daemon=no --local-port=$port --socket-dir=./ \ --no-shuffle --launch=bind --bind-config=edns-packet-cache/named.conf \ - --fancy-records --send-root-referral \ - --cache-ttl=60 --no-config & + --send-root-referral --cache-ttl=60 --no-config & bindwait # prime cache without EDNS diff --git a/regression-tests/tests/fancy-axfr/command b/regression-tests/tests/fancy-axfr/command deleted file mode 100755 index 50b8bf069..000000000 --- a/regression-tests/tests/fancy-axfr/command +++ /dev/null @@ -1,3 +0,0 @@ -#!/bin/sh - -#cleandig example.com AXFR @$nameserver \ No newline at end of file diff --git a/regression-tests/tests/fancy-axfr/description b/regression-tests/tests/fancy-axfr/description deleted file mode 100644 index 8e70c9c0c..000000000 --- a/regression-tests/tests/fancy-axfr/description +++ /dev/null @@ -1 +0,0 @@ -This tries to transfer a small zone with fancy records over AXFR. diff --git a/regression-tests/tests/fancy-axfr/expected_result b/regression-tests/tests/fancy-axfr/expected_result deleted file mode 100644 index e69de29bb..000000000