Skip to content

Commit

Permalink
Merge pull request #8166 from Habbie/backport-8164-to-auth-4.2.x
Browse files Browse the repository at this point in the history
auth 4.2.x: pdnsutil increase-serial: set right ordername
  • Loading branch information
Habbie committed Aug 7, 2019
2 parents e12f2b3 + a7a3c26 commit a01ad28
Show file tree
Hide file tree
Showing 5 changed files with 26 additions and 2 deletions.
4 changes: 2 additions & 2 deletions pdns/pdnsutil.cc
Expand Up @@ -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<<"'"<<rr.qname<<"' -> '"<< ordername <<"'"<<endl;
sd.db->updateDNSSECOrderNameAndAuth(sd.domain_id, rr.qname, ordername, true);
Expand Down
16 changes: 16 additions & 0 deletions 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'"
@@ -0,0 +1 @@
Make sure that pdnsutil increase-serial does not destroy ordername.
@@ -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 ---

@@ -0,0 +1 @@
Skip this test if the backend does not support dyndns/rfc2136

0 comments on commit a01ad28

Please sign in to comment.