diff options
author | 2018-10-13 19:49:55 +0200 | |
---|---|---|
committer | 2018-10-13 18:49:55 +0100 | |
commit | 3cef6674e93d7287f245c97ab525ca0ea915a5c6 (patch) | |
tree | 4bb6839365b6e53d30bc80209f961d2e53a086b1 /plugin/dnssec | |
parent | 6d2bc0a8f264164233bc22f4e89a44df9dc57526 (diff) | |
download | coredns-3cef6674e93d7287f245c97ab525ca0ea915a5c6.tar.gz coredns-3cef6674e93d7287f245c97ab525ca0ea915a5c6.tar.zst coredns-3cef6674e93d7287f245c97ab525ca0ea915a5c6.zip |
plugin/dnssec: Add root support (#2195)
Diffstat (limited to 'plugin/dnssec')
-rw-r--r-- | plugin/dnssec/setup.go | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/plugin/dnssec/setup.go b/plugin/dnssec/setup.go index a476dcba7..39b40d575 100644 --- a/plugin/dnssec/setup.go +++ b/plugin/dnssec/setup.go @@ -2,6 +2,7 @@ package dnssec import ( "fmt" + "path" "strconv" "strings" @@ -113,6 +114,7 @@ func dnssecParse(c *caddy.Controller) ([]string, []*DNSKEY, int, error) { func keyParse(c *caddy.Controller) ([]*DNSKEY, error) { keys := []*DNSKEY{} + config := dnsserver.GetConfig(c) if !c.NextArg() { return nil, c.ArgErr() @@ -133,6 +135,9 @@ func keyParse(c *caddy.Controller) ([]*DNSKEY, error) { if strings.HasSuffix(k, ".private") { base = k[:len(k)-8] } + if !path.IsAbs(base) && config.Root != "" { + base = path.Join(config.Root, base) + } k, err := ParseKeyFile(base+".key", base+".private") if err != nil { return nil, err |