[Opendnssec-commits] [keihatsu.kirei.se/svn/dnssec] r4069 - in trunk/OpenDNSSEC/signer/src: adapter daemon signer

Matthijs Mekking matthijs at nlnetlabs.nl
Thu Oct 7 11:25:41 CEST 2010


Author: matthijs
Date: 2010-10-07 11:25:41 +0200 (Thu, 07 Oct 2010)
New Revision: 4069

Modified:
   trunk/OpenDNSSEC/signer/src/adapter/adfile.c
   trunk/OpenDNSSEC/signer/src/daemon/cmdhandler.c
   trunk/OpenDNSSEC/signer/src/signer/tools.c
Log:
we only write .inbound to .unsorted if the update was succesful



Modified: trunk/OpenDNSSEC/signer/src/adapter/adfile.c
===================================================================
--- trunk/OpenDNSSEC/signer/src/adapter/adfile.c	2010-10-07 09:22:25 UTC (rev 4068)
+++ trunk/OpenDNSSEC/signer/src/adapter/adfile.c	2010-10-07 09:25:41 UTC (rev 4069)
@@ -520,7 +520,10 @@
         se_log_error("error reading zone %s from file %s",
             zone_in->name?zone_in->name:"(null)",
             filename?filename:"(null)");
-    } else if (!recover) {
+        return error;
+    }
+
+    if (!recover) {
         /* remove current rrs */
         error = zonedata_del_rrs(zone_in->zonedata);
         if (error) {

Modified: trunk/OpenDNSSEC/signer/src/daemon/cmdhandler.c
===================================================================
--- trunk/OpenDNSSEC/signer/src/daemon/cmdhandler.c	2010-10-07 09:22:25 UTC (rev 4068)
+++ trunk/OpenDNSSEC/signer/src/daemon/cmdhandler.c	2010-10-07 09:25:41 UTC (rev 4069)
@@ -301,10 +301,16 @@
     unlink(tmpname);
     se_free((void*)tmpname);
 
+/*
     tmpname = se_build_path(tbd, ".state", 0);
     unlink(tmpname);
     se_free((void*)tmpname);
+*/
 
+    tmpname = se_build_path(tbd, ".inbound", 0);
+    unlink(tmpname);
+    se_free((void*)tmpname);
+
     tmpname = se_build_path(tbd, ".unsorted", 0);
     unlink(tmpname);
     se_free((void*)tmpname);

Modified: trunk/OpenDNSSEC/signer/src/signer/tools.c
===================================================================
--- trunk/OpenDNSSEC/signer/src/signer/tools.c	2010-10-07 09:22:25 UTC (rev 4068)
+++ trunk/OpenDNSSEC/signer/src/signer/tools.c	2010-10-07 09:25:41 UTC (rev 4069)
@@ -124,12 +124,19 @@
 tools_update(zone_type* zone)
 {
     int error = 0;
+    char* inbound = NULL;
+    char* unsorted = NULL;
     se_log_assert(zone);
     se_log_assert(zone->signconf);
     se_log_verbose("update zone %s", zone->name?zone->name:"(null)");
     error = zone_update_zonedata(zone);
     if (!error) {
-        zone_backup_state(zone);
+        inbound = se_build_path(zone->name, ".inbound", 0);
+        unsorted = se_build_path(zone->name, ".unsorted", 0);
+        error = se_file_copy(inbound, unsorted);
+        if (!error) {
+            zone_backup_state(zone);
+        }
     }
     return error;
 }




More information about the Opendnssec-commits mailing list