[Opendnssec-commits] [svn.opendnssec.org/svn/dnssec] r6116 - branches/OpenDNSSEC-enforcer-ng/signer/src/adapter

matthijs at nlnetlabs.nl matthijs at nlnetlabs.nl
Tue Jan 31 13:58:36 CET 2012


Author: matthijs
Date: 2012-01-31 13:58:36 +0100 (Tue, 31 Jan 2012)
New Revision: 6116

Modified:
   branches/OpenDNSSEC-enforcer-ng/signer/src/adapter/adapi.c
Log:
OPENDNSSEC-205: Not setting variables in MaxZoneTTL log message



Modified: branches/OpenDNSSEC-enforcer-ng/signer/src/adapter/adapi.c
===================================================================
--- branches/OpenDNSSEC-enforcer-ng/signer/src/adapter/adapi.c	2012-01-31 11:09:04 UTC (rev 6115)
+++ branches/OpenDNSSEC-enforcer-ng/signer/src/adapter/adapi.c	2012-01-31 12:58:36 UTC (rev 6116)
@@ -329,9 +329,21 @@
     }
     /* //MaxZoneTTL. Only set for RRtype != SOA && RRtype != DNSKEY */
     if (tmp && tmp < ldns_rr_ttl(rr)) {
-       log_rrset(ldns_rr_owner(rr), ldns_rr_get_type(rr),
-           "capping ttl %u to MaxZoneTTL %u for rrset", LOG_WARNING);
-       ldns_rr_set_ttl(rr, tmp);
+        char* str = ldns_rdf2str(ldns_rr_owner(rr));
+        if (str) {
+            size_t i = 0;
+            str[(strlen(str))-1] = '\0';
+            /* replace tabs with white space */
+            for (i=0; i < strlen(str); i++) {
+                if (str[i] == '\t') {
+                    str[i] = ' ';
+                }
+            }
+            ods_log_warning("[%s] capping ttl %u to MaxZoneTTL %u for rrset "
+                "<%s,%s>", adapi_str, ldns_rr_ttl(rr), tmp, str,
+                rrset_type2str(ldns_rr_get_type(rr)));
+        }
+        ldns_rr_set_ttl(rr, tmp);
     }
 
     /* TODO: DNAME and CNAME checks */




More information about the Opendnssec-commits mailing list