From 7d9dcde01f91a547519147c33f6c55d8436e1a5c Mon Sep 17 00:00:00 2001 From: Bert Hubert Date: Tue, 4 Jan 2011 10:12:39 +0000 Subject: [PATCH] teach pdnssec about config-dir git-svn-id: svn://svn.powerdns.com/pdns/trunk/pdns@1802 d19b8d6e-7fed-0310-83ef-9ca221ded41b --- pdns/pdnssec.cc | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/pdns/pdnssec.cc b/pdns/pdnssec.cc index 4752d7a02..ab48297fd 100644 --- a/pdns/pdnssec.cc +++ b/pdns/pdnssec.cc @@ -33,11 +33,9 @@ string humanTime(time_t t) return ret; } -void loadMainConfig() +void loadMainConfig(const std::string& configdir) { - static char pietje[128]="!@@SYSCONFDIR@@:"; - ::arg().set("config-dir","Location of configuration directory (pdns.conf)")= - strcmp(pietje+1,"@@SYSCONFDIR@@:") ? pietje+strlen("@@SYSCONFDIR@@:")+1 : SYSCONFDIR; + ::arg().set("config-dir","Location of configuration directory (pdns.conf)")=configdir; ::arg().set("launch","Which backends to launch"); ::arg().set("dnssec","if we should do dnssec")="true"; @@ -132,7 +130,7 @@ void orderZone(DNSSECKeeper& dk, const std::string& zone) void checkZone(DNSSECKeeper& dk, const std::string& zone) { - loadMainConfig(); + loadMainConfig(g_vm["config-dir"].as()); reportAllTypes(); UeberBackend* B = new UeberBackend("default"); SOAData sd; @@ -174,6 +172,7 @@ try ("help,h", "produce help message") ("verbose,v", po::value(), "be verbose") ("force", "force an action") + ("config-dir", po::value()->default_value(SYSCONFDIR), "location of pdns.conf") ("commands", po::value >()); po::positional_options_description p; @@ -189,11 +188,12 @@ try if(cmds.empty() || g_vm.count("help")) { cerr<<"Usage: \npdnssec [options] [show-zone] [secure-zone] [alter-zone] [order-zone] [add-zone-key] [deactivate-zone-key] [remove-zone-key] [activate-zone-key]\n"; cerr<<" [import-zone-key] [export-zone-key] [set-nsec3] [unset-nsec3] [export-zone-dnskey]"<()); reportAllTypes(); DNSSECKeeper dk; -- 2.50.1