From: Peter van Dijk Date: Tue, 6 Aug 2019 09:12:05 +0000 (+0200) Subject: pdnsutil increase-serial: set right ordername X-Git-Tag: dnsdist-1.4.0-rc1~8^2 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=970badd2b07b50e6103570f0ed91a834ac40cb15;p=pdns pdnsutil increase-serial: set right ordername --- diff --git a/pdns/pdnsutil.cc b/pdns/pdnsutil.cc index 69adc32fa..aaa73d0f6 100644 --- a/pdns/pdnsutil.cc +++ b/pdns/pdnsutil.cc @@ -679,9 +679,9 @@ int increaseSerial(const DNSName& zone, DNSSECKeeper &dk) DNSName ordername; if(haveNSEC3) { if(!narrow) - ordername=DNSName(toBase32Hex(hashQNameWithSalt(ns3pr, zone))) + zone; + ordername=DNSName(toBase32Hex(hashQNameWithSalt(ns3pr, zone))); } else - ordername=zone; + ordername=DNSName(""); if(g_verbose) cerr<<"'"< '"<< ordername <<"'"<updateDNSSECOrderNameAndAuth(sd.domain_id, rr.qname, ordername, true); diff --git a/regression-tests/tests/pdnsutil-increase-serial/command b/regression-tests/tests/pdnsutil-increase-serial/command new file mode 100755 index 000000000..cc3a369d9 --- /dev/null +++ b/regression-tests/tests/pdnsutil-increase-serial/command @@ -0,0 +1,16 @@ +#!/bin/sh + +mysqldiff + +$PDNSUTIL --config-dir=. --config-name=gmysql increase-serial test.dyndns + +mysqldiff 1 "Check that test.dyndns. still has a valid ordername" + +[ -z "$GMYSQLDB" ] && GMYSQLDB=pdnstest +[ -z "$GMYSQLUSER" ] && GMYSQLUSER=root +[ -z "$GMYSQLHOST" ] && GMYSQLHOST=localhost +[ -z "$GMYSQLPASSWD" ] && GMYSQLPASSWD='' + +mysql --user="$GMYSQLUSER" --password="$GMYSQLPASSWD" --host="$GMYSQLHOST" \ + "$GMYSQLDB" \ + -e "UPDATE records SET content='ns1.test.dyndns ahu.example.dyndns 2012060701 28800 7200 604800 86400' WHERE name='test.dyndns' AND type='SOA'" diff --git a/regression-tests/tests/pdnsutil-increase-serial/description b/regression-tests/tests/pdnsutil-increase-serial/description new file mode 100644 index 000000000..327d6d9b9 --- /dev/null +++ b/regression-tests/tests/pdnsutil-increase-serial/description @@ -0,0 +1 @@ +Make sure that pdnsutil increase-serial does not destroy ordername. diff --git a/regression-tests/tests/pdnsutil-increase-serial/expected_result b/regression-tests/tests/pdnsutil-increase-serial/expected_result new file mode 100644 index 000000000..13b2d73d1 --- /dev/null +++ b/regression-tests/tests/pdnsutil-increase-serial/expected_result @@ -0,0 +1,6 @@ +SOA serial for zone test.dyndns set to 2012060702 +Check that test.dyndns. still has a valid ordername +--- Start: diff start step.1 --- +no difference +--- End: diff start step.1 --- + diff --git a/regression-tests/tests/pdnsutil-increase-serial/skip.nodyndns b/regression-tests/tests/pdnsutil-increase-serial/skip.nodyndns new file mode 100644 index 000000000..81c071b81 --- /dev/null +++ b/regression-tests/tests/pdnsutil-increase-serial/skip.nodyndns @@ -0,0 +1 @@ +Skip this test if the backend does not support dyndns/rfc2136