From: Aki Tuomi Date: Sat, 8 Feb 2014 22:05:24 +0000 (+0200) Subject: Use getAllDomainMetadata instead of known list X-Git-Tag: rec-3.6.0-rc1~179^2~1 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=2e050d2c8f437b01a9ef53052ea76f9c4d17c4b1;p=thirdparty%2Fpdns.git Use getAllDomainMetadata instead of known list --- diff --git a/pdns/pdnssec.cc b/pdns/pdnssec.cc index a396a20c6d..95c1dc28fb 100644 --- a/pdns/pdnssec.cc +++ b/pdns/pdnssec.cc @@ -1734,22 +1734,25 @@ try } if (cmds.size() > 2) { - keys.assign(cmds.begin() + 2, cmds.end()); + keys.assign(cmds.begin() + 2, cmds.end()); + std::cout << "Metadata for '" << zone << "'" << endl; + BOOST_FOREACH(const string kind, keys) { + vector meta; + meta.clear(); + if (B.getDomainMetadata(zone, kind, meta)) { + cout << kind << " = " << boost::join(meta, ", ") << endl; + } + } } else { - keys = boost::assign::list_of("ALLOW-2136-FROM") - ("ALLOW-AXFR-FROM")("ALSO-NOTIFY")("AXFR-MASTER-TSIG") - ("AXFR-SOURCE")("LUA-AXFR-SCRIPT")("NSEC3NARROW") - ("NSEC3PARAM")("PRESIGNED")("SOA-EDIT") - ("TSIG-ALLOW-2136")("TSIG-ALLOW-AXFR"); // NOTE: Add new metas here - } - std::cout << "Metadata for '" << zone << "'" << endl; - BOOST_FOREACH(const string kind, keys) { - vector meta; - meta.clear(); - if (B.getDomainMetadata(zone, kind, meta)) { - cout << kind << " = " << boost::join(meta, ", ") << endl; + std::map > meta; + std::cout << "Metadata for '" << zone << "'" << endl; + B.getAllDomainMetadata(zone, meta); + for(std::map >::const_iterator each_meta = meta.begin(); each_meta != meta.end(); each_meta++) { + cout << each_meta->first << " = " << boost::join(each_meta->second, ", ") << endl; } - } + } + return 0; + } else if (cmds[0]=="set-meta") { UeberBackend B("default"); if (cmds.size() < 3) {