From: Pieter Lexis Date: Mon, 16 Oct 2017 13:00:35 +0000 (+0200) Subject: pdnsutil: Check for domain before setting metadata X-Git-Tag: rec-4.1.0-rc2~34^2~3 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=ed99fac4e9bb61c360e68cc71056cfb9f5c80a21;p=pdns pdnsutil: Check for domain before setting metadata Closes #5787 --- diff --git a/pdns/pdnsutil.cc b/pdns/pdnsutil.cc index db522db8d..c6676366b 100644 --- a/pdns/pdnsutil.cc +++ b/pdns/pdnsutil.cc @@ -3059,6 +3059,12 @@ try 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;