From: Kees Monshouwer Date: Thu, 24 Oct 2013 13:48:37 +0000 (+0200) Subject: fix pdnssec create-bind-db X-Git-Tag: rec-3.6.0-rc1~363^2~5 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=9a798fb046188e32236d5db3c76e92d8f068694a;p=pdns fix pdnssec create-bind-db --- diff --git a/modules/bindbackend/bindbackend2.hh b/modules/bindbackend/bindbackend2.hh index 67e5df5d1..9df82ff95 100644 --- a/modules/bindbackend/bindbackend2.hh +++ b/modules/bindbackend/bindbackend2.hh @@ -163,7 +163,7 @@ public: virtual bool setTSIGKey(const string& name, const string& algorithm, const string& content); virtual bool deleteTSIGKey(const string& name); virtual bool getTSIGKeys(std::vector< struct TSIGKey > &keys); - static void createDNSSECDB(const string& fname); + virtual bool createDNSSECDB(const string& fname); virtual bool doesDNSSEC(); // end of DNSSEC diff --git a/modules/bindbackend/binddnssec.cc b/modules/bindbackend/binddnssec.cc index 5dc7557f5..866285443 100644 --- a/modules/bindbackend/binddnssec.cc +++ b/modules/bindbackend/binddnssec.cc @@ -34,7 +34,7 @@ void Bind2Backend::setupDNSSEC() } void Bind2Backend::createDNSSECDB(const string& fname) -{} +{ return false; } bool Bind2Backend::doesDNSSEC() { return false; } @@ -93,7 +93,7 @@ void Bind2Backend::setupDNSSEC() d_dnssecdb->setLog(::arg().mustDo("query-logging")); } -void Bind2Backend::createDNSSECDB(const string& fname) +bool Bind2Backend::createDNSSECDB(const string& fname) { try { SSQLite3 db(fname, true); // create=ok @@ -105,6 +105,7 @@ void Bind2Backend::createDNSSECDB(const string& fname) catch(SSqlException& se) { throw PDNSException("Error creating database in BIND backend: "+se.txtReason()); } + return true; } bool Bind2Backend::doesDNSSEC() diff --git a/pdns/dnsbackend.hh b/pdns/dnsbackend.hh index 0f9fea4aa..a1f4b0d57 100644 --- a/pdns/dnsbackend.hh +++ b/pdns/dnsbackend.hh @@ -158,6 +158,8 @@ public: virtual bool deleteTSIGKey(const string& name) { return false; } virtual bool getTSIGKeys(std::vector< struct TSIGKey > &keys) { return false; } + virtual bool createDNSSECDB(const string& fname) { return false; } + virtual bool getBeforeAndAfterNamesAbsolute(uint32_t id, const std::string& qname, std::string& unhashed, std::string& before, std::string& after) { std::cerr<<"Default beforeAndAfterAbsolute called!"<()); + loadMainConfig(g_vm["config-dir"].as(), cmds[0] == "create-bind-db"); reportAllTypes(); + if(cmds[0] == "create-bind-db") { + if(cmds.size() != 2) { + cerr << "Syntax: pdnssec create-bind-db fname"< &keys) return true; } +bool UeberBackend::createDNSSECDB(const string& fname) +{ + BOOST_FOREACH(DNSBackend* db, backends) { + db->createDNSSECDB(fname); + } + return true; +} void UeberBackend::reload() { diff --git a/pdns/ueberbackend.hh b/pdns/ueberbackend.hh index 3c29cff0b..72e5a7b40 100644 --- a/pdns/ueberbackend.hh +++ b/pdns/ueberbackend.hh @@ -140,6 +140,8 @@ public: bool deleteTSIGKey(const string& name); bool getTSIGKeys(std::vector< struct TSIGKey > &keys); + bool createDNSSECDB(const string& fname); + void alsoNotifies(const string &domain, set *ips); void rediscover(string* status=0); void reload();