From: Pieter Lexis Date: Tue, 28 Jun 2016 09:48:47 +0000 (+0200) Subject: Remove DNSName.toString() in many places in pdnsutil X-Git-Tag: rec-4.0.0~22^2~8 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=0b34684a6962c59c4e5e5f26d00b657db1431522;p=thirdparty%2Fpdns.git Remove DNSName.toString() in many places in pdnsutil --- diff --git a/pdns/pdnsutil.cc b/pdns/pdnsutil.cc index 3b64ddb59e..85c7d6fbf8 100644 --- a/pdns/pdnsutil.cc +++ b/pdns/pdnsutil.cc @@ -144,7 +144,7 @@ void loadMainConfig(const std::string& configdir) bool rectifyZone(DNSSECKeeper& dk, const DNSName& zone) { if(dk.isPresigned(zone)){ - cerr<<"Rectify presigned zone '"<list(zone, sd.domain_id); @@ -189,9 +189,9 @@ bool rectifyZone(DNSSECKeeper& dk, const DNSName& zone) cerr<<"Adding NSEC ordering information "< '"<< ordername.toString() <<"'"< '"<< ordername <<"'"<updateDNSSECOrderNameAndAuth(sd.domain_id, zone, qname, ordername, auth); if(realrr) @@ -284,7 +284,7 @@ bool rectifyZone(DNSSECKeeper& dk, const DNSName& zone) { if(!(maxent)) { - cerr<<"Zone '"< 222) { numerrors++; - cout<<"[Error] zone '" << zone.toStringNoDot() << "' has NSEC3 semantics but is too long to have the hash prepended. Zone name is " << zone.wirelength() << " bytes long, whereas the maximum is 222 bytes." << endl; + cout<<"[Error] zone '" << zone << "' has NSEC3 semantics but is too long to have the hash prepended. Zone name is " << zone.wirelength() << " bytes long, whereas the maximum is 222 bytes." << endl; } if (!validKeys) { numerrors++; - cout<<"[Error] zone '" << zone.toStringNoDot() << "' has at least one invalid DNS Private Key." << endl; + cout<<"[Error] zone '" << zone << "' has at least one invalid DNS Private Key." << endl; } // Check for delegation in parent zone @@ -429,7 +429,7 @@ int checkZone(DNSSECKeeper &dk, UeberBackend &B, const DNSName& zone, const vect while(B.get(rr)) ns |= (rr.qtype == QType::NS); if (!ns) { - cout<<"[Error] No delegation for zone '"<getZoneRepresentation(false); } if(!pdns_iequals(tmp, rr.content)) { - cout<<"[Warning] Parsed and original record content are not equal: "<(toLower(content.str()), rr.ttl)); if (ret.second == false && ret.first->second != rr.ttl) { - cout<<"[Error] TTL mismatch in rrset: '"<second<<" != "<second<<" != "< 1) { - cerr< '"<< ordername.toString() <<"'"< '"<< ordername <<"'"<updateDNSSECOrderNameAndAuth(sd.domain_id, zone, rrs[0].qname, ordername, true); } sd.db->commitTransaction(); - cout<<"SOA serial for zone "<deleteDomain(zone)) return EXIT_SUCCESS; - cerr<<"Failed to delete domain '"< 29) cout<list(zone, di.id); @@ -881,7 +881,7 @@ int listZone(const DNSName &zone) { if ( (rr.qtype.getCode() == QType::NS || rr.qtype.getCode() == QType::SRV || rr.qtype.getCode() == QType::MX || rr.qtype.getCode() == QType::CNAME) && !rr.content.empty() && rr.content[rr.content.size()-1] != '.') rr.content.append(1, '.'); - cout<startTransaction(zone, di.id)) { - cerr<<"Unable to start transaction for load of zone '"<commitTransaction(); @@ -936,7 +936,7 @@ int editZone(DNSSECKeeper& dk, const DNSName &zone) { DomainInfo di; if (! B.getDomainInfo(zone, di)) { - cerr<<"Domain '"< pre, post; @@ -1102,14 +1102,14 @@ int loadZone(DNSName zone, const string& fname) { DomainInfo di; if (B.getDomainInfo(zone, di)) { - cerr<<"Domain '"<startTransaction(zone, di.id)) { - cerr<<"Unable to start transaction for load of zone '"<& cmds) { DomainInfo di; DNSName zone(cmds[1]); if (B.getDomainInfo(zone, di)) { - cerr<<"Domain '"<setKind(zone, DomainInfo::Slave); @@ -1268,7 +1268,7 @@ int addOrReplaceRecord(bool addOrReplace, const vector& cmds) { } if(!addOrReplace) { - cout<<"Current records for "<getZoneRepresentation(true); @@ -1333,7 +1333,7 @@ int listAllZones(const string &type="") { int count = 0; for (vector::const_iterator di=domains.begin(); di != domains.end(); di++) { if (di->kind == kindFilter || kindFilter == -1) { - cout<zone.toString()<zone<createSlaveDomain("127.0.0.1", zone, "", "_testschema"); cout<<"Slave domain created"<()); unsigned int zonesSecured=0, zoneErrors=0; for(DomainInfo di : domainInfo) { if(!dk.isSecuredZone(di.zone)) { - cout<<"Securing "<()); DNSName zone(cmds[1]); if (zone.wirelength() > 222) { - cerr<<"Cannot enable NSEC3 for " << zone.toString() << " as it is too long (" << zone.wirelength() << " bytes, maximum is 222 bytes)"<()); return EXIT_FAILURE; } if (! dk.setNSEC3PARAM(zone, ns3pr, narrow)) { - cerr<<"Cannot set NSEC3 param for " << zone.toString() << endl; + cerr<<"Cannot set NSEC3 param for " << zone << endl; return 1; } @@ -2526,11 +2526,11 @@ loadMainConfig(g_vm["config-dir"].as()); NSEC3PARAMRecordContent ns3pr; bool narrow; if(!dk.getNSEC3PARAM(zone, &ns3pr, &narrow)) { - cerr<<"The '"<()); cerr << "Unable to set meta for '" << zone << "'" << endl; return 1; } else { - cout << "Set '" << zone.toStringNoDot() << "' meta " << kind << " = " << boost::join(meta, ", ") << endl; + cout << "Set '" << zone << "' meta " << kind << " = " << boost::join(meta, ", ") << endl; } } else if (cmds[0]=="hsm") { #ifdef HAVE_P11KIT1 @@ -3101,7 +3101,7 @@ loadMainConfig(g_vm["config-dir"].as()); for(const DomainInfo& di: domains) { size_t nr,nc,nm,nk; DNSResourceRecord rr; - cout<<"Processing '"<createDomain(di.zone)) throw PDNSException("Failed to create zone"); tgt->setKind(di.zone, di.kind);