mirror of
https://github.com/StackExchange/dnscontrol.git
synced 2025-02-24 23:53:01 +08:00
AXFRDDNS: Avoid appending dot if TSIG key ID already has a dot suffix (#2855)
Co-authored-by: Yang Zhou <yangz@fortinet.com>
This commit is contained in:
parent
544d731dec
commit
32b8863a93
1 changed files with 5 additions and 1 deletions
|
@ -212,7 +212,11 @@ func readKey(raw string, kind string) (*Key, error) {
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, fmt.Errorf("cannot decode Base64 secret (%s) in AXFRDDNS.TSIG", kind)
|
return nil, fmt.Errorf("cannot decode Base64 secret (%s) in AXFRDDNS.TSIG", kind)
|
||||||
}
|
}
|
||||||
return &Key{algo: algo, id: arr[1] + ".", secret: arr[2]}, nil
|
id := arr[1]
|
||||||
|
if !strings.HasSuffix(id, ".") {
|
||||||
|
id += "."
|
||||||
|
}
|
||||||
|
return &Key{algo: algo, id: id, secret: arr[2]}, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
// GetNameservers returns the nameservers for a domain.
|
// GetNameservers returns the nameservers for a domain.
|
||||||
|
|
Loading…
Reference in a new issue