From: Pieter Lexis Date: Wed, 4 May 2016 17:18:01 +0000 (+0200) Subject: Prevent launching identical backends X-Git-Tag: auth-4.0.0-alpha3~3^2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=c52dd6afc57cd374e011e904804c0f07ef38104c;p=thirdparty%2Fpdns.git Prevent launching identical backends This catches configuration bugs (mostly when includes are used) where a line `launch=backend` and a line `launch+=backend` occur in the sum of the configuration. Closes #3615 --- diff --git a/pdns/dnsbackend.cc b/pdns/dnsbackend.cc index a7b4d016b5..ac728e7605 100644 --- a/pdns/dnsbackend.cc +++ b/pdns/dnsbackend.cc @@ -134,6 +134,10 @@ void BackendMakerClass::launch(const string &instr) vector parts; stringtok(parts,instr,", "); + for (const auto part : parts) + if (count(parts.begin(), parts.end(), part) > 1) + throw ArgException("Refusing to launch multiple backends with the same name '" + part + "', verify all 'launch' statements in your configuration"); + for(vector::const_iterator i=parts.begin();i!=parts.end();++i) { const string &part=*i;