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

Matthijs Mekking matthijs at nlnetlabs.nl
Tue Aug 10 11:18:52 CEST 2010


Author: matthijs
Date: 2010-08-10 11:18:52 +0200 (Tue, 10 Aug 2010)
New Revision: 3698

Modified:
   trunk/OpenDNSSEC/signer/src/adapter/adfile.c
   trunk/OpenDNSSEC/signer/src/adapter/adfile.h
   trunk/OpenDNSSEC/signer/src/signer/tools.c
Log:
adfile_read should read .unsorted

http://www.pivotaltracker.com/story/show/4635911




Modified: trunk/OpenDNSSEC/signer/src/adapter/adfile.c
===================================================================
--- trunk/OpenDNSSEC/signer/src/adapter/adfile.c	2010-08-10 09:06:30 UTC (rev 3697)
+++ trunk/OpenDNSSEC/signer/src/adapter/adfile.c	2010-08-10 09:18:52 UTC (rev 3698)
@@ -462,7 +462,7 @@
  *
  */
 int
-adfile_read(struct zone_struct* zone)
+adfile_read(struct zone_struct* zone, const char* filename)
 {
     FILE* fd = NULL;
     zone_type* zone_in = zone;
@@ -470,9 +470,9 @@
 
     se_log_assert(zone_in);
     se_log_assert(zone_in->name);
-    se_log_assert(zone_in->inbound_adapter);
-    se_log_debug("read from input file adapter zone %s file %s",
-        zone_in->name, zone_in->inbound_adapter->filename);
+    se_log_assert(filename);
+    se_log_debug("read zone %s from file %s",
+        zone_in->name, filename);
 
     /* remove current rrs */
     error = zonedata_del_rrs(zone_in->zonedata);

Modified: trunk/OpenDNSSEC/signer/src/adapter/adfile.h
===================================================================
--- trunk/OpenDNSSEC/signer/src/adapter/adfile.h	2010-08-10 09:06:30 UTC (rev 3697)
+++ trunk/OpenDNSSEC/signer/src/adapter/adfile.h	2010-08-10 09:18:52 UTC (rev 3698)
@@ -45,10 +45,11 @@
 /**
  * Read zone file.
  * \param[in] zone zone structure
+ * \param[in] filename read from this specific file
  * \return 0 on success, 1 on error
  *
  */
-int adfile_read(struct zone_struct* zone);
+int adfile_read(struct zone_struct* zone, const char* filename);
 
 /**
  * Write zone file.

Modified: trunk/OpenDNSSEC/signer/src/signer/tools.c
===================================================================
--- trunk/OpenDNSSEC/signer/src/signer/tools.c	2010-08-10 09:06:30 UTC (rev 3697)
+++ trunk/OpenDNSSEC/signer/src/signer/tools.c	2010-08-10 09:18:52 UTC (rev 3698)
@@ -67,16 +67,17 @@
     zone->stats->sort_time = 0;
     start = time(NULL);
 
-    se_log_verbose("read zone %s", zone->name);
+    se_log_verbose("read zone %s from input adapter %s",
+        zone->name, zone->inbound_adapter->filename);
 
-    /* make a copy (slooooooow, use system(cp) ?) */
-    tmpname = se_build_path(zone->name, ".unsorted", 0);
-    error = se_file_copy(zone->inbound_adapter->filename, tmpname);
-    se_free((void*)tmpname);
-
     switch (zone->inbound_adapter->type) {
         case ADAPTER_FILE:
-            error = adfile_read(zone);
+            tmpname = se_build_path(zone->name, ".unsorted", 0);
+            error = se_file_copy(zone->inbound_adapter->filename, tmpname);
+            if (!error) {
+                error = adfile_read(zone, tmpname);
+            }
+            se_free((void*)tmpname);
             break;
         case ADAPTER_UNKNOWN:
         default:




More information about the Opendnssec-commits mailing list