From 2402c558c59f0cdddc50c870cd3057acea3aa6ab Mon Sep 17 00:00:00 2001 From: Bert Hubert Date: Wed, 3 Oct 2012 18:48:49 +0000 Subject: [PATCH] explicitly generate an error if trying to secure a zone which does not exist. Remove needless scoped_ptr<> - stack is faster git-svn-id: svn://svn.powerdns.com/pdns/trunk/pdns@2737 d19b8d6e-7fed-0310-83ef-9ca221ded41b --- pdns/pdnssec.cc | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/pdns/pdnssec.cc b/pdns/pdnssec.cc index a5de76923a..09367e7c60 100644 --- a/pdns/pdnssec.cc +++ b/pdns/pdnssec.cc @@ -496,6 +496,13 @@ bool secureZone(DNSSECKeeper& dk, const std::string& zone) return false; } + DomainInfo di; + UeberBackend B("default"); + if(!B.getDomainInfo(zone, di) || !di.backend) { // di.backend and B are mostly identical + cout<<"Can't find a zone called '"< B(new UeberBackend("default")); + UeberBackend B("default"); cout<<"Picking first backend - if this is not what you want, edit launch line!"<backends[0]; + DNSBackend *db = B.backends[0]; cout<<"Creating slave domain "<createSlaveDomain("127.0.0.1", zone, "_testschema"); cout<<"Slave domain created"<getDomainInfo(zone, di) || !di.backend) { // di.backend and B are mostly identical + if(!B.getDomainInfo(zone, di) || !di.backend) { // di.backend and B are mostly identical cout<<"Can't find domain we just created, aborting"<