]> git.ipfire.org Git - thirdparty/bind9.git/commitdiff
[master] Prevent dnssec-settime from printing a bogus warning
authorMichał Kępień <michal@isc.org>
Fri, 18 Aug 2017 09:17:43 +0000 (11:17 +0200)
committerMichał Kępień <michal@isc.org>
Mon, 21 Aug 2017 08:20:10 +0000 (10:20 +0200)
4686. [bug] dnssec-settime -p could print a bogus warning about
key deletion scheduled before its inactivation when a
key had an inactivation date set but no deletion date
set. [RT #45807]

CHANGES
bin/dnssec/dnssec-settime.c
bin/tests/system/metadata/tests.sh

diff --git a/CHANGES b/CHANGES
index f1232dcf21e2f3a376885f229c51d83acf491777..c29c72afbaa3b6b1a9854dd3eaceabeb0bfa9581 100644 (file)
--- a/CHANGES
+++ b/CHANGES
@@ -1,3 +1,8 @@
+4686.  [bug]           dnssec-settime -p could print a bogus warning about
+                       key deletion scheduled before its inactivation when a
+                       key had an inactivation date set but no deletion date
+                       set. [RT #45807]
+
 4685.  [bug]           dnssec-settime incorrectly calculated publication and
                        activation dates for a successor key. [RT #45806]
 
index 650170883483d519558788dc9bf4ffb049e98f44..a51fd453f006a4c91d70ad838496d4a5e3200b04 100644 (file)
@@ -524,7 +524,7 @@ main(int argc, char **argv) {
                             &prevdel) == ISC_R_SUCCESS &&
             setinact && !setdel && !unsetdel && prevdel < inact) ||
            (!setdel && !unsetdel && !setinact && !unsetinact &&
-            prevdel < previnact))
+            prevdel != 0 && prevdel < previnact))
                fprintf(stderr, "%s: warning: Key is scheduled to "
                                "be deleted before it is\n\t"
                                "scheduled to be inactive.\n",
index 7711d52838b2e52256c2937581234e0b4caf5836..e63277bc6876cf61d4780fe50f00dda96adb95ad 100644 (file)
@@ -162,6 +162,15 @@ n=`expr $n + 1`
 if [ $ret != 0 ]; then echo "I:failed"; fi
 status=`expr $status + $ret`
 
+echo "I:checking no warning about delete date < inactive date with dnssec-settime when delete date is unset ($n)"
+ret=0
+$SETTIME -D none `cat oldstyle.key` > tmp.out 2>&1 || ret=1
+$SETTIME -p all `cat oldstyle.key` > tmp.out 2>&1 || ret=1
+grep "warning" tmp.out > /dev/null 2>&1 && ret=1
+n=`expr $n + 1`
+if [ $ret != 0 ]; then echo "I:failed"; fi
+status=`expr $status + $ret`
+
 echo "I:checking warning about delete date < inactive date with dnssec-keygen ($n)"
 ret=0
 # keygen should print a warning about delete < inactive