From: Kees Monshouwer Date: Thu, 4 Mar 2021 15:27:53 +0000 (+0100) Subject: auth: optionally include disabled or empty zones in the pdnsutil list-all-zone and... X-Git-Tag: auth-4.5.0-alpha1~4^2~1 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=31f5720ea38860caebc87cd582da4d7b83df9542;p=thirdparty%2Fpdns.git auth: optionally include disabled or empty zones in the pdnsutil list-all-zone and list-keys output --- diff --git a/docs/manpages/pdnsutil.1.rst b/docs/manpages/pdnsutil.1.rst index 27d062e8d6..8b66220360 100644 --- a/docs/manpages/pdnsutil.1.rst +++ b/docs/manpages/pdnsutil.1.rst @@ -196,9 +196,11 @@ hash-zone-record *ZONE* *RNAME* increase-serial *ZONE* Increases the SOA-serial by 1. Uses SOA-EDIT. list-keys [*ZONE*] - List DNSSEC information for all keys or for *ZONE*. + List DNSSEC information for all keys or for *ZONE*. --verbose or -v will + also include the keys for disabled or empty zones. list-all-zones: - List all zone names. + List all active zone names. --verbose or -v will also include disabled + or empty zones. list-zone *ZONE* Show all records for *ZONE*. load-zone *ZONE* *FILE* diff --git a/pdns/pdnsutil.cc b/pdns/pdnsutil.cc index f557d06237..f179882d5f 100644 --- a/pdns/pdnsutil.cc +++ b/pdns/pdnsutil.cc @@ -1021,7 +1021,7 @@ static void listKey(DomainInfo const &di, DNSSECKeeper& dk, bool printHeader = t static int listKeys(const string &zname, DNSSECKeeper& dk){ UeberBackend B("default"); - if (zname != "all") { + if (!zname.empty()) { DomainInfo di; if(!B.getDomainInfo(DNSName(zname), di)) { cerr << "Zone "< domainInfo; - B.getAllDomains(&domainInfo); + B.getAllDomains(&domainInfo, g_verbose); bool printHeader = true; for (const auto& di : domainInfo) { listKey(di, dk, printHeader); @@ -1618,7 +1618,7 @@ static int listAllZones(const string &type="") { UeberBackend B("default"); vector domains; - B.getAllDomains(&domains, true); + B.getAllDomains(&domains, g_verbose); int count = 0; for (const auto& di: domains) { @@ -2840,7 +2840,10 @@ try cerr<<"Syntax: pdnsutil list-keys [ZONE]"<