]> granicus.if.org Git - pdns/commitdiff
undo tabdamage
authorBert Hubert <bert.hubert@netherlabs.nl>
Sun, 12 Feb 2012 13:25:49 +0000 (13:25 +0000)
committerBert Hubert <bert.hubert@netherlabs.nl>
Sun, 12 Feb 2012 13:25:49 +0000 (13:25 +0000)
git-svn-id: svn://svn.powerdns.com/pdns/trunk/pdns@2382 d19b8d6e-7fed-0310-83ef-9ca221ded41b

pdns/pdnssec.cc

index 66e0106437cff1033bd9fb58927bcb5870e29e60..c0c17969b582c2fc38c174f3ee8b8f55f5abc2c1 100644 (file)
@@ -406,42 +406,42 @@ void showZone(DNSSECKeeper& dk, const std::string& zone)
 
 bool secureZone(DNSSECKeeper& dk, const std::string& zone)
 {
-       if(dk.isSecuredZone(zone)) {
-               cerr << "Zone '"<<zone<<"' already secure, remove keys with pdnssec remove-zone-key if needed"<<endl;
-               return false;
-       }
-
-       if(!dk.secureZone(zone, 8)) {
-               cerr<<"No backend was able to secure '"<<zone<<"', most likely because no DNSSEC\n";
-               cerr<<"capable backends are loaded, or because the backends have DNSSEC disabled.\n";
-               cerr<<"For the Generic SQL backends, set 'gsqlite3-dnssec' or 'gmysql-dnssec' or\n";
-               cerr<<"'gpgsql-dnssec' etc. Also make sure the schema has been updated for DNSSEC!\n";
-               return false;
-       }
-
-       if(!dk.isSecuredZone(zone)) {
-               cerr<<"Failed to secure zone. Is your backend dnssec enabled? (set \n";
-               cerr<<"sqlite3-dnssec, or gmysql-dnssec etc). Check this first.\n";
-               cerr<<"If you run with the BIND backend, make sure to also launch another\n";
-               cerr<<"backend which supports storage of DNSSEC settings.\n";
-               cerr<<"In addition, add '"<<zone<<"' to this backend, possibly like this: \n\n";
-               cerr<<"   insert into domains (name, type) values ('"<<zone<<"', 'NATIVE');\n\n";
-               cerr<<"And then rerun secure-zone"<<endl;
-               return false;
-       }
-
-       DNSSECKeeper::keyset_t zskset=dk.getKeys(zone, false);
-
-       if(!zskset.empty())  {
-               cerr<<"There were ZSKs already for zone '"<<zone<<"', no need to add more"<<endl;
-               return false;
-       }
-               
-       dk.addKey(zone, false, 8);
-       dk.addKey(zone, false, 8, 0, false); // not active
-       // rectifyZone(dk, zone);
-       // showZone(dk, zone);
-       cout<<"Zone "<<zone<<" secured"<<endl;
+  if(dk.isSecuredZone(zone)) {
+    cerr << "Zone '"<<zone<<"' already secure, remove keys with pdnssec remove-zone-key if needed"<<endl;
+    return false;
+  }
+
+  if(!dk.secureZone(zone, 8)) {
+    cerr<<"No backend was able to secure '"<<zone<<"', most likely because no DNSSEC\n";
+    cerr<<"capable backends are loaded, or because the backends have DNSSEC disabled.\n";
+    cerr<<"For the Generic SQL backends, set 'gsqlite3-dnssec' or 'gmysql-dnssec' or\n";
+    cerr<<"'gpgsql-dnssec' etc. Also make sure the schema has been updated for DNSSEC!\n";
+    return false;
+  }
+
+  if(!dk.isSecuredZone(zone)) {
+    cerr<<"Failed to secure zone. Is your backend dnssec enabled? (set \n";
+    cerr<<"sqlite3-dnssec, or gmysql-dnssec etc). Check this first.\n";
+    cerr<<"If you run with the BIND backend, make sure to also launch another\n";
+    cerr<<"backend which supports storage of DNSSEC settings.\n";
+    cerr<<"In addition, add '"<<zone<<"' to this backend, possibly like this: \n\n";
+    cerr<<"   insert into domains (name, type) values ('"<<zone<<"', 'NATIVE');\n\n";
+    cerr<<"And then rerun secure-zone"<<endl;
+    return false;
+  }
+
+  DNSSECKeeper::keyset_t zskset=dk.getKeys(zone, false);
+
+  if(!zskset.empty())  {
+    cerr<<"There were ZSKs already for zone '"<<zone<<"', no need to add more"<<endl;
+    return false;
+  }
+    
+  dk.addKey(zone, false, 8);
+  dk.addKey(zone, false, 8, 0, false); // not active
+  // rectifyZone(dk, zone);
+  // showZone(dk, zone);
+  cout<<"Zone "<<zone<<" secured"<<endl;
   return true;
 }
 
@@ -633,11 +633,11 @@ try
     vector<string> mustRectify;
     dk.startTransaction();    
     for(unsigned int n = 1; n < cmds.size(); ++n) {
-                       const string& zone=cmds[n];
-                       if(secureZone(dk, zone)) {
+      const string& zone=cmds[n];
+      if(secureZone(dk, zone)) {
         mustRectify.push_back(zone);
       }
-               }
+    }
     
     dk.commitTransaction();
     BOOST_FOREACH(string& zone, mustRectify)
@@ -668,7 +668,7 @@ try
   else if(cmds[0]=="unset-presigned") {
     if(cmds.size() < 2) {
       cerr<<"Syntax: pdnssec unset-presigned ZONE"<<endl;
-      return 0;        
+      return 0;  
     }
     dk.unsetPresigned(cmds[1]);
   }