diff options
author | 2019-07-27 15:06:50 +0000 | |
---|---|---|
committer | 2019-07-27 08:06:50 -0700 | |
commit | 92a636df53c16047a7523d499811ac0df41edaf3 (patch) | |
tree | f65be786242616193ed0d4efefc4bee330e77d10 /plugin/file/file.go | |
parent | 7a3371d740065d4a0e321abe27fe090300a4ce4f (diff) | |
download | coredns-92a636df53c16047a7523d499811ac0df41edaf3.tar.gz coredns-92a636df53c16047a7523d499811ac0df41edaf3.tar.zst coredns-92a636df53c16047a7523d499811ac0df41edaf3.zip |
plugin/file: z.Expired needs be read under a rlock (#3056)
Read lock before reading the Expired field of a zone.
Fixes: #3053
Signed-off-by: Miek Gieben <miek@miek.nl>
Diffstat (limited to 'plugin/file/file.go')
-rw-r--r-- | plugin/file/file.go | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/plugin/file/file.go b/plugin/file/file.go index c63fa43f5..8e10499fa 100644 --- a/plugin/file/file.go +++ b/plugin/file/file.go @@ -69,7 +69,10 @@ func (f File) ServeDNS(ctx context.Context, w dns.ResponseWriter, r *dns.Msg) (i return dns.RcodeSuccess, nil } - if z.Expired != nil && *z.Expired { + z.RLock() + exp := z.Expired + z.RUnlock() + if exp != nil && *exp { log.Errorf("Zone %s is expired", zone) return dns.RcodeServerFailure, nil } |