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

Matthijs Mekking matthijs at nlnetlabs.nl
Mon Aug 9 10:43:46 CEST 2010


Author: matthijs
Date: 2010-08-09 10:43:46 +0200 (Mon, 09 Aug 2010)
New Revision: 3671

Modified:
   trunk/OpenDNSSEC/signer/src/signer/tools.c
   trunk/OpenDNSSEC/signer/src/signer/zone.c
   trunk/OpenDNSSEC/signer/src/util/duration.c
Log:
upper bound for arc4random_uniform()

Modified: trunk/OpenDNSSEC/signer/src/signer/tools.c
===================================================================
--- trunk/OpenDNSSEC/signer/src/signer/tools.c	2010-08-06 14:16:00 UTC (rev 3670)
+++ trunk/OpenDNSSEC/signer/src/signer/tools.c	2010-08-09 08:43:46 UTC (rev 3671)
@@ -35,7 +35,6 @@
 #include "adapter/adapter.h"
 #include "daemon/engine.h"
 #include "scheduler/locks.h"
-#include "signer/stats.h"
 #include "signer/tools.h"
 #include "signer/zone.h"
 #include "util/file.h"
@@ -56,18 +55,10 @@
 {
     char* tmpname = NULL;
     int error = 0;
-    time_t start = 0;
-    time_t end = 0;
 
     se_log_assert(zone);
     se_log_assert(zone->inbound_adapter);
     se_log_assert(zone->signconf);
-    se_log_assert(zone->stats);
-
-    zone->stats->sort_count = 0;
-    zone->stats->sort_time = 0;
-    start = time(NULL);
-
     se_log_verbose("read zone %s", zone->name);
 
     /* make a copy (slooooooow, use system(cp) ?) */
@@ -86,9 +77,6 @@
             error = 1;
             break;
     }
-    end = time(NULL);
-    zone->stats->sort_time = (end-start);
-
     return error;
 }
 
@@ -128,17 +116,11 @@
 tools_nsecify(zone_type* zone)
 {
     int error = 0;
-    time_t start = 0;
-    time_t end = 0;
 
     se_log_assert(zone);
     se_log_assert(zone->signconf);
-    se_log_assert(zone->stats);
     se_log_verbose("nsecify zone %s", zone->name);
-    start = time(NULL);
     error = zone_nsecify(zone);
-    end = time(NULL);
-    zone->stats->nsec_time = (end-start);
     return error;
 }
 
@@ -150,19 +132,10 @@
 int
 tools_sign(zone_type* zone)
 {
-    int error = 0;
-    time_t start = 0;
-    time_t end = 0;
-
     se_log_assert(zone);
     se_log_assert(zone->signconf);
-    se_log_assert(zone->stats);
     se_log_verbose("sign zone %s", zone->name);
-    start = time(NULL);
-    error = zone_sign(zone);
-    end = time(NULL);
-    zone->stats->sig_time = (end-start);
-    return error;
+    return zone_sign(zone);
 }
 
 
@@ -191,14 +164,15 @@
         }
 
         if (config->working_dir) {
-            snprintf(str, SYSTEM_MAXLEN, "%s -c %s -s %s/%s -z %s > /dev/null",
+            snprintf(str, SYSTEM_MAXLEN, "%s -c %s -s %s/%s -z %s",
                 ODS_SE_AUDITOR, config->cfg_filename, config->working_dir,
                 finalized, zone->name);
         } else {
-            snprintf(str, SYSTEM_MAXLEN, "%s -c %s -s %s -z %s > /dev/null",
+            snprintf(str, SYSTEM_MAXLEN, "%s -c %s -s %s -z %s",
                 ODS_SE_AUDITOR, config->cfg_filename, finalized, zone->name);
         }
 
+
         se_log_debug("system call: %s", str);
         error = system(str);
         if (!error) {
@@ -221,9 +195,7 @@
     int error = 0;
 
     se_log_assert(zone);
-    se_log_assert(zone->signconf);
     se_log_assert(zone->outbound_adapter);
-    se_log_assert(zone->stats);
     se_log_verbose("write zone %s", zone->name);
 
     switch (zone->outbound_adapter->type) {
@@ -237,11 +209,5 @@
             error = 1;
             break;
     }
-
-    /* log stats */
-    se_log_debug("log stats for zone %s", zone->name);
-    stats_log(zone->stats, zone->name, zone->signconf->nsec_type);
-    stats_clear(zone->stats);
-
     return error;
 }

Modified: trunk/OpenDNSSEC/signer/src/signer/zone.c
===================================================================
--- trunk/OpenDNSSEC/signer/src/signer/zone.c	2010-08-06 14:16:00 UTC (rev 3670)
+++ trunk/OpenDNSSEC/signer/src/signer/zone.c	2010-08-09 08:43:46 UTC (rev 3671)
@@ -219,6 +219,9 @@
     } else {
         /* update task for new zone */
         zone->task->what = signconf_compare(zone->signconf, signconf);
+        /* pivotal 4593322 (sign after update?): */
+        zone->task->when = time_now();
+        /* end pivotal 4593322 */
         signconf_cleanup(zone->signconf);
         zone->signconf = signconf;
         zone->signconf->name = zone->name;

Modified: trunk/OpenDNSSEC/signer/src/util/duration.c
===================================================================
--- trunk/OpenDNSSEC/signer/src/util/duration.c	2010-08-06 14:16:00 UTC (rev 3670)
+++ trunk/OpenDNSSEC/signer/src/util/duration.c	2010-08-09 08:43:46 UTC (rev 3671)
@@ -321,7 +321,7 @@
 se_rand(time_t mod)
 {
 #ifdef HAVE_ARC4RANDOM_UNIFORM
-    return (time_t) (arc4random_uniform() % mod);
+    return (time_t) (arc4random_uniform((uint32_t) mod));
 #elif HAVE_ARC4RANDOM
     return (time_t) (arc4random() % mod);
 #else




More information about the Opendnssec-commits mailing list