mirror of
https://github.com/StackExchange/dnscontrol.git
synced 2024-05-11 05:55:12 +00:00
BIND: BUGFIX: SOA serial number doesn't change if SOA() used (#2908)
This commit is contained in:
@ -22,6 +22,7 @@ import (
|
||||
"time"
|
||||
|
||||
"github.com/StackExchange/dnscontrol/v4/models"
|
||||
"github.com/StackExchange/dnscontrol/v4/pkg/bindserial"
|
||||
"github.com/StackExchange/dnscontrol/v4/pkg/diff2"
|
||||
"github.com/StackExchange/dnscontrol/v4/pkg/prettyzone"
|
||||
"github.com/StackExchange/dnscontrol/v4/pkg/printer"
|
||||
@ -117,14 +118,13 @@ func (s SoaDefaults) String() string {
|
||||
|
||||
// bindProvider is the provider handle for the bindProvider driver.
|
||||
type bindProvider struct {
|
||||
DefaultNS []string `json:"default_ns"`
|
||||
DefaultSoa SoaDefaults `json:"default_soa"`
|
||||
nameservers []*models.Nameserver
|
||||
directory string
|
||||
filenameformat string
|
||||
zonefile string // Where the zone data is e texpected
|
||||
zoneFileFound bool // Did the zonefile exist?
|
||||
skipNextSoaIncrease bool // skip next SOA increment (for testing only)
|
||||
DefaultNS []string `json:"default_ns"`
|
||||
DefaultSoa SoaDefaults `json:"default_soa"`
|
||||
nameservers []*models.Nameserver
|
||||
directory string
|
||||
filenameformat string
|
||||
zonefile string // Where the zone data is e texpected
|
||||
zoneFileFound bool // Did the zonefile exist?
|
||||
}
|
||||
|
||||
// GetNameservers returns the nameservers for a domain.
|
||||
@ -241,7 +241,6 @@ func (c *bindProvider) GetZoneRecordsCorrections(dc *models.DomainConfig, foundR
|
||||
desiredSoa = dc.Records[len(dc.Records)-1]
|
||||
} else {
|
||||
*desiredSoa = *soaRec
|
||||
c.skipNextSoaIncrease = true
|
||||
}
|
||||
|
||||
var msgs []string
|
||||
@ -273,8 +272,11 @@ func (c *bindProvider) GetZoneRecordsCorrections(dc *models.DomainConfig, foundR
|
||||
)
|
||||
|
||||
// We only change the serial number if there is a change.
|
||||
if !c.skipNextSoaIncrease {
|
||||
desiredSoa.SoaSerial = nextSerial
|
||||
desiredSoa.SoaSerial = nextSerial
|
||||
|
||||
// If the --bindserial flag is used, force the serial to that value
|
||||
if bindserial.ForcedValue != 0 {
|
||||
desiredSoa.SoaSerial = uint32(bindserial.ForcedValue & 0xFFFF)
|
||||
}
|
||||
|
||||
corrections = append(corrections,
|
||||
|
Reference in New Issue
Block a user