From: Pieter Lexis Date: Mon, 16 Oct 2017 15:20:38 +0000 (+0200) Subject: BIND: reject zones without 'file' stanza X-Git-Tag: rec-4.1.0-rc2~34^2~1 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=6808f3b5faf6ffc4bea8f78107be99766d2be75c;p=pdns BIND: reject zones without 'file' stanza Closes #5786 --- diff --git a/modules/bindbackend/bindbackend2.cc b/modules/bindbackend/bindbackend2.cc index a68a7a93a..ccfec1805 100644 --- a/modules/bindbackend/bindbackend2.cc +++ b/modules/bindbackend/bindbackend2.cc @@ -812,6 +812,12 @@ void Bind2Backend::loadConfig(string* status) i!=domains.end(); ++i) { + if (!(i->hadFileDirective)) { + L<name<<"' has no 'file' directive set in "<type == "") L<name<<"' has no type specified, assuming 'native'"<type!="master" && i->type!="slave" && i->type != "native" && i->type != "") { diff --git a/pdns/bindparser.yy b/pdns/bindparser.yy index d83190313..9f3bf4b8c 100644 --- a/pdns/bindparser.yy +++ b/pdns/bindparser.yy @@ -89,6 +89,8 @@ void BindParser::setVerbose(bool verbose) void BindParser::commit(BindDomainInfo DI) { + DI.hadFileDirective = (DI.filename != ""); + if(DI.filename[0]!='/') DI.filename=d_dir+"/"+DI.filename; diff --git a/pdns/bindparserclasses.hh b/pdns/bindparserclasses.hh index 4d7176380..b8a3caa23 100644 --- a/pdns/bindparserclasses.hh +++ b/pdns/bindparserclasses.hh @@ -51,6 +51,7 @@ public: vector masters; set alsoNotify; string type; + bool hadFileDirective; dev_t d_dev; ino_t d_ino;