From: Kees Monshouwer Date: Sat, 13 Jul 2013 09:06:19 +0000 (+0200) Subject: cleanup, remove whitespace X-Git-Tag: rec-3.6.0-rc1~556^2~3^2 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=914353cadfd178585b98c115a692621d07f49d04;p=thirdparty%2Fpdns.git cleanup, remove whitespace --- diff --git a/pdns/backends/gsql/gsqlbackend.cc b/pdns/backends/gsql/gsqlbackend.cc index 63217e463e..ec135e677a 100644 --- a/pdns/backends/gsql/gsqlbackend.cc +++ b/pdns/backends/gsql/gsqlbackend.cc @@ -346,6 +346,7 @@ bool GSQLBackend::nullifyDNSSECOrderNameAndUpdateAuth(uint32_t domain_id, const if(!d_dnssecQueries) return false; char output[1024]; + snprintf(output, sizeof(output)-1, d_nullifyOrderNameAndUpdateAuthQuery.c_str(), auth, domain_id, sqlEscape(qname).c_str()); try { d_db->doCommand(output); @@ -361,6 +362,7 @@ bool GSQLBackend::nullifyDNSSECOrderNameAndAuth(uint32_t domain_id, const std::s if(!d_dnssecQueries) return false; char output[1024]; + snprintf(output, sizeof(output)-1, d_nullifyOrderNameAndAuthQuery.c_str(), sqlEscape(qname).c_str(), sqlEscape(type).c_str(), domain_id); try { d_db->doCommand(output); @@ -901,7 +903,7 @@ bool GSQLBackend::get(DNSResourceRecord &r) bool GSQLBackend::replaceRRSet(uint32_t domain_id, const string& qname, const QType& qt, const vector& rrset) { - string deleteQuery; + string deleteQuery; string deleteRRSet; if (qt != QType::ANY) { deleteRRSet = "delete from records where domain_id = %d and name='%s' and type='%s'"; diff --git a/pdns/common_startup.cc b/pdns/common_startup.cc old mode 100755 new mode 100644 index 7f35aac40d..d126cd9bcf --- a/pdns/common_startup.cc +++ b/pdns/common_startup.cc @@ -77,6 +77,7 @@ void declareArguments() ::arg().set("recursor","If recursion is desired, IP address of a recursing nameserver")="no"; ::arg().set("allow-recursion","List of subnets that are allowed to recurse")="0.0.0.0/0"; ::arg().set("pipebackend-abi-version","Version of the pipe backend ABI")="1"; + ::arg().set("udp-truncation-threshold", "Maximum UDP response size before we truncate")="1680"; ::arg().set("disable-tcp","Do not listen to TCP queries")="no"; ::arg().set("disable-axfr","Do not allow zone transfers")="no"; @@ -180,7 +181,6 @@ void declareStats(void) S.declare("rfc2136-refused", "RFC2136 packets that are refused."); S.declare("rfc2136-changes", "RFC2136 changes to records in total."); - S.declare("servfail-packets","Number of times a server-failed packet was sent out"); S.declare("latency","Average number of microseconds needed to answer a question"); S.declare("timedout-packets","Number of packets which weren't answered within timeout set"); diff --git a/pdns/dns.hh b/pdns/dns.hh index 1de3c203b7..4fafa8051d 100644 --- a/pdns/dns.hh +++ b/pdns/dns.hh @@ -110,7 +110,7 @@ public: ar & d_place; ar & auth; } - + bool operator==(const DNSResourceRecord& rhs); bool operator<(const DNSResourceRecord &b) const diff --git a/pdns/dnspacket.cc b/pdns/dnspacket.cc index aa43c4d8a5..27fc3b1e50 100644 --- a/pdns/dnspacket.cc +++ b/pdns/dnspacket.cc @@ -43,8 +43,8 @@ bool DNSPacket::s_doEDNSSubnetProcessing; uint16_t DNSPacket::s_udpTruncationThreshold; - -DNSPacket::DNSPacket() + +DNSPacket::DNSPacket() { d_wrapped=false; d_compress=true; diff --git a/pdns/dnsparser.cc b/pdns/dnsparser.cc old mode 100755 new mode 100644 index 5554b97555..be40fea14e --- a/pdns/dnsparser.cc +++ b/pdns/dnsparser.cc @@ -176,7 +176,7 @@ DNSRecordContent* DNSRecordContent::mastermake(const DNSRecord &dr, PacketReader // For section 3.2.3, we do need content so we need to get it properly. But only for the correct Qclasses. if (oc == Opcode::Update && dr.d_place == DNSRecord::Answer && dr.d_class != 1) return new UnknownRecordContent(dr, pr); - + uint16_t searchclass = (dr.d_type == QType::OPT) ? 1 : dr.d_class; // class is invalid for OPT typemap_t::const_iterator i=getTypemap().find(make_pair(searchclass, dr.d_type)); diff --git a/pdns/dnsrecords.cc b/pdns/dnsrecords.cc index 35d863a9ee..7859d8b333 100644 --- a/pdns/dnsrecords.cc +++ b/pdns/dnsrecords.cc @@ -67,11 +67,11 @@ bool DNSResourceRecord::operator==(const DNSResourceRecord& rhs) { string lcontent=toLower(content); string rcontent=toLower(rhs.content); - + string llabel=toLower(qname); string rlabel=toLower(rhs.qname); - - return + + return tie(llabel, qtype, lcontent, ttl, priority) == tie(rlabel, rhs.qtype, rcontent, rhs.ttl, rhs.priority); } @@ -83,7 +83,7 @@ DNSResourceRecord::DNSResourceRecord(const DNSRecord &p) { qname = p.d_label; if(!qname.empty()) boost::erase_tail(qname, 1); // strip . - + qtype = p.d_type; ttl = p.d_ttl; priority=0; diff --git a/pdns/dnssecinfra.cc b/pdns/dnssecinfra.cc index 199a8cd733..82f76200f2 100644 --- a/pdns/dnssecinfra.cc +++ b/pdns/dnssecinfra.cc @@ -477,7 +477,7 @@ string makeTSIGMessageFromTSIGPacket(const string& opacket, unsigned int tsigOff dw.xfrLabel(keyname, false); dw.xfr16BitInt(0xff); // class dw.xfr32BitInt(0); // TTL - dw.xfrLabel(toLower(trc.d_algoName), false); + dw.xfrLabel(toLower(trc.d_algoName), false); } uint32_t now = trc.d_time; diff --git a/pdns/docs/pdns.xml b/pdns/docs/pdns.xml index 54fcea6587..662e1b82be 100755 --- a/pdns/docs/pdns.xml +++ b/pdns/docs/pdns.xml @@ -13229,8 +13229,8 @@ sql> insert into domainmetadata (domain_id, kind, content) values (7,'ALLOW-AXFR ALLOW-2136-FROM - This setting has the same function as described in the configuration options (See ). - Only one item is allowed per row, but multiple rows can be added. + This setting has the same function as described in the configuration options (See ). + Only one item is allowed per row, but multiple rows can be added. An example: sql> select id from domains where name='powerdnssec.org'; @@ -13238,7 +13238,7 @@ sql> select id from domains where name='powerdnssec.org'; sql> insert into domainmetadata(domain_id, kind, content) values(5, ‘ALLOW-2136-FROM’,’10.0.0.0/8’); sql> insert into domainmetadata(domain_id, kind, content) values(5, ‘ALLOW-2136-FROM’,’192.168.1.2/32’); - + This will allow 10.0.0.0/8 and 192.168.1.2/32 to send RFC2136 update messages for the powerdnssec.org domain. @@ -13256,10 +13256,10 @@ sql> select id from domains where name='powerdnssec.org'; 5 sql> insert into domainmetadata (domain_id, kind, content) values (5, 'TSIG-ALLOW-2136', 'test'); - + An example of how to use a TSIG key with the nsupdate command: -nsupdate <<! +nsupdate <<! server <ip> <port> zone powerdnssec.org update add test1.powerdnssec.org 3600 A 192.168.1.1 @@ -13268,7 +13268,7 @@ send ! - If a TSIG key is set for the domain, it is required to be used for the update. + If a TSIG key is set for the domain, it is required to be used for the update. The TSIG is extra security on top of the ALLOW-2136-FROM setting. If a TSIG key is set, the IP(-range) still needs to be allowed via ALLOW-2136-FROM. @@ -13284,7 +13284,7 @@ sql> select id from domains where name='powerdnssec.org'; 5 sql> insert into domainmetadata(domain_id, kind, content) values(5, ‘FORWARD-2136’,’’); - + There is no content, the existance of the entry enables the forwarding. This domain-specific setting is only useful when the configuration option forward-2136 is set to 'no', as that will disable it globally. Using the domainmetadata setting than allows you to enable it per domain. @@ -13329,7 +13329,7 @@ sql> insert into domainmetadata(domain_id, kind, content) values(5, ‘SOA-EDIT- DEFAULT - Generate a soa serial of YYYYMMDD01. If the current serial is lower than the generated serial, + Generate a soa serial of YYYYMMDD01. If the current serial is lower than the generated serial, use the generated serial. If the current serial is higher or equal to the generated serial, increase the current serial by 1. @@ -13357,7 +13357,7 @@ sql> insert into domainmetadata(domain_id, kind, content) values(5, ‘SOA-EDIT- SOA-EDIT-INCREASE - Change the serial to whatever SOA-EDIT would provide. If what SOA-EDIT provides is lower than the current serial, + Change the serial to whatever SOA-EDIT would provide. If what SOA-EDIT provides is lower than the current serial, increase the current serial by 1. @@ -13382,7 +13382,7 @@ dnssec-keygen -a hmac-md5 -b 128 -n USER dhcpdupdate -rw------- 1 root root 53 Aug 26 19:29 Kdhcpdupdate.+157+20493.key -rw------- 1 root root 165 Aug 26 19:29 Kdhcpdupdate.+157+20493.private -# cat Kdhcpdupdate.+157+20493.key +# cat Kdhcpdupdate.+157+20493.key dhcpdupdate. IN KEY 0 3 157 FYhvwsW1ZtFZqWzsMpqhbg== The important bits are the name of the key (dhcpdupdate) and the hash of the key (FYhvwsW1ZtFZqWzsMpqhbg== @@ -13419,7 +13419,7 @@ ddns-domainname "powerdnssec.org"; ddns-rev-domainname "in-addr.arpa."; zone powerdnssec.org { - primary 127.0.0.1; + primary 127.0.0.1; key dhcpdupdate; } @@ -13441,7 +13441,7 @@ zone 1.168.192.in-addr.arpa. { Setting up PowerDNS A number of small changes are needed to powerdns to make it accept dynamic updates from dhcpd. - Enabled RFC2136 (dynamic update) support functionality in PowerDNS by adding the following to the + Enabled RFC2136 (dynamic update) support functionality in PowerDNS by adding the following to the PowerDNS configuration file (pdns.conf). experimental-rfc2136=yes @@ -13454,7 +13454,7 @@ allow-2136-from= - We just told powerdns (via the configuration file) that we accept updates from nobody via the + We just told powerdns (via the configuration file) that we accept updates from nobody via the allow-2136-from parameter. That's not very useful, so we're going to give permissions per zone, via the domainmetadata table. @@ -13480,18 +13480,18 @@ sql> insert into domainmetadata (domain_id, kind, content) values (6, 'TSIG-ALLO Add the 'dhcpdupdate' key to our PowerDNSinstallation Associate the domains with the given TSIG key - + Restart PowerDNS and you should be ready to go! - + - + How it works This is a short description of how RFC2136 (update) messages are processed by PowerDNS. - The RFC2136 message is received. If it is TSIG signed, the TSIG is validated against the tsigkeys table. + The RFC2136 message is received. If it is TSIG signed, the TSIG is validated against the tsigkeys table. If it is not valid, Refused is returned to the requestor. A check is performed on the zone to see if it is a valid zone. ServFail is returned when not valid. @@ -13501,7 +13501,7 @@ sql> insert into domainmetadata (domain_id, kind, content) values (6, 'TSIG-ALLO If the requestor (sender of the update message) does not match the values in ALLOW-2136-FROM, Refused is returned. - If the message is TSIG signed, the TSIG keyname is compared with the TSIG keyname in domainmetadata. If they do not match, a Refused is send. + If the message is TSIG signed, the TSIG keyname is compared with the TSIG keyname in domainmetadata. If they do not match, a Refused is send. The TSIG-ALLOW-2136 domainmetadata setting is used to find which key belongs to the domain. The backends are queried to find the backend for the given domain. @@ -13520,7 +13520,7 @@ sql> insert into domainmetadata (domain_id, kind, content) values (6, 'TSIG-ALLO Per record in the update message, a the prescan checks are performed. If the prescan fails, the corresponding RCode is returned. - If the prescan for the record is correct, the actual update/delete/modify of the record is performed. + If the prescan for the record is correct, the actual update/delete/modify of the record is performed. If the update fails (for whatever reason), ServFail is returned. After changes to the records have been applied, the ordername and auth flag are set to make sure DNSSEC remains working. The cache for that record is purged. @@ -22249,7 +22249,7 @@ static RandomLoader randomloader; RFC2136 support - To make your backend RFC2136 compatible, it needs to implement a number of new functions and functions already used for slave-operation. + To make your backend RFC2136 compatible, it needs to implement a number of new functions and functions already used for slave-operation. The new functions are not RFC2136 specific and might be used for other update/remove functionality at a later stage. class DNSBackend { @@ -22266,7 +22266,7 @@ public: - + @@ -22274,7 +22274,7 @@ public: virtual bool startTransaction(const string &qname, int id); - See . Please note that this function now receives a negative number (-1), which indicates that + See . Please note that this function now receives a negative number (-1), which indicates that the current zone data should NOT be deleted. @@ -22301,7 +22301,7 @@ public: virtual bool listSubZone(const string &name, int domain_id); - This method is needed for rectification of a zone after NS-records have been added. For DNSSEC, we need to know which records + This method is needed for rectification of a zone after NS-records have been added. For DNSSEC, we need to know which records are below the currently added record. listSubZone() is used like list() which means PowerDNS will call get() after this method. @@ -22310,7 +22310,7 @@ public: // First %s is 'sub.zone.com', second %s is '*.sub.zone.com' select content,ttl,prio,type,domain_id,name from records where (name='%s' OR name like '%s') and domain_id=%d - The method is not only used when adding records, but also to correct ENT-records in powerdns. Make sure it returns every record in the tree + The method is not only used when adding records, but also to correct ENT-records in powerdns. Make sure it returns every record in the tree below the given record. @@ -22319,9 +22319,9 @@ select content,ttl,prio,type,domain_id,name from records where (name='%s' OR nam virtual bool replaceRRSet(uint32_t domain_id, const string& qname, const QType& qt, const vector<DNSResourceRecord>& rrset); - This method should remove all the records with qname of type qt. qt - might also be ANY, which means all the records with that qname need to be removed. - After removal, the records in rrset must be added to the zone. rrset can be empty in which case the method is used to remove a RRset. + This method should remove all the records with qname of type qt. qt + might also be ANY, which means all the records with that qname need to be removed. + After removal, the records in rrset must be added to the zone. rrset can be empty in which case the method is used to remove a RRset. diff --git a/pdns/packetcache.cc b/pdns/packetcache.cc index d62b7294ef..0acbf725dd 100644 --- a/pdns/packetcache.cc +++ b/pdns/packetcache.cc @@ -253,7 +253,6 @@ int PacketCache::purge(const string &match) *d_statnumentries=d_map.size(); return delcount; } - // called from ueberbackend bool PacketCache::getEntry(const string &qname, const QType& qtype, CacheEntryType cet, string& value, int zoneID, bool meritsRecursion, unsigned int maxReplyLen, bool dnssecOk, bool hasEDNS) diff --git a/pdns/packethandler.cc b/pdns/packethandler.cc index 04497dec60..bef0381274 100644 --- a/pdns/packethandler.cc +++ b/pdns/packethandler.cc @@ -1124,8 +1124,8 @@ DNSPacket *PacketHandler::questionOrRecurse(DNSPacket *p, bool *shouldRecurse) L<d.opcode == Opcode::Update) - r->setRcode(RCode::Refused); - else + r->setRcode(RCode::Refused); + else r->setRcode(RCode::NotAuth); return r; } diff --git a/pdns/qtype.cc b/pdns/qtype.cc index a3a44bb204..b4068347de 100644 --- a/pdns/qtype.cc +++ b/pdns/qtype.cc @@ -37,7 +37,7 @@ QType::QType() bool QType::isSupportedType() { for(vector::iterator pos=names.begin();possecond==code) + if(pos->second==code) return true; return false; } @@ -47,13 +47,12 @@ bool QType::isMetadataType() { code == QType::MAILA || code == QType::MAILB || code == QType::TSIG || - code == QType::IXFR) + code == QType::IXFR) return true; return false; } - uint16_t QType::getCode() const { return code; diff --git a/pdns/qtype.hh b/pdns/qtype.hh index d892bdfb84..617a524795 100644 --- a/pdns/qtype.hh +++ b/pdns/qtype.hh @@ -76,11 +76,11 @@ public: static int chartocode(const char *p); //!< convert a character string to a code // more solaris fun -#undef DS - enum typeenum {A=1,NS=2, CNAME=5, SOA=6, MR=9, PTR=12, HINFO=13, MX=15, TXT=16, RP=17, AFSDB=18, SIG=24, KEY=25, AAAA=28, LOC=29, SRV=33, NAPTR=35, KX=36, +#undef DS + enum typeenum {A=1, NS=2, CNAME=5, SOA=6, MR=9, PTR=12, HINFO=13, MX=15, TXT=16, RP=17, AFSDB=18, SIG=24, KEY=25, AAAA=28, LOC=29, SRV=33, NAPTR=35, KX=36, CERT=37, A6=38, OPT=41, DS=43, SSHFP=44, IPSECKEY=45, RRSIG=46, NSEC=47, DNSKEY=48, DHCID=49, NSEC3=50, NSEC3PARAM=51, TLSA=52, SPF=99, EUI48=108, EUI64=109, TSIG=250, IXFR=251, AXFR=252, MAILB=253, MAILA=254, ANY=255, URL=256, MBOXFW=257, CURL=258, ADDR=259, DLV=32769} types; - typedef pair namenum; + typedef pair namenum; static vector names; inline bool operator==(const QType &comp) const { @@ -117,17 +117,17 @@ private: init() { - qtype_insert("A",1); - qtype_insert("NS",2); - qtype_insert("CNAME",5); - qtype_insert("SOA",6); - qtype_insert("MR",9); - qtype_insert("PTR",12); - qtype_insert("HINFO",13); - qtype_insert("MINFO",14); - qtype_insert("MX",15); - qtype_insert("TXT",16); - qtype_insert("RP",17); + qtype_insert("A", 1); + qtype_insert("NS", 2); + qtype_insert("CNAME", 5); + qtype_insert("SOA", 6); + qtype_insert("MR", 9); + qtype_insert("PTR", 12); + qtype_insert("HINFO", 13); + qtype_insert("MINFO", 14); + qtype_insert("MX", 15); + qtype_insert("TXT", 16); + qtype_insert("RP", 17); qtype_insert("AFSDB", 18); qtype_insert("SIG", 24); qtype_insert("KEY", 25); @@ -152,7 +152,7 @@ private: qtype_insert("SPF", 99); qtype_insert("EUI48", 108); qtype_insert("EUI64", 109); - qtype_insert("TSIG", 250); +// qtype_insert("TSIG", 250); qtype_insert("IXFR", 251); qtype_insert("AXFR", 252); qtype_insert("MAILB", 253); diff --git a/pdns/resolver.cc b/pdns/resolver.cc index 13043c1ff8..148a0f448d 100644 --- a/pdns/resolver.cc +++ b/pdns/resolver.cc @@ -155,9 +155,9 @@ static int parseResult(MOADNSParser& mdp, const std::string& origQname, uint16_t throw ResolverException(string("resolver: received an answer to another question (")+mdp.d_qname+"!="+ origQname+".)"); } - vector ret; + vector ret; DNSResourceRecord rr; - for(MOADNSParser::answers_t::const_iterator i=mdp.d_answers.begin(); i!=mdp.d_answers.end(); ++i) { + for(MOADNSParser::answers_t::const_iterator i=mdp.d_answers.begin(); i!=mdp.d_answers.end(); ++i) { rr.qname = i->first.d_label; if(!rr.qname.empty()) boost::erase_tail(rr.qname, 1); // strip . @@ -165,7 +165,7 @@ static int parseResult(MOADNSParser& mdp, const std::string& origQname, uint16_t rr.ttl = i->first.d_ttl; rr.content = i->first.d_content->getZoneRepresentation(); rr.priority = 0; - + uint16_t qtype=rr.qtype.getCode(); if(!rr.content.empty() && (qtype==QType::MX || qtype==QType::NS || qtype==QType::CNAME)) diff --git a/pdns/rfc2136handler.cc b/pdns/rfc2136handler.cc index 83371ec8a7..f063d80f2b 100644 --- a/pdns/rfc2136handler.cc +++ b/pdns/rfc2136handler.cc @@ -38,13 +38,13 @@ int PacketHandler::checkUpdatePrerequisites(const DNSRecord *rr, DomainInfo *di) foundRecord=true; } - // Section 3.2.1 - if (rr->d_class == QClass::ANY && !foundRecord) { - if (rr->d_type == QType::ANY) + // Section 3.2.1 + if (rr->d_class == QClass::ANY && !foundRecord) { + if (rr->d_type == QType::ANY) return RCode::NXDomain; if (rr->d_type != QType::ANY) return RCode::NXRRSet; - } + } // Section 3.2.2 if (rr->d_class == QClass::NONE && foundRecord) { @@ -61,7 +61,7 @@ int PacketHandler::checkUpdatePrerequisites(const DNSRecord *rr, DomainInfo *di) // Method implements section 3.4.1 of RFC2136 int PacketHandler::checkUpdatePrescan(const DNSRecord *rr) { // The RFC stats that d_class != ZCLASS, but we only support the IN class. - if (rr->d_class != QClass::IN && rr->d_class != QClass::NONE && rr->d_class != QClass::ANY) + if (rr->d_class != QClass::IN && rr->d_class != QClass::NONE && rr->d_class != QClass::ANY) return RCode::FormErr; QType qtype = QType(rr->d_type); @@ -74,7 +74,7 @@ int PacketHandler::checkUpdatePrescan(const DNSRecord *rr) { if (rr->d_class == QClass::ANY && rr->d_clen != 0) return RCode::FormErr; - + if (qtype.isMetadataType()) return RCode::FormErr; @@ -94,7 +94,7 @@ uint16_t PacketHandler::performUpdate(const string &msgPrefix, const DNSRecord * if (rrType == QType::NSEC || rrType == QType::NSEC3) { L<d_iterations, ns3pr->d_salt, rrLabel))); if (*narrow) @@ -268,7 +268,7 @@ uint16_t PacketHandler::performUpdate(const string &msgPrefix, const DNSRecord * if (pdns_iequals(di->zone, shorter)) break; - + bool foundShorter = false; di->backend->lookup(QType(QType::ANY), shorter); while (di->backend->get(rec)) { @@ -290,9 +290,9 @@ uint16_t PacketHandler::performUpdate(const string &msgPrefix, const DNSRecord * if(*haveNSEC3) { string hashed; - if(! *narrow) + if(! *narrow) hashed=toLower(toBase32Hex(hashQNameWithSalt(ns3pr->d_iterations, ns3pr->d_salt, rrLabel))); - + if (*narrow) di->backend->nullifyDNSSECOrderNameAndUpdateAuth(di->id, rrLabel, auth); else @@ -303,7 +303,7 @@ uint16_t PacketHandler::performUpdate(const string &msgPrefix, const DNSRecord * if(!auth) { - if (ns3pr->d_flags) + if (ns3pr->d_flags) di->backend->nullifyDNSSECOrderNameAndAuth(di->id, rrLabel, "NS"); di->backend->nullifyDNSSECOrderNameAndAuth(di->id, rrLabel, "A"); di->backend->nullifyDNSSECOrderNameAndAuth(di->id, rrLabel, "AAAA"); @@ -323,7 +323,7 @@ uint16_t PacketHandler::performUpdate(const string &msgPrefix, const DNSRecord * // If we insert an NS, all the records below it become non auth - so, we're inserting a delegate. - // Auth can only be false when the rrLabel is not the zone + // Auth can only be false when the rrLabel is not the zone if (auth == false && rrType == QType::NS) { DLOG(L<::const_iterator qname=qnames.begin(); qname != qnames.end(); ++qname) { if(*haveNSEC3) { string hashed; - if(! *narrow) + if(! *narrow) hashed=toLower(toBase32Hex(hashQNameWithSalt(ns3pr->d_iterations, ns3pr->d_salt, *qname))); - + if (*narrow) di->backend->nullifyDNSSECOrderNameAndUpdateAuth(di->id, rrLabel, auth); else @@ -357,14 +357,14 @@ uint16_t PacketHandler::performUpdate(const string &msgPrefix, const DNSRecord * } } // rr->d_class == QClass::IN - + // Delete records - section 3.4.2.3 and 3.4.2.4 with the exception of the 'always leave 1 NS rule' as that's handled by // the code that calls this performUpdate(). if ((rr->d_class == QClass::ANY || rr->d_class == QClass::NONE) && rrType != QType::SOA) { // never delete a SOA. DLOG(L<d_class<<"; rrType: "<d_class == QClass::ANY) d_dk.unsetNSEC3PARAM(rrLabel); else if (rr->d_class == QClass::NONE) { @@ -373,7 +373,7 @@ uint16_t PacketHandler::performUpdate(const string &msgPrefix, const DNSRecord * d_dk.unsetNSEC3PARAM(rrLabel); else return 0; - } else + } else return 0; // We retrieve new values, other RR's in this update package might need it as well. @@ -468,9 +468,9 @@ uint16_t PacketHandler::performUpdate(const string &msgPrefix, const DNSRecord * for (vector::const_iterator changeRec=updateAuthFlag.begin(); changeRec!=updateAuthFlag.end(); ++changeRec) { if(*haveNSEC3) { string hashed; - if(! *narrow) + if(! *narrow) hashed=toLower(toBase32Hex(hashQNameWithSalt(ns3pr->d_iterations, ns3pr->d_salt, *changeRec))); - + di->backend->updateDNSSECOrderAndAuthAbsolute(di->id, *changeRec, hashed, true); } else // NSEC @@ -509,7 +509,7 @@ uint16_t PacketHandler::performUpdate(const string &msgPrefix, const DNSRecord * // if we delete b.c.d.e.test.com, we go up to d.e.test.com and then find b.d.e.test.com because that's below d.e.test.com. // At that point we can stop deleting ENT's because the tree is in tact again. di->backend->listSubZone(shorter, di->id); - + while (di->backend->get(rec)) { if (rec.qtype.getCode()) foundRealRR = true; @@ -536,7 +536,7 @@ uint16_t PacketHandler::performUpdate(const string &msgPrefix, const DNSRecord * if(*haveNSEC3) { string hashed; - if(! *narrow) + if(! *narrow) hashed=toLower(toBase32Hex(hashQNameWithSalt(ns3pr->d_iterations, ns3pr->d_salt, *i))); di->backend->updateDNSSECOrderAndAuthAbsolute(di->id, *i, hashed, true); } @@ -587,7 +587,7 @@ int PacketHandler::forwardPacket(const string &msgPrefix, DNSPacket *p, DomainIn uint16_t len=htons(forwardPacket.getString().length()); string buffer((const char*)&len, 2); buffer.append(forwardPacket.getString()); - if(write(sock, buffer.c_str(), buffer.length()) < 0) { + if(write(sock, buffer.c_str(), buffer.length()) < 0) { L<d.id) + ") from " + p->getRemote() + " for " + p->qdomain + ": "; L< allowedRanges; B.getDomainMetadata(p->qdomain, "ALLOW-2136-FROM", allowedRanges); - if (! ::arg()["allow-2136-from"].empty()) + if (! ::arg()["allow-2136-from"].empty()) stringtok(allowedRanges, ::arg()["allow-2136-from"], ", \t" ); NetmaskGroup ng; for(vector::const_iterator i=allowedRanges.begin(); i != allowedRanges.end(); i++) ng.addMask(*i); - + if ( ! ng.match(&p->d_remote)) { L<qdomain, "TSIG-ALLOW-2136", tsigKeys); if (tsigKeys.size() > 0) { bool validKey = false; - + TSIGRecordContent trc; string inputkey, message; if (! p->getTSIGDetails(&trc, &inputkey, &message)) { @@ -690,13 +690,13 @@ int PacketHandler::processUpdate(DNSPacket *p) { L<getString()); if (mdp.d_header.qdcount != 1) { L<qtype.getCode() != QType::SOA) { // RFC2136 2.3 - ZTYPE must be SOA L<first; // Skip this check for other field types (like the TSIG - which is in the additional section) // For a TSIG, the label is the dnskey, so it does not pass the endOn validation. - if (! (rr->d_place == DNSRecord::Answer || rr->d_place == DNSRecord::Nameserver)) + if (! (rr->d_place == DNSRecord::Answer || rr->d_place == DNSRecord::Nameserver)) continue; string label = stripDot(rr->d_label); @@ -742,7 +742,7 @@ int PacketHandler::processUpdate(DNSPacket *p) { return RCode::NotImp; } - // 3.2.1 and 3.2.2 - Prerequisite check + // 3.2.1 and 3.2.2 - Prerequisite check for(MOADNSParser::answers_t::const_iterator i=mdp.d_answers.begin(); i != mdp.d_answers.end(); ++i) { const DNSRecord *rr = &i->first; if (rr->d_place == DNSRecord::Answer) { @@ -752,7 +752,7 @@ int PacketHandler::processUpdate(DNSPacket *p) { di.backend->abortTransaction(); return res; } - } + } } // 3.2.3 - Prerequisite check - this is outside of updatePrequisitesCheck because we check an RRSet and not the RR. @@ -764,7 +764,7 @@ int PacketHandler::processUpdate(DNSPacket *p) { const DNSRecord *rr = &i->first; if (rr->d_place == DNSRecord::Answer) { // Last line of 3.2.3 - if (rr->d_class != QClass::IN && rr->d_class != QClass::NONE && rr->d_class != QClass::ANY) + if (rr->d_class != QClass::IN && rr->d_class != QClass::NONE && rr->d_class != QClass::ANY) return RCode::FormErr; if (rr->d_class == QClass::IN) { @@ -789,7 +789,7 @@ int PacketHandler::processUpdate(DNSPacket *p) { foundRR++; for(rrVector_t::iterator rrItem=vec->begin(); rrItem != vec->end(); ++rrItem) { rrItem->ttl = rec.ttl; // The compare one line below also compares TTL, so we make them equal because TTL is not user within prerequisite checks. - if (*rrItem == rec) + if (*rrItem == rec) matchRR++; } } @@ -822,7 +822,7 @@ int PacketHandler::processUpdate(DNSPacket *p) { bool updatedSerial=false; NSEC3PARAMRecordContent ns3pr; - bool narrow=false; + bool narrow=false; bool haveNSEC3 = d_dk.getNSEC3PARAM(di.zone, &ns3pr, &narrow); bool isPresigned = d_dk.isPresigned(di.zone); @@ -866,7 +866,7 @@ int PacketHandler::processUpdate(DNSPacket *p) { L< rrset; diff --git a/regression-tests/0dyndns-prereq-all/command b/regression-tests/0dyndns-prereq-all/command index b90cab9aca..e268961bd1 100755 --- a/regression-tests/0dyndns-prereq-all/command +++ b/regression-tests/0dyndns-prereq-all/command @@ -18,7 +18,7 @@ answer cleandig host-1.test.dyndns ANY # check if the record exists, should result in an NXRRSET (section 3.2.1) -# if the check fails, it will delete a record. +# if the check fails, it will delete a record. cleannsupdate <push(update => rr_add('host-invalid.test.dyndns.')); my $res = Net::DNS::Resolver->new; $res->nameservers($ARGV[0]); $res->port($ARGV[1]); - + my $reply = $res->send($update); - + if ($reply) { print "RCODE: ", $reply->header->rcode, "\n"; } else { diff --git a/regression-tests/1dyndns-update-delegate-in-between/command b/regression-tests/1dyndns-update-delegate-in-between/command index a68cf0e365..54ca3e7063 100755 --- a/regression-tests/1dyndns-update-delegate-in-between/command +++ b/regression-tests/1dyndns-update-delegate-in-between/command @@ -17,7 +17,7 @@ cleannsupdate <> skipped_tests skipped=$[$skipped+1] - else + else $a/command > $a/real_result expected=$a/expected_result for extracontext in $extracontexts diff --git a/regression-tests/start-test-stop b/regression-tests/start-test-stop index 165cf810c1..dbdba21e43 100755 --- a/regression-tests/start-test-stop +++ b/regression-tests/start-test-stop @@ -717,18 +717,18 @@ rm pdns*.pid for zone in $(grep zone named.conf | cut -f2 -d\") do - mv $zone.backup $zone + mv $zone.backup $zone done failed_tests=`wc -l failed_tests | cut -f 1 -d ' '` if [ $failed_tests = 0 ]; then - exit 0; + exit 0; else for t in `cat failed_tests` do echo $t cat $t/diff done - exit 1; + exit 1; fi