From: Pieter Lexis Date: Mon, 16 Oct 2017 13:00:35 +0000 (+0200) Subject: pdnsutil: Check for domain before setting metadata X-Git-Tag: auth-4.0.5~1^2~10^2~1 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=34658cdb096488d6cb7b056f9d59eddb4e16120c;p=pdns pdnsutil: Check for domain before setting metadata Closes #5787 (cherry picked from commit ed99fac4e9bb61c360e68cc71056cfb9f5c80a21) --- diff --git a/pdns/pdnsutil.cc b/pdns/pdnsutil.cc index 2361bee48..65a4fcca1 100644 --- a/pdns/pdnsutil.cc +++ b/pdns/pdnsutil.cc @@ -2915,6 +2915,12 @@ loadMainConfig(g_vm["config-dir"].as()); string kind = cmds[2]; vector meta(cmds.begin() + 3, cmds.end()); + DomainInfo di; + if (!B.getDomainInfo(zone, di)){ + cerr << "No such zone in the database" << endl; + return false; + } + if (!B.setDomainMetadata(zone, kind, meta)) { cerr << "Unable to set meta for '" << zone << "'" << endl; return 1;